[R] Error message in using nlm() and optim()

Ravi Varadhan rvaradhan at jhmi.edu
Fri Oct 22 19:26:12 CEST 2010


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: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On
Behalf Of harishmani
Sent: Friday, October 22, 2010 1:28 AM
To: r-help at r-project.org
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.

______________________________________________
R-help at r-project.org 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.



More information about the R-help mailing list