You have not provided us sufficient information to help you. I would guess that the error message probably has something to do with the way your likelihood function is defined. Can you at least show us how the function is defined (just the argument list) and the optim call?
Ravi. -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of harishmani Sent: Friday, October 22, 2010 1:28 AM To: [email protected] Subject: [R] Error message in using nlm() and optim() I am facing a problem when trying to maximize the likelihood function. I am actually estimating a dynamic switching regression model using simulated likelihood approach. The likelihood function is estimated using Simulations and is extremely complex. It comprises of 16 parameters ,q1, q2, q3,.......q16. While attempting to maximize the likelihood function, using the functions nlm() and optim(), the following error message appears - Error: element 2 is empty; the part of the args list of '/' being evaluated was: (1, q11) I am not able to figure out the meaning of the above message. Can anyone help me out? -- View this message in context: http://r.789695.n4.nabble.com/Error-message-in-using-nlm-and-optim-tp3006652 p3006652.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ [email protected] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. ______________________________________________ [email protected] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

