From: Xiaohui Chen <chenxh007_at_gmail.com>

Date: Tue, 20 May 2008 19:03:40 -0700

R-help_at_r-project.org mailing list

https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Wed 21 May 2008 - 02:10:00 GMT

Date: Tue, 20 May 2008 19:03:40 -0700

By the scale of log-likelihood, I did not mean the scale parameter of the gamma density...

Generally, as you get more and more data, the log-likelihood will get more and more negative. Hence, what I mean by scale is how negative of the values of loglik.

So the 10 values returned from your dgamma are the log-densities evaluated for your data points, respectively.

The loglik for your samples is just the sum of those from all data points, under the independency assumption.

X

Edward Wijaya $B<LF;(B:

> Dear Xiaohui,

*>
**> Thanks.
**>
**>
**>> The scale of log-likelihood depends on the number of your data samples
**>>
**> Can you explain what do you mean by this?
**>
**> For example if I have 10 data points. Should I use "scale=10" ?
**> And how about "shape" parameters. What's the rule to choose its value?
**>
**> Hope to hear from you again.
**>
**> Regards,
**> Edward
**>
**>
**>
**>
**>> Edward Wijaya $B<LF;(B:
**>>
**>>> Dear all,
**>>>
**>>> How can I compute the log likelihood of a gamma
**>>> distributions of a vector.
**>>>
**>>> I tried the following. But it doesn't seem to work:
**>>>
**>>> samples<-c(6.1, 2.2, 14.9, 9.9, 24.6, 13.2)
**>>> llgm <- dgamma(samples, scale=1, shape=2, log = TRUE)
**>>>
**>>> It gives
**>>>
**>>> [1] -4.291711 -1.411543 -12.198639 -7.607465 -21.397254 -10.619783
**>>>
**>>> I expect it only returns "one" value instead of vector.
**>>> What's wrong with my command above?
**>>>
**>>> - Edward
**>>>
**>>> ______________________________________________
**>>> R-help_at_r-project.org mailing list
**>>> https://stat.ethz.ch/mailman/listinfo/r-help
**>>> PLEASE do read the posting guide
**>>> http://www.R-project.org/posting-guide.html
**>>> and provide commented, minimal, self-contained, reproducible code.
**>>>
**>>>
**>>>
**>>
**>
**>
*

R-help_at_r-project.org mailing list

https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Wed 21 May 2008 - 02:10:00 GMT

Archive maintained by Robert King, hosted by
the discipline of
statistics at the
University of Newcastle,
Australia.

Archive generated by hypermail 2.2.0, at Wed 21 May 2008 - 03:30:39 GMT.

*
Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help.
Please read the posting
guide before posting to the list.
*