Hi Virgilio,
I think I understand; you want to generate and store samples of the
parameters and latent vectors _without_ computing the component
effects, and then _later_ compute the component effects and predictor
expressions?
Yes, if you look at the code for generate.bru(), you'll see that it
first generates the samples, and then only if a predictor formula has
been provided, calls evaluate_model() with "newdata" to evaluate the
component effects, and compute the predictor expression. You could do
the same at a later stage by _not_ providing a formula to generate,
and then later directly calling evaluate_model() in the same way as
generate.bru() does, using the generate() output as "state".
For completeness: the bru predict() method simply calls generate(),
and then a method that computes summary statistics. I plan to make
that summarisation function a supported exported method as well, but
currently that's a more internal part of the predict() function
itself.
"Chunking" the generate() behaviour is something I've wanted to do for
a long time, including using recursive quantile estimation methods in
predict(), to allow a smaller memory footprint when using a large
number of samples, but splitting the parameter/component generation
from the effect&predictor computation I hadn't really considered, even
though as said above is something that should simply work, by doing
exactly what generate does when you do supply a formula and "newdata".
Finn
--
Finn Lindgren
email:
finn.l...@gmail.com