Re: [R] Problem specifying "function" for "mle" operation

From: Peter Dalgaard <p.dalgaard_at_biostat.ku.dk>
Date: Wed 27 Jul 2005 - 19:34:24 EST

"Narcyz Ghinea" <Narcyz.Ghinea@swsahs.nsw.gov.au> writes:

> MY THEORY:
>
> I think it has something to do with the fact that the function
> argument is a vector in CASE 2. Hope this doesn't mean I have to
> re-write the function in a way that it doesn't require vector
> inputs.....

You do. The innards of mle has

    f <- function(p) {

        l <- as.list(p)
        names(l) <- nm
        l[n] <- fixed
        do.call("minuslogl", l)

    }

which converts the parameters to a list before calling the likelihood.  

> Any suggestions on how to make CASE 2 work would be appreciated.

Well, either you conform or you patch mle to handle functions with vector parameters....

-- 
   O__  ---- Peter Dalgaard             ุster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark          Ph:  (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)                  FAX: (+45) 35327907

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Wed Jul 27 19:38:51 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:34:03 EST