
Compute hierarchical saturation probabilities and link parameters
Source:R/methods.R
compute_phi.RdComputes posterior draws of the link-scale parameters or coverage probabilities
(\(\phi\)) across cohorts and locations from an [imugap_fit] object.
Arguments
- object
an object of class
imugap_fitreturned by[sampling()].- link_scale
logical scalar; return link-scale parameters (\(\eta\)) instead of probabilities (\(\phi\))? (default:
FALSE).- posterior_size
integer scalar; optional number of posterior draws to retain from the tail of each chain (default:
NULL, keeping all draws).- ...
additional arguments (currently ignored).
Value
a 3D numeric array with dimensions c(draw, cohort, location) containing the
reconstructed posterior draws.
Details
In multi-layer models, sampling() retains orthonormalized spatial offsets (off_layer)
and parent aggregation shifts (mu_offset) while omitting the full unrolled
parameter matrix (raw_phi_mat) by default to conserve memory. compute_phi()
reconstructs the complete link-scale and probability profiles across the location hierarchy:
$$\eta_{l, t} = \eta_{\text{parent}(l), t} + \mu_{\text{parent}(l), t} + \delta_l$$
$$\phi_{l, t} = g^{-1}(\eta_{l, t})$$
where \(g^{-1}\) is the configured inverse-link function (e.g. logit or probit).