Re: [R] Error: function cannot be evaluated at initial parameters

2009-08-06 Thread Anmol Mohan
I am facing a similar problem The code which i am pasting below has been taken from the book "Bayesian Computation with R" by Jim Albert. laplace=function (logpost, mode, par) { options(warn=-1) fit=optim(mode, logpost, gr = NULL, par, hessian=TRUE, control=list(fnscale=-1)) o

Re: [R] Error: function cannot be evaluated at initial parameters

2008-09-18 Thread Rolf Turner
On 19/09/2008, at 2:33 PM, sandsky wrote: I have an error for a simple optimization problem. It is not a simple optimization problem. It is a totally silly optimization problem. Is there anyone knowing about this error? lambda1=-9 lambda2=-6 L<-function(a){ s2i2f<-(exp(-l