i have a function like 1+sin(a+bx) where -pi/2<=a+bx<=pi/2 i made a progrom using constrOptim() function but it is not giving good result. it depends on the initial value. but when i am doing simulation it is impossible of find the best initial value for every step. also i am not exactly sure how to input the restriction though i have read the help file of the function. here x is a set of values. would u please send me some instruction to find the best result from the obtimization. Kanak Choudhury sutdent of Jahangirnagar university Bangladesh mail: kanak562265@gmail.com [[alternative HTML version deleted]]
On Tue, Jul 8, 2008 at 11:28 AM, Kanak Choudhury <kanak562265 at gmail.com> wrote:> i have a function like > > 1+sin(a+bx) where -pi/2<=a+bx<=pi/2 > > i made a progrom using constrOptim() function but it is not giving good > result. it depends on the initial value. but when i am doing simulation it > is impossible of find the best initial value for every step. also i am not > exactly sure how to input the restriction though i have read the help file > of the function. here x is a set of values. would u please send me some > instruction to find the best result from the obtimization.Actually, there is no need to use R to optimize such a function. In truth, the analytical solution for your problem, in case you are wanting to maximize, is: a + b x = pi/2; in case of minimization, the solution is: a + b x = - pi/2. Paul
Hello, I am trying to run a constrained optimization in R. "constrOptim" is really useful and has helped me a lot, but unfortunately, it doesn't provide the hessian. Is there a solution to this problem? I've tried "optim" with penalty-functions and "L-BFGS-B", but it doesn't help. Alan. -- http://games.entertainment.gmx.net/de/entertainment/games/free/puzzle/6169196