Re: [R] Using nlm or optim

2010-07-08 Thread Anita Narwani
Hi All, Thanks for all of your help. I hadn't posted error messages, because I had tried many different formulations of those functions and each one gave a different error message. However, using your suggestions, I managed to make it work. You were right in that I only needed to call the constan

Re: [R] Using nlm or optim

2010-07-08 Thread Joris Meys
Without data I can't check, but try : mle(nll,start=list(c=0.01,z=2.1,s=200),fixed=list(V=Var,M=Mean)) With a random dataset I get : > Mean <- rnorm(136) > Var <- 1 + rnorm(136)^2 > mle(nll,start=list(c=0.01,z=2.1,s=200),fixed=list(V=Var,M=Mean)) Error in optim(start, f, method = method, hessian

Re: [R] Using nlm or optim

2010-07-08 Thread Ravi Varadhan
Hi, When you report errors please send a reproducible example that will allow us to better help you. At a minimum, you should cut and paste the actual call and the error message. I think the problem is that you should only have parameters as arguments, i.e. only c and z should be in the argum