Re: [R] constrained optimization in R
On Tue, 21 Sep 2004 [EMAIL PROTECTED] wrote: R: I need to minimize a function such that the parameters when used in another function result in a particular value, which i fix. That is, I need min(f(a,b)) given g(a,b)=X, where min(.) is the minimum, f(.) and g(.) are functions (with unknown gradients) of parameters a and b and X is a fixed value. What optimization function(s) in R do you suggest? constrOptim looks like it will work except I don't know the gradient of the functions. constrOptim won't work -- it does INequality constraints. -thomas Thanks, Jason Higbee [[alternative HTML version deleted]] __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Thomas Lumley Assoc. Professor, Biostatistics [EMAIL PROTECTED] University of Washington, Seattle __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] constrained optimization in R
Have you considered doing an unconstrained penalized optimization, e.g. pen.f(x, X, penalty) = function(x)(f(x[1], x[2])+penalty*(g(x[1], x[2])-X)^2) Then give "pen.f" to optim. Start out with "penalty" small, then use optim's answers with one value of penalty as starting values for optim with double or 10 times the penalty. As long as f and g are reasonably well behaved, this should produce an answer without excessive effort. hope this helps. spencer graves [EMAIL PROTECTED] wrote: R: I need to minimize a function such that the parameters when used in another function result in a particular value, which i fix. That is, I need min(f(a,b)) given g(a,b)=X, where min(.) is the minimum, f(.) and g(.) are functions (with unknown gradients) of parameters a and b and X is a fixed value. What optimization function(s) in R do you suggest? constrOptim looks like it will work except I don't know the gradient of the functions. Thanks, Jason Higbee [[alternative HTML version deleted]] __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html -- Spencer Graves, PhD, Senior Development Engineer O: (408)938-4420; mobile: (408)655-4567 __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] constrained optimization in R
R: I need to minimize a function such that the parameters when used in another function result in a particular value, which i fix. That is, I need min(f(a,b)) given g(a,b)=X, where min(.) is the minimum, f(.) and g(.) are functions (with unknown gradients) of parameters a and b and X is a fixed value. What optimization function(s) in R do you suggest? constrOptim looks like it will work except I don't know the gradient of the functions. Thanks, Jason Higbee [[alternative HTML version deleted]] __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html