[R] [R-SIG-Finance] Fast optimizer
dutangc at gmail.com
Fri Oct 30 09:29:06 CET 2009
Le 30 oct. 2009 à 02:21, R_help Help a écrit :
> Ok. I have the following likelihood function.
> L <- p*dpois(x,a)*dpois(y,b+c)+(1-p)*dpois(x,a+c)*dpois(y,b)
> where I have 100 points of (x,y) and parameters c(a,b,c,p) to
> estimate. Constraints are:
> 0 < p < 1
> a,b,c > 0
> c < a
> c < b
> I construct a loglikelihood function out of this. First ignoring the
> last two constraints, it takes optim with box constraint about 1-2 min
> to estimate this. I have to estimate the MLE on about 200 rolling
> windows. This will take very long. Is there any faster implementation?
Take a look at the CRAN task view on optimisation, you may find faster
> Secondly, I cannot incorporate the last two contraints using optim
you can test the trick
Ltilde <- function(a,b,c,p) ifelse( c < a & c < b, p*dpois(x,a)*dpois
> Thank you,
> On Thu, Oct 29, 2009 at 9:02 PM, Ravi Varadhan <rvaradhan at jhmi.edu>
>> You have hardly given us any information for us to be able to help
>> you. Give us more information on your problem, and, if possible, a
>> minimal, self-contained example of what you are trying to do.
>> Ravi Varadhan, Ph.D.
>> Assistant Professor,
>> Division of Geriatric Medicine and Gerontology
>> School of Medicine
>> Johns Hopkins University
>> Ph. (410) 502-2619
>> email: rvaradhan at jhmi.edu
>> ----- Original Message -----
>> From: R_help Help <rhelpacc at gmail.com>
>> Date: Thursday, October 29, 2009 8:24 pm
>> Subject: [R] Fast optimizer
>> To: r-help at r-project.org, r-sig-finance at stat.math.ethz.ch
>>> I'm using optim with box constraints to MLE on about 100 data
>>> It goes quite slow even on 4GB machine. I'm wondering if R has any
>>> faster implementation? Also, if I'd like to impose
>>> equality/nonequality constraints on parameters, which package I
>>> use? Any help would be appreciated. Thank you.
>>> R-help at r-project.org mailing list
>>> PLEASE do read the posting guide
>>> and provide commented, minimal, self-contained, reproducible code.
> R-SIG-Finance at stat.math.ethz.ch mailing list
> -- Subscriber-posting only.
> -- If you want to post, subscribe first.
Ph.D. student at ISFA, Lyon, France
More information about the R-help