[R] jags error message

Michael Bedward michael.bedward at gmail.com
Wed Nov 10 07:35:25 CET 2010


Hi James,

The following is probably more an expression of empathy than direct help :)

I've used rjags quite a bit but have often found it to be very picky
about the formulation of the model. Scripts that run without problem
under WinBUGS (for instance) provoke errors with jags and more often
than not the error message is uninformative or misleading. Sometimes
just fiddling with the syntax a little allows the model to run.

One thing that will generate the message you report is if you have a
model where values being sampled for one or more parameters become too
small to distinguish from zero.  For instance, I've struck this
problem with ordinal response models where the sampled probabilities
of category membership could be tiny.  My hack work-around was to use
nested min and max functions to limit the range of the sampled values.

Michael


On 10 November 2010 02:01, Maas James Dr (MED) <J.Maas at uea.ac.uk> wrote:
> Could anyone give me some clues as to the best way to debug this error message?  I think it is from the passing of variables back to R from the jags function which does Bayesian fitting.   The curious part for me is that the error messages seem random, yet the input data are always the same.  Any suggestions most welcome.
>
> Thanks
>
> J
>
>
> Compiling model graph
>   Resolving undeclared variables
>   Allocating nodes
>   Graph Size: 1604
>
>  |++++++++++++++++++++++++++++++++++++++++++++++++++| 100%
>  |**************************************************| 100%
> Error : NA/NaN/Inf in foreign function call (arg 1)
> In addition: There were 15 warnings (use warnings() to see them)
>
>
> ===============================
> Dr. Jim Maas
> University of East Anglia
>
>
>        [[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.
>



More information about the R-help mailing list