Hello,
I'd like to obtain parameters for my poisson data. Having made the function

poisregfun = function(a,b) {Y.pred = exp(a + b*x) - sum(dpois(y, lambda =
Y.pred, log = TRUE))}

where Y is a vector of data to be regressed on another vector x.
I'm asking for

mle2(  poisregfun, start = list(a = 21, b = 0.7),
method = "Nelder-Mead")

Do I need more arguments than this?
regards,
Russell
(computer replies with:
'Error in optim(par = c(21, 0.7), fn = function (p)  :
  objective function in optim evaluates to length 20 not 1')

        [[alternative HTML version deleted]]

______________________________________________
R-help@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.

Reply via email to