This is my data:-
c(3164, 3362, 4435, 3542, 3578, 4529)
I estimated its sample mean and standard deviation via mean
& sd
functions and got the following results
mu
[1] 3768.333
sigma
[1] 572.859
now I generated the parameter values that maximize the log likelihood assuming the underlying data is generated from a normal distribution using the following code and optim
function
op <- function(para){
loglik <- sum(log(dnorm(x,para[1],para[2])))
-loglik
}
optim(c(3200,570),op)
OUTPUT:-
$par
[1] 3768.2043 522.9118
$value
[1] 46.0705
$counts
function gradient
49 NA
$convergence
[1] 0
$message
NULL
My question is shouldn't the sample sd 572.859 be the parameter value that maximises the log-likelihood rather than 522.9118, and if not then how can we assume that the sample sd is an unbiased estimator of the population sd?