[R] EM norm package (NA/NaN/Inf in foreign function call (arg 2))

tk@tariqkhan.org tk at tariqkhan.org
Thu Aug 26 15:58:56 CEST 2004


Greetings!

I am bootstrapping and I am using EM in the norm package to fill in missing
data for a financial time series with each step of the loop. For the most
part EM works fine for me, but the following error message is guaranteed
before I hit the 200th scenario:

Iterations of EM:
1...2...3........348...349...Error: NA/NaN/Inf in foreign function call
(arg 2)

The following code should replicate the error by downloading the dataset
from the internet (it is not too big):

library(norm)
df<-download.file("http://www.tariqkhan.org/R/DataFromExcel.csv",
"C:/Program Files/R/d.csv")
mat<-as.matrix(read.table("C:/Program Files/R/d.csv", sep = ","))
s<-prelim.norm(mat)
rngseed(1234567)
thetahat<-em.norm(s, maxits = 1000, criterion = 0.0035)

Iterations of EM:
1...2...3........348...349...Error: NA/NaN/Inf in foreign function call
(arg 2)

Someone else on the list found that using scale() helped with em.norm, but
for me it only increased the number of iterations before giving the same
error.

I dont get it. Insights into what I can do to solve this would be much
appreciated!

Details:
Norm Package version 1.0.9; 
R version 1.9.0;
Windows XP Pro 2002 SP1; 
384MB RAM, Pentium 4 CPU 2.40 GHz

--------------------------------------------------------------------
mail2web - Check your email from the web at
http://mail2web.com/ .




More information about the R-help mailing list