[R] selection of optim parameters

Fabian Gehring fabian.gehring at bluewin.ch
Mon Jul 5 21:53:18 CEST 2010


Hi all,

I am trying to rebuild the results of a study using a different data 
set. I'm using about 450 observations. The code I've written seems to 
work well, but I have some troubles minimizing the negative of the 
LogLikelyhood function using 5 free parameters.

As starting values I am using the result of the paper I am rebuiling. 
The system.time of the calculation of the function is about 0.65 sec. 
Since the free parameters should be within some boundaries I am using 
the following command:

optim(fn=calculateLogLikelyhood, c(0.4, 2, 0.4, 80000, 0.8), 
lower=c(0,0,0,0,0), upper=c(1, 5, Inf, Inf, 1), control=list(trace=1, 
maxit=1000))

Unfortunately the result doesn't seem to be reasonable. 3 of the 
optimized parameters are on the boundaries.

Unfortunately I don't have much experience using optimizatzion methods. 
That's why I am asking you.
Do you have any hints for me what should be taken into account when 
doing such an optimization.

Is there a good way to implement the boundaries into the code (instead 
of doing it while optimizing)? I've read about parscale in the 
help-section. Unfortunately I don't really know how to use it. And 
anyways, could this help? What other points/controls should be taken 
into account?

I know that this might be a bit little information about my current 
code. But I don't know what you need to give me some advise. Just let me 
know what you need to know.

Thankds



More information about the R-help mailing list