Re: [R] Trouble with optim on a specific problem

2009-06-16 Thread Stu @ AGS
nonlinear optimization problem with linear constraints on the regression parameters. Thanks Stu > -Original Message- > From: Liviu Andronic [mailto:landronim...@gmail.com] > Sent: Tuesday, June 16, 2009 12:15 PM > Cc: r-help@r-project.org > Subject: Re: [R] Trouble with optim on a s

Re: [R] Trouble with optim on a specific problem

2009-06-16 Thread Liviu Andronic
Hello, On 6/16/09, Stu @ AGS wrote: > Thanks for your response! > No, my basic equation does not use matrices at all. It takes scalar values > and returns a scalar. > Not quite. Taking the example above, if you run the following: > with(observs , {1*x1*x2^2*x3^3}) [1] 0.000e+00 4.267e+16 8.910

Re: [R] Trouble with optim on a specific problem

2009-06-16 Thread Stu @ AGS
319, 0.087378640776699, 0.549295774647887, 0.0596026490066225, 0.61578947368421) Thank you again, Stu > -Original Message- > From: Liviu Andronic [mailto:landronim...@gmail.com] > Sent: Tuesday, June 16, 2009 2:35 AM > To: Stu @ AGS > Cc: r-help@r-project.org > Subject: Re: [R]

Re: [R] Trouble with optim on a specific problem

2009-06-15 Thread Liviu Andronic
Hello, On 6/16/09, Stu @ AGS wrote: > Error in optim(c(0.66, 0.999, 0.064), pe, NULL, method = "L-BFGS-B") : > > objective function in optim evaluates to length 6 not 1 > > > > pe <- function(c) c[1]*x1*x2^c[2]*x3^c[3] > I would suspect a matrix multiplication issue. In order to minimise you

[R] Trouble with optim on a specific problem

2009-06-15 Thread Stu @ AGS
Hello! I am getting the following errors when running optim() [I tried optim() with 3 different methods as you can see]: Error in optim(c(0.66, 0.999, 0.064), pe, NULL, method = "L-BFGS-B") : objective function in optim evaluates to length 6 not 1 > out <- optim( c(0.66, 0.999, 0.064),