Hi, I'm using optim with box constraints to MLE on about 100 data points. 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 should use? Any help would be appreciated. Thank you. rc
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. ____________________________________________________________________ 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> Hi, > > I'm using optim with box constraints to MLE on about 100 data points. > 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 should > use? Any help would be appreciated. Thank you. > > rc > > ______________________________________________ > R-help at r-project.org mailing list > > PLEASE do read the posting guide > and provide commented, minimal, self-contained, reproducible code.
Dear R_Help Help, The critical questions are a) how many parameters do you have b) how pathological is the log-likelihood function c) how good are your initial values and d) how efficiently have you coded your objective function? Of these, the last is most likely the critical one, and the one you should be looking at first. (and consider suing your parents for giving you such a name.) Bill Venables. ________________________________________ From: r-help-bounces at r-project.org [r-help-bounces at r-project.org] On Behalf Of R_help Help [rhelpacc at gmail.com] Sent: 30 October 2009 10:22 To: r-help at r-project.org; r-sig-finance at stat.math.ethz.ch Subject: [R] Fast optimizer Hi, I'm using optim with box constraints to MLE on about 100 data points. 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 should use? Any help would be appreciated. Thank you. rc ______________________________________________ R-help at 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.
> Date: Fri, 30 Oct 2009 09:29:06 +0100 > From: Christophe Dutang <dutangc at gmail.com> > Subject: Re: [R] [R-SIG-Finance] Fast optimizer > To: R_help Help <rhelpacc at gmail.com> > Cc: r-help at r-project.org >> > 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 > algorithms. >There are several new or revised methods in development as well as a new wrapper optimx() in the r-forge OptimizeR project http://r-forge.r-project.org/R/?group_id=395 In particular Rvmmin is an all-R implementation of the algorithm at the heart of optim's BFGS but with bounds and mask (fixed parameter) constraints. I'm looking into how it can be made more convenient to hot-start with suspected "good" parameters, which would be likely be important here. JN
Reasonably Related Threads
- aggregating irregular time series
- lapply across using multiple columns
- How to plot two different lines with different color with the same "plot" function?
- Poisson dpois value is too small for double precision thus corrupts loglikelihood
- POSIX time conversion doesn't display digit