[R] optim with contraints

2003-06-21 Thread Adelchi Azzalini
There seems to exist peculiar cases where optim does not take care of constraints on the parameters to be optimized over. The call to optim is of the form opt - optim(cp, fn=sn.dev, gr=sn.dev.gh, method=L-BFGS-B, lower=c(-Inf, 1e-10, -0.99527), upper=c( Inf, Inf,

Re: [R] optim with contraints

2003-06-21 Thread Spencer Graves
Adelchi: Permit me to add to Prof. Ripley's comments: If you want to know how to get around this kind of problem, I will tell you that I would modify the definition of cp to send the constraints to +/-Inf. Functions like optim tend to work better with unconstrained problems than