# Maximum Likelihood Estimation Poisson distribution mle {stats4}

5 messages
Open this post in threaded view
|

## Maximum Likelihood Estimation Poisson distribution mle {stats4}

 Hi everyone! I am using the mle {stats4} to estimate the parameters of distributions by MLE method. I have a problem with the examples they provided with the mle{stats4} html files. Please check the example and my question below! Here is the mle html help file  http://stat.ethz.ch/R-manual/R-devel/library/stats4/html/mle.htmlIn the example provided with the help > od <- options(digits = 5) > x <- 0:10    #generating Poisson counts> y <- c(26, 17, 13, 12, 20, 5, 9, 8, 5, 4, 8)  #generating the frequesncies>  ## Easy one-dimensional MLE: > nLL <- function(lambda) -sum(stats::dpois(y, lambda, log=TRUE))  #they define the Poisson negative loglikelihood> fit0 <- mle(nLL, start = list(lambda = 5), nobs = NROW(y))  #they estimate the Poisson parameter using mle> fit0  #they call the outputCall: mle(minuslogl = nLL, start = list(lambda = 5), nobs = NROW(y)) Coefficients: lambda 11.545        #this is their estimated Lambda Vallue.Now my question is in a Poisson distribution the Maximum Likelihood estimator of the mean parameter lambda is  the sample mean, so if we calculate the sample mean of that generated Poisson distribution manually using R we get  the below!> sample.mean<- sum(x*y)/sum(y) > sample.mean [1] 3.5433 This is the contradiction!! Here I am getting the estimate as 3.5433(which is reasonable as most of the values are clustered around 3), but mle code gives the estimate 11.545(which may not be correct as this is out side the range 0:10) Why this contradiction?
Open this post in threaded view
|

## Re: Maximum Likelihood Estimation Poisson distribution mle {stats4}

 > -----Original Message----- > > sample.mean<- sum(x*y)/sum(y) > > sample.mean > [1] 3.5433 > > *This is the contradiction!! * > Here I am getting the estimate as 3.5433(which is reasonable > as most of the values are clustered around 3), but mle code > gives the estimate 11.545(which may not be correct as this is > out side the range 0:10) > > Why this contradiction? > > Ermm.. the sample mean is mean(y) which is 11.545 I deduce that you and the help page have different views on what the sample y represents. i also note that x does not figure at all in the help page's log-likelihood, suggesting that y is a simple set of counts, whereas you have interpreted x as the number of instances of each y. That appears not to be the case. S   ******************************************************************* This email and any attachments are confidential. Any use...{{dropped:8}} ______________________________________________ [hidden email] mailing list https://stat.ethz.ch/mailman/listinfo/r-helpPLEASE do read the posting guide http://www.R-project.org/posting-guide.htmland provide commented, minimal, self-contained, reproducible code.
Open this post in threaded view
|