[R] nlm is

From: Hiba Baroud <hiba.baroud_at_hotmail.com>
Date: Tue, 15 Jun 2010 20:31:51 +0300

Hello,  

I am trying to compute MLE for non-Gaussian AR(1). The error term follows a difference poisson distribution. This distribution has one parameter (vector[2]).

So in total I want to estimate two parameters: the AR(1) paramter (vector[1]) and the distribution parameter.

My function is the negative loglikelihood derived from a mixing operator.  

f=function(vector) -sum(log((vector[1]*data$I)+((1-vector[1])*((exp(-2*vector[2]))*besselI(2*vector[2],data$PC)))))  

nlm(f,p=c(-0.2354,0.00003269))

Error in nlm(f, p = c(-0.2354, 3.269e-05)) :   non-finite value supplied by 'nlm'

In addition: There were 50 or more warnings (use warnings() to see the first 50)  

warnings()
Warning messages:

1: In besselI(2 * vector[2], data$PC) : value out of range in 'bessel_i'                           # all warnings are the same

 

 

I would like to know what are the possible ways to avoid having non-finite value.  

Thank you very much.  

H.                                                



Hotmail: Trusted email with Microsoft’s powerful SPAM protection.

        [[alternative HTML version deleted]]



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. Received on Tue 15 Jun 2010 - 17:33:53 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 15 Jun 2010 - 17:40:31 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive