[R] Problem with reproducing log likelihood estimated with ghyp package
pdalgd at gmail.com
Sun Dec 18 10:53:42 CET 2011
On Dec 17, 2011, at 10:57 , Steinar wrote:
> I was playing around with the ghyp package and simulated series of
> t-distributed variables when suddenly i was not able to reproduce the log
> likelihood values reported by the package. When trying to reproduce the
> likelihood values, I summed the log(dt(x,v)) values and it worked with some
> simulated series but not all.
> Is there any obvious flaws with this script?
Try rethinking your definition of the likelihood.
I would expect that the likelihood depends on the scale and position parameters via (x-mu)/sigma or so. As far as I can tell, you are de facto setting mu=0 and sigma=1, which might sort of work if you are simulating with mu=0 and sigma=1, but not when sigma=5.
> #simulating 10000 relation of student t variables with df=4
> #Which implies a standrad deviation equal to sqrt(2)
> #To get student t distributed variabler with standard
> #deviation equal to 5 I rescale the first series
> #When i check the first series with the ghyp package, the result coincides
> #the sum of log likelihood calculated with dt(x, df, ncp, log = FALSE)
> fit_1=fit.tuv(series_1, silent=T, symmetric=T)
> #The two log likelihood estimates is approximatly equal, and the parameters
> #When I check series 2, i get a very different result. The estimate for mu
> and nu
> #is still sensible, but the log likelihood is very different from what i get
> #dt(x, df, ncp, log = FALSE)
> fit_2=fit.tuv(series_2, silent=T, symmetric=T)
> #This is very different
> View this message in context: http://r.789695.n4.nabble.com/Problem-with-reproducing-log-likelihood-estimated-with-ghyp-package-tp4207833p4207833.html
> Sent from the R help mailing list archive at Nabble.com.
> R-help at r-project.org mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Email: pd.mes at cbs.dk Priv: PDalgd at gmail.com
More information about the R-help