-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Referencing likelihood/bru_obs parameters in joint models #256
Comments
The names in the inla summary output for the parameters are "sanitized" using bru_standardise_names(), https://inlabru-org.github.io/inlabru/reference/bru_standardise_names.html Perhaps the easiest way to get the full list of standardised names is to run generate(fit, n.samples=1) and inspect the output; it will list all the component names, and the hyperparameter names. While the ordering of parameters in inla is mostly predictable, I would recommend not relying on it. In the long term plans for inlabru is to make the hyperparameters accessible by standard names "within" each component, just as name_latent makes the hidden latent variables for component name available to the predictor expression, whereas name by itself is the "effect of name". So in the future, hopefully name_prec would work, as well as tag_some_likelihood_parameter, whereas "tag" is a name given to each observation model like()/bru_obs(). |
The Details section of https://inlabru-org.github.io/inlabru/reference/predict.bru.html has some information about what's available to the predictor expressions. |
The likelihood specific hyperparameters should be in the same order as given to bru(). When the models are of different typ that doesn't matter if one references them by name, but in your example one has to rely on the ordering, at least in the names themselves; the [2] is attached to the second observation model when there are two of the same sort. Unfortunately the naming of the inla output is dependent on internal inla implementation details for some models. So making a more standardised translation in the inlabru output is a likely future solution. |
Thank you for your prompt help, Finn. That's all useful information and reviewing |
I'm fitting a joint model with two spatially varying ZIP likelihoods. From the tutorials and documentation (as far as I can tell), it's not obvious how best to correctly reference the two
zero-probability parameter for zero-inflated poisson_1
parameters during prediction, or for that matter how to generally reference hyperparameters.The summary of the bru.fit looks like this:
Working from the ZIP/ZAP vignette, I tried to reference these parameters in the predict formula like this:
This works for the first one (total in my example), but this returns NA/NaNs for the terms relying on the second zero-prob hyperparameter. For example,
print
ing my predict object returns:I have a few general questions from this:
Does the ordering of these hyperparameters always align with the order of the
bru_obs
passed intobru()
? I can tell that it the ordering aligns in this example based on the values of the zero-prob parameters. That is, I ranbru(comps, bru_obs_total, bru_obs_feat)
and zero-probability parameter for zero-inflated poisson_1is from
bru_obs_totaland
zero-probability parameter for zero-inflated poisson_1[2]is from
bru_obs_feat`.How can I reference these (or other hyperparameters) in
predict
orgenerate
formulas?Is there documentation anywhere that explains what objects are available for named reference in the predict/generate formulas?
Let me know if it would be helpful for me to put together a reproducible example. Also let me know if there is a more appropriate venue to pose questions like this. I'm not sure it's necessarily an issue or a bug.
Many thanks for working on this great package (and neat extension to INLA).
The text was updated successfully, but these errors were encountered: