On Mon, 2016-11-07 at 07:34 -0800, Jonathan Steinhart wrote:
> Hello,
>
> I am a newcomer to INLA (which I'm grateful to have discovered
> exists!), and am attempting to use it to model some biological time
> series data. There are S different subjects, from each of whom we
> have one time series (which, incidentally, occur at different and
> irregular time points). I'm modeling them using some fixed effects
> for covariates like age and weight, random per-subject (iid)
> intercepts, and one or more latent factors (e.g. rw1) replicated by
> subject to account for the per-subject trajectories.
>
> The goal is to select the model which best characterizes the
> variability in yet-unseen subjects without overfitting. To do this,
> what (I think) I'd like to do is compute the out-of-sample log
> predictive density for each subject s in 1, ..., S in turn, always
> conditioning on the data for all subjects except s (or maybe to do
> this in folds, since there are lots of data and the model fitting is
> pretty slow). My problem is that I can't figure out how to achieve
> this given the output and functions that I've found thus far.
>
Hi,
thanks for your email. to check out of sample perforance on groups of
data, you have to call inla several times. each time, you can can zero-
out some of the data setting them to NA, and then compare the observed
data with the predicted ones. so you have to create a loop and call
inla several times.
you can improve the speed, by starting at the prev fit, like
fit = NULL
for(split in 1:10) {
fit = inla(..., control.mode = list(result = fit, restart=TRUE),
control.predictor = list(compute=TRUE))
## compare predictions
...
}
hope this helps,
H
--
Håvard Rue
he...@r-inla.org