[R] Help MLE
LFRC
feliperiehs at yahoo.com.br
Thu Oct 9 20:34:44 CEST 2008
Dear,
I'm starting on R language. I would like some help to implement a MLE
function.
I wish to obtain the variables values (alpha12, w_g12, w_u12) that maximize
the function LL = Y*ln(alpha12 + g*w_g12 + u*w_u12).
Following the code:
rm(list=ls())
ls()
library(stats4)
Model = function(alpha12,w_g12,w_u12)
{
Y = 1
u = 0.5
g = -1
Y*log(alpha12 + g*w_g12 + u*w_u12)
}
res = mle(minuslog=Model,start=list(alpha12=0.1,w_u12=0.1,w_g12=0.1),
method = "BFGS")
res
Error message:
> res = mle(minuslog=Model,start=list(alpha12=0.1, w_u12=0.1, w_g12=0.1),
method = "BFGS")
Error in optim(start, f, method = method, hessian = TRUE, ...) :
non-finite finite-difference value [1]
Thanks,
LF
--
View this message in context: http://www.nabble.com/Help-MLE-tp19904724p19904724.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help
mailing list