Estimador de máximo-verossimilhança

set.seed(17/11/2021)
n<-1e6

mu<-seq(-3,3,length.out=10)

mat.x<-sapply(mu, \(mu) rnorm(n, mean = mu, sd = 1))

mat.y <- mat.x<0

q <- \(y) {-qnorm(mean(y))}

par<-mu
est<-apply(mat.y,2,q)

plot(par,est, main= "Estimativa de MV x Parâmetro", xlab= bquote(mu), ylab= bquote(hat(mu)))
abline(a=0,b=1,col="red")

mat<-matrix(c(par,est),nrow=2,byrow=TRUE)
rownames(mat)<-c("parâmetro","estimativa")
knitr::kable(mat)
parâmetro -3.00000 -2.333333 -1.666667 -1.0000000 -0.3333333 0.3333333 1.0000000 1.666667 2.333333 3.00000
estimativa -2.99394 -2.335985 -1.669482 -0.9993689 -0.3334906 0.3313634 0.9979698 1.668886 2.331140 3.00156