Hello All, I'm trying to run a one-dimenional irt model using the packages MCMC and coda on a rather large set of roll-call voting data with many missing observations. Here's a sample of the code: Post10<- MCMCirt1d (Italy10, burnin = 1000, mcmc=50000, thin=100, verbose=TRUE, theta.constraints = list(V549=1, V443=-1)) The MCMCirt1d command seems to work fine, but when I try to summarize the output I get the following error message(s): summary(Post10) Error: NA/NaN/Inf in foreign function call (arg 1) In addition: Warning message: Step size truncated due to divergence My understanding is that this has something to do with the missing data, though I don't know how to address this issue. Any help would be greatly appreciated. Thank you, Robin Best
On Sun, 31 Oct 2004 rbest1 at binghamton.edu wrote:> Hello All, > > I'm trying to run a one-dimenional irt model using the packages MCMC and > coda on a rather large set of roll-call voting data with many missing > observations. Here's a sample of the code: > Post10<- > MCMCirt1d (Italy10, burnin = 1000, mcmc=50000, thin=100, verbose=TRUE, > theta.constraints = list(V549=1, V443=-1)) > > The MCMCirt1d command seems to work fine, but when I try to summarize the > output I get the following error message(s): > > summary(Post10) > Error: NA/NaN/Inf in foreign function call (arg 1) > In addition: Warning message: > Step size truncated due to divergence > > My understanding is that this has something to do with the missing data, > though I don't know how to address this issue. Any help would be greatly > appreciated.Your understanding is not correct: NaN and Inf result from numeric overflow, divide by zero and similar. When you get an error message, try traceback() to see where it came from. This came from a `foreign', that is .C or .Fortran, call, passing in a NaN or Inf or NA, and probably one of the first two given the warning on divergence. But without a tracebacl() we don't know which call. -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
Robin, This is a problem with coda's mcmc summary method. I suspect it is in the spectrum0() call therein, but I don't know for sure. For your immediate purposes you could extract the posterior density sample as a matrix from the mcmc object and manually compute quantities of interest. Best, ADM On Oct 31, 2004, at 3:15 PM, rbest1 at binghamton.edu wrote:> Hello All, > > I'm trying to run a one-dimenional irt model using the packages MCMC > and > coda on a rather large set of roll-call voting data with many missing > observations. Here's a sample of the code: > Post10<- > MCMCirt1d (Italy10, burnin = 1000, mcmc=50000, thin=100, verbose=TRUE, > theta.constraints = list(V549=1, V443=-1)) > > The MCMCirt1d command seems to work fine, but when I try to summarize > the > output I get the following error message(s): > > summary(Post10) > Error: NA/NaN/Inf in foreign function call (arg 1) > In addition: Warning message: > Step size truncated due to divergence > > My understanding is that this has something to do with the missing > data, > though I don't know how to address this issue. Any help would be > greatly > appreciated. > > Thank you, > Robin Best > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.html >-- Andrew D. Martin, Ph.D. Department of Political Science Washington University Campus Box 1063 One Brookings Drive St. Louis, MO 63130 (314) 935-5863 (Office) (314) 753-8377 (Cell) (314) 935-5856 (Fax) Office: Eliot Hall 326 Email: admartin at wustl.edu WWW: http://adm.wustl.edu