Tom Stone
2004-Jul-26 14:57 UTC
[R] choosing constraints for function optim method="L-BFGS-B" when they are in terms of other parameter values
I have a function of several variables which I wish to minimise over four variables, two of the upper bounds for which are defined in terms of other variables in the model over which minimisation will take place. I cannot work out how to code this in such a way as to avoid getting an error message when I run the code. If anyone can provide any assistance I will be most grateful. Best Regards Tom Stone
Prof Brian Ripley
2004-Jul-26 16:12 UTC
[R] choosing constraints for function optim method="L-BFGS-B" when they are in terms of other parameter values
Basically, you can't as L-BFGS-B implements box constraints and you don't have a box. You could run a nested optimization, the inner one being over the two variables that you want to upper-bound. Contact me offline if that is not clear to you. On Mon, 26 Jul 2004, Tom Stone wrote:> I have a function of several variables which I wish to minimise over four > variables, two of the upper bounds for which are defined in terms of other > variables in the model over which minimisation will take place. I cannot > work out how to code this in such a way as to avoid getting an error message > when I run the code.-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
Apparently Analagous Threads
- choosing constraints for function optim method="L-BFGS-B" whenthey are in terms of other parameter values
- Method of L-BFGS-B of optim evaluate function outside of box constraints
- disturbing seed dependence in optim L-BFGS-B method
- Likelihood returning inf values to optim(L-BFGS-B) other options?
- R optim(method="L-BFGS-B"): unexpected behavior when working with parent environments