Not necessarily homework, Bert. There's a generic issue with MLE and rounded 
data, in that gamma densities may be 0 at the boundary but small numbers are 
represented as 0, making the log-likelihood -Inf. 

The cleanest way out is to switch to a discretized distribution in the 
likelihood, so that instead of log(dgamma(0,...)) you use log(pgamma(.005,..) - 
pgamma(0,...)) == pgamma(.005,..., log=TRUE). (For data rounded to nearest .01, 
that is). Cruder techniques would be to just add, like, .0025 to all the zeros. 

-pd

> On 10 Jan 2023, at 18:42 , Bert Gunter <bgunter.4...@gmail.com> wrote:
> 
> Is this homework? This list has a no-homework policy.
> 
> 
> -- Bert
> 
> On Tue, Jan 10, 2023 at 8:13 AM Nyasha <kahuninyasha13...@gmail.com> wrote:
>> 
>> Please how can one go about this one? I don't know how to go about it.
>> 
>>        [[alternative HTML version deleted]]
>> 
>> ______________________________________________
>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> 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@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.

-- 
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Office: A 4.23
Email: pd....@cbs.dk  Priv: pda...@gmail.com

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.

Reply via email to