I am fitting the normalized histogram of my dataset $x \in [60,80]$ to Nakagami distribution. First I have estimated the scale and shape parameters using dnaka
of VGAM
package through the following MLE code:
ll <- function(par) {
if(par[1]>0 & par[2]>0) {return(-sum(log(dnaka(x, scale = par[1], shape = par[2]) ) ) )} # m=shape, ohm or spread = scale
else return(Inf)
}
mle = optim(c(1000,1), ll)
Then, I am estimating the log-likelihood value based on the estimated parameters through the following code:
lik = sum(log(dnaka(x, shape = mle$par[1], scale = mle$par[2]) ) )
But the log-likelihood value lik is -Inf
. I understand that this infinite value is due to the exp(.) term in the PDF equation of Nakagami distribution. Is there a way to estimate the finite log-likelihood value for the Nakagami distribution for my dataset $x \in [60,80]$? Thank you.
shape >= 0.5
, so your log-likelihood function is not correct. – Maurits Evers