dealing with missing data in NIMBLE

786 views
Skip to first unread message

Cindy ma

unread,
Mar 10, 2018, 10:13:31 PM3/10/18
to nimble-users
Hi All,

I am trying to deal with missing data problems using NIMBLE, but I failed all the time since it produced many NAs. I don't know why it happens and there's no detailed example in the manual. I mainly have the following questions:

1) How to prepare the missing data? Should I divide the data into observed data and missing data?
2) Should I initialize the missing values?

Thanks for your time and if you can kindly provide a detailed example of how to deal with missing data in NIMBLE, it would be great helpful.

Yours sincerely,
Cindy

Perry de Valpine

unread,
Mar 11, 2018, 4:42:19 AM3/11/18
to Cindy ma, nimble-users
Dear Cindy,

Have you seen the example in section 6.1 of the User Manual?  If so, can you say more about what is unclear?  To provide missing data, set data values to be NA.  A variable can contain some observed and some missing data, so it is not necessary to divide the data. In many such cases, it will help to provide initial values for those nodes in the inits argument to nimbleModel.  Otherwise initial values will be drawn from each node's prior distribution, which may or may not provide a good starting place for an MCMC.  For values in the same variable that are not missing, you can put NA in the inits.  For example:

y <- c(1, NA, 5) ## 1st and third values are observed, second value is missing
y.inits <- c(NA, 7, NA) ## provide an initial value for what is missing

Set the data to be y (either in nimbleModel or a subsequent call to the setData method of your model) and include y = y.inits in the list provided as the inits argument to nimbleModel.

Please let us know further questions.

Perry


--
You received this message because you are subscribed to the Google Groups "nimble-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nimble-users+unsubscribe@googlegroups.com.
To post to this group, send email to nimble...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nimble-users/29dece88-5092-473d-9252-2a4b44bf2061%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
Message has been deleted
Message has been deleted
Message has been deleted
0 new messages