This PR adds a RecursiveLinearTransform which is a linear transformation applied recursively such that $yt = A y{t - 1} + x_t$ for $t > 0$, where $x_t$ and $y_t$ are $p$-vectors and $A$ is a $p\times p$ transition matrix. The series is initialized by $y_0 = 0$.
This transform can be used to easily declare linear state space models, e.g., a Cauchy random walk is
>>> from jax import random
>>> from jax import numpy as jnp
>>> import numpyro
>>> from numpyro import distributions as dist
>>>
>>> def cauchy_random_walk():
... return numpyro.sample(
... "x",
... dist.TransformedDistribution(
... dist.Cauchy(0, 1).expand([10, 1]).to_event(1),
... dist.transforms.RecursiveLinearTransform(jnp.eye(1)),
... ),
... )
A Kalman-style model for a rocket with state y = (position, velocity) is
This PR adds a
RecursiveLinearTransform
which is a linear transformation applied recursively such that $yt = A y{t - 1} + x_t$ for $t > 0$, where $x_t$ and $y_t$ are $p$-vectors and $A$ is a $p\times p$ transition matrix. The series is initialized by $y_0 = 0$.This transform can be used to easily declare linear state space models, e.g., a Cauchy random walk is
A Kalman-style model for a rocket with state
y = (position, velocity)
isThis PR also makes a few minor changes (happy to factor out if you prefer):
ExplicitReparam
from #1754 to comply with the stricter linting.RealFastFourierTransform
from #1762 to the documentation.venv
directory in theupdate_headers.py
script.docs/source/{examples,tutorials,getting_started.rst}
to.gitignore
.log_abs_det_jacobian
implementation using autodiff.