Skip to content

Commit ece57b1

Browse files
added docstring
1 parent e7ccfe2 commit ece57b1

File tree

1 file changed

+25
-2
lines changed

1 file changed

+25
-2
lines changed

pymc_extras/inference/INLA/inla.py

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,31 @@ def fit_INLA(
1515
return_latent_posteriors: bool = False,
1616
**sampler_kwargs,
1717
) -> az.InferenceData:
18-
"""
19-
TODO ADD DOCSTRING
18+
r"""
19+
Performs inference over a linear mixed model using Integrated Nested Laplace Approximations (INLA).
20+
21+
As it stands, INLA in PyMC Extras has three main limitations:
22+
23+
- Does not support inference over the latent field, only the hyperparameters.
24+
- Optimisation for $\mu^*$ is bottlenecked by calling `minimize`, and to a lesser extent, computing the hessian $f^"(x)$.
25+
- Does not offer sparse support which can provide significant speedups.
26+
27+
Parameters
28+
----------
29+
x: TensorVariable
30+
The latent gaussian to marginalize out.
31+
Q: TensorVariable
32+
Precision matrix of the latent field.
33+
minimizer_seed: int
34+
Seed for random initialisation of the minimum point x*.
35+
model: pm.Model
36+
PyMC model.
37+
minimizer_kwargs:
38+
Kwargs to pass to pytensor.optimize.minimize during the optimization step maximizing logp(x | y, params).
39+
returned_latent_posteriors:
40+
If True, also return posteriors for the latent Gaussian field (currently unsupported).
41+
sampler_kwargs:
42+
Kwargs to pass to pm.sample.
2043
"""
2144
model = pm.modelcontext(model)
2245

0 commit comments

Comments
 (0)