
CEMO, University of Oslo
October 20, 2026
\[ \definecolor{kaustorg}{RGB}{241, 143, 0} \definecolor{kausttur}{RGB}{0, 166, 170} \definecolor{kaustmer}{RGB}{177, 15, 46} \definecolor{kaustgrn}{RGB}{173, 191, 4} \definecolor{kaustblu}{RGB}{82, 132, 196} \definecolor{kaustpur}{RGB}{156, 111, 174} \]
Bayesian Computational Statistics and Modeling Research Group (BAYESCOMP)
Led by Prof. Håvard Rue—Integrated Nested Laplace Approximation (INLA, Rue et al., 2009)

MCMC per fit is the bottleneck.
INLA (Rue et al., 2009)…

This talk
A ✨bespoke✨ ground-up implementation of INLA for normal-theory SEM (continuous indicators).
This work is supported by the 2025 KAUST Competitive Research Grant (CRG) Award No. URF/1/6921-01-01.





Does industrialisation drive democracy? \(p=11\) indicators on \(n=75\) countries measure \(q=3\) factors: industrialisation (1960) and democracy (1960, 1965).
For \(s=1,\dots,n\), independently,
\[ \begin{aligned} \mathbf y_s \mid \boldsymbol\eta_s, \boldsymbol\vartheta &\sim \operatorname{N}_p\big(\boldsymbol\nu + {\color{kaustpur}\boldsymbol\Lambda}\boldsymbol\eta_s,\ {\color{kaustorg}\boldsymbol\Theta}\big) \\ \boldsymbol\eta_s \mid \boldsymbol\vartheta &\sim \operatorname{N}_q\big((\mathbf I - {\color{kaustgrn}\mathbf B})^{-1}\boldsymbol\alpha,\ \boldsymbol\Phi\big) \\ \boldsymbol\vartheta &\sim \pi(\boldsymbol\vartheta) \end{aligned} \]
with \(\boldsymbol\Phi = (\mathbf I - {\color{kaustgrn}\mathbf B})^{-1}{\color{kausttur}\boldsymbol\Psi}(\mathbf I - {\color{kaustgrn}\mathbf B})^{-\top}\).
\[ \pi(\boldsymbol\vartheta \mid \mathbf y) \propto \pi(\boldsymbol\vartheta) \prod_{s=1}^n \left\{ \int \pi(\mathbf y_s \mid \boldsymbol\eta_s, \boldsymbol\vartheta)\, \pi(\boldsymbol\eta_s \mid \boldsymbol\vartheta)\, d\boldsymbol\eta_s \right\} \]
R-INLA: 6 s (\(n=75\)), 125 s (\(n=7500\)).



A ✨bespoke✨ INLA for SEM, making use of relevant key ideas (Laplace, simplified-Laplace marginals, a VB correction).
Steps 1 and 2 use the exact unnormalised log-posterior and its analytic gradient (Neudecker & Satorra, 1991; von Oertzen & Brick, 2014).

\[ \class{marginal-lhs}{\pi(\vartheta_j \mid \mathbf y)} = \int_{\mathbb R^{m-1}} e^{\log \pi(\vartheta_j, \boldsymbol\vartheta_{-j} \mid \mathbf y)} \, \mathrm d \boldsymbol\vartheta_{-j} \, \approx \, \overbrace{\pi\big(\vartheta_j, \boldsymbol\vartheta_{-j}^*(\vartheta_j) \mid \mathbf y\big)}^{\textstyle\text{height}} \times \overbrace{(2\pi)^{\frac{m-1}{2}} \left| \mathbf H_{-j}(\vartheta_j) \right|^{-1/2 }}^{\textstyle\text{(cond.) width}} \]
This is expensive to compute, as for every \(\vartheta_j\) evaluation, need
Next slides: two important results.

Lemma 1 (Conditional mean path) = No re-optimisation
Let \(\small \boldsymbol\vartheta\sim\operatorname{N}_m(\boldsymbol\vartheta^*,\boldsymbol\Omega)\) with \(\small\boldsymbol\Omega \succ \mathbf 0\). Then the marginal density of the \(\small j\)th component, \(\small j=1,\dots,m\), is proportional to the joint density evaluated along its CMP: \[ \small \pi(\vartheta_j=x) \propto \pi\big(\vartheta_j=x, \, \boldsymbol\vartheta_{-j} = \operatorname{E}[ \boldsymbol\vartheta_{-j} \mid \vartheta_j=x] \big). \]

Operationally,
Scanning along the CMP is cheap; no re-optimisation needed.
For Gaussian posteriors, this is exact; otherwise it provides a first-order approximation to a potentially curved ridge.
Lemma 2 (Efficient volume correction) = No need to factor dense Hessian
For the \(\small j\)th component along the CMP, \(\small-\frac12 \log | \mathbf H_{-j}(t) | \approx \text{const.} + t\gamma_j'\). Then \[ \small \gamma_j' = -\frac{1}{2} \sum_{k=1}^m \frac{d}{dt} \left[ \mathbf{L}_{\cdot k}^{\top}\,\frac{d}{d\mathbf{L}_{\cdot k}}\mathbf{g} \right]_{t=0} + \frac{1}{2}\, \frac{d}{dt} \left[ \mathbf{v}_j^{\top}\,\frac{d}{d\mathbf{v}_j}\mathbf{g} \right]_{t=0}, \] where \(\small\mathbf{g}(\boldsymbol\vartheta) = -\nabla \log \pi(\boldsymbol\vartheta \mid \mathbf{y})\), and \(\small\mathbf H(\boldsymbol\vartheta^*)^{-1}=\mathbf L\mathbf L^\top\).

For non-symmetric densities, the conditional spread (“width”) changes along the scan line. This change can be computed entirely via directional derivatives.
Forward difference cost is only \(m+2\) gradient evaluations for each \(j\). Note: Baseline is unity in whitened coordinates.
outer \(\small\nabla^3\)] Shift to \(\boldsymbol\vartheta^+\) along CMP, evaluate gradient.inner \(\small\nabla^2\)] Perturb along \(\mathbf{L}_{\cdot k}\) and the scan direction \(\mathbf{v}_j\), evaluating gradients.Fit a skew normal pdf to these points via weighted least squares. A convenient default is \(w_{kj} \propto \exp(h_{kj})\), for \(j=1,\dots m\).
Map back from \(t\) to \(\vartheta_j\) scale via the affine \(\vartheta_j = \vartheta_j^* + t\sqrt{\Omega_{jj}}\).


\[(\hat\xi_j,\hat\omega_j,\hat\alpha_j,\hat c_j) = \operatorname{argmin}_{\xi,\omega,\alpha,c} \, \sum_{k=1}^K w_{kj}\big[ h_{kj}-\big\{\log f_{\mathrm{SN}}(\vartheta_j(t_k);\xi,\omega,\alpha)+c\big\} \big]^2\]
\[ \underbrace{\mathbf z \sim N_m(\mathbf 0, \mathbf R)}_{\text{Gaussian correlation}} \xrightarrow{\quad \Phi(\cdot) \quad} \underbrace{\mathbf u}_{\ \text{Uniform} \ } \xrightarrow{\quad F_{\text{SN}}^{-1}(\cdot) \quad} \underbrace{\boldsymbol\vartheta}_{\text{SN Marginals}} \]
Reconstruct joint posterior samples \(\{\boldsymbol\vartheta^{(1)},\dots,\boldsymbol\vartheta^{(B)}\}\) using a Copula (Nelsen, 2006), preserving Gaussian correlations: \[ \mathbf R = \mathbf D^{-1/2} \boldsymbol \Omega \mathbf D^{-1/2}, \qquad \mathbf D = \operatorname{diag}(\boldsymbol\Omega). \]
This also allows us to derive approximate posteriors for

asem(), acfa(), agrowth() with dp = priors_for() option.



| Tool | Good for | Catch |
|---|---|---|
| Bayes factor (Kass & Raftery, 1995) | Weighing evidence between models, priors included | Priors on extra parameters set the Occam penalty |
| PPP, BRMSEA, BCFI (Garnier-Villarreal & Jorgensen, 2020) | Checking whether one model fits | One model at a time; frequentist cut-offs |
| DIC (Spiegelhalter et al., 2002) | A quick predictive ranking | Plug-in; favours flexible models (Fujimoto & Falk, 2024) |
| LOO (Vehtari et al., 2017) | Predicting new subjects, with per-subject scores | \(n\) refits |

Theorem (Laplace approximation of the CPO) = No refits, no draws
Under \(\small\operatorname{N}_m(\tilde{\boldsymbol\vartheta}, \mathbf H^{-1})\), expand \(\small\ell_s(\boldsymbol\vartheta) := \log\pi(\mathbf y_s \mid \boldsymbol\vartheta)\) about \(\small\tilde{\boldsymbol\vartheta}\), with score \(\small\mathbf g_s := \nabla\ell_s(\tilde{\boldsymbol\vartheta})\) and information \(\small\boldsymbol{\mathcal I}_s := -\nabla^2\ell_s(\tilde{\boldsymbol\vartheta})\). The Gaussian integral is then exact: \[ \small \begin{aligned} {\color{gray}\tiny\mathrm{[1st]}} \ \log\hat\pi^{(1)}(\mathbf y_s \mid \mathbf y_{-s}) &= \ell_s(\tilde{\boldsymbol\vartheta}) - \tfrac12\, \mathbf g_s^\top \mathbf H^{-1} \mathbf g_s, \ {\color{gray}\scriptsize\leftarrow \text{optimistic by } \tfrac12 p_{\text{eff}} \text{ in total}} \\ {\color{gray}\tiny\mathrm{[2nd]}} \ \log\hat\pi^{(2)}(\mathbf y_s \mid \mathbf y_{-s}) &= \underbrace{\ell_s(\tilde{\boldsymbol\vartheta})}_{\text{fit}} - \underbrace{\tfrac12\, \mathbf g_s^\top (\mathbf H - \boldsymbol{\mathcal I}_s)^{-1} \mathbf g_s}_{\text{sensitivity}} + \underbrace{\tfrac12 \log\big| \mathbf H^{-1}(\mathbf H - \boldsymbol{\mathcal I}_s) \big|}_{\text{volume}}. \end{aligned} \] [2nd] exists \(\iff (\small\mathbf H - \boldsymbol{\mathcal I}_s) \succ \mathbf 0\), i.e., \(\small k_s := \lambda_{\max}(\mathbf H^{-1}\boldsymbol{\mathcal I}_s) < 1\).
fit_bollen <- asem(mod_bollen, PoliticalDemocracy, meanstructure = TRUE) # Bollen (1989)
fit_nodirect <- asem(mod_nodirect, PoliticalDemocracy, meanstructure = TRUE) # drop dem65~ind60
fit_nocov <- asem(mod_nocov, PoliticalDemocracy, meanstructure = TRUE) # drop residual covs
compare(fit_bollen, fit_nodirect, fit_nocov, loo = TRUE)Bayesian Model Comparison (INLAvaan)
Models ordered by ELPD (Taylor LOO, second-order)
elpd_diff/se_diff are paired differences vs the best model
Model npar Marg.Loglik logBF DIC pD ELPD SE p_loo elpd_diff se_diff
fit_bollen 42 -1697.938 -1.156 3179.035 41.050 -1590.199 20.256 40.457 0.000 0.000
fit_nodirect 41 -1696.782 0.000 3181.335 39.133 -1591.882 19.746 39.144 -1.683 2.316
fit_nocov 36 -1703.182 -6.401 3201.623 35.436 -1600.126 20.195 33.065 -9.927 6.609

| INLAvaan | HMC + PSIS | |
|---|---|---|
ELPD (bollen) |
−1590.2 | −1591.6 |
Δ (nodirect) |
−1.7 | −1.9 |
Δ (nocov) |
−9.9 | −9.3 |
| Time per model | 1.2 s + 0.07 s | 30 s + PSIS |
HMC: 30,000 draws on three cores.
Needs one dominant interior mode; weak identification can break \(\mathbf H \succ 0\) (but HMC struggles there too).
Near-zero variances push the SN fit to its limits: lower tail understated, so check against MCMC.
The Gaussian copula captures pairwise correlations, but not extreme tail dependence.
Cost grows with \(m\); tested to \(m = 256\) in about 20 s.
🔥 Non-Gaussian items (binary, ordinal, etc).
🎯 Better prior support (priors for correlation matrices Freni-Sterrantino et al., 2026; PC priors Simpson et al., 2017).
⏱️ Dynamic SEM such as continuous-time SEM (Driver et al., 2017).
🗺️ Spatial and spatio-temporal extensions (Krainski et al., 2018).
arXiv:2603.25690).arXiv:2604.00671).arXiv:2609.00670).install.packages("INLAvaan"), docs at https://inlavaan.haziqj.ml.