[R] mle.
Ben Bolker
bolker at ufl.edu
Wed Mar 1 15:55:16 CET 2006
Arun Kumar Saha <arun.kumar.saha <at> gmail.com> writes:
>
> hi all,
>
> suppose I have:
>
> r[i] ~ N(0, h[i])
> h[i] = a + b*r[i-1] + c*h[i-1] for all i=2..........n
>
> I want to get estimates of a, b, c by mle.
>
> Can you tell me how to do that?
>
(1) can you convince us this isn't a homework problem?
(a little bit more context would be nice in any case)
(2) are both r and h observed? if so, then
your (negative log-)likelihood function can use
something along the lines of
-sum(dnorm(r,mean=...,sd=...,log=FALSE))-sum(dnorm(h,mean=...,sd=...,log=FALSE))
where you fill in the predicted mean and std. dev. of each.
Ben Bolker
More information about the R-help
mailing list