Estimate DLM parameters (obsStd, processStd, and optionally arCoefficients)
by maximum likelihood via autodiff.
The entire optimization step — valueAndGrad(loss) (Kalman filter forward
pass + AD backward pass) and optax Adam moment/parameter updates — is
wrapped in a single jit() call, so every iteration runs from compiled code.
The parameterization maps unconstrained reals → positive values:
obsStd = exp(θ_s), processStd[i] = exp(θ_{w,i})
AR coefficients are optimized directly when enabled via
params.arCoefficients.fit (unconstrained — not log-transformed,
matching MATLAB DLM behavior).
When params.obsStd.fixed is supplied (a scalar or per-timestep σ array,
e.g. known measurement uncertainties), the observation noise is not
estimated — it is treated as a known constant. Only processStd (and
optionally arCoefficients) are optimized. The returned obsStd field will
be NaN in this case.
Estimate DLM parameters (obsStd, processStd, and optionally arCoefficients) by maximum likelihood via autodiff.
The entire optimization step —
valueAndGrad(loss)(Kalman filter forward pass + AD backward pass) and optax Adam moment/parameter updates — is wrapped in a singlejit()call, so every iteration runs from compiled code.The parameterization maps unconstrained reals → positive values: obsStd = exp(θ_s), processStd[i] = exp(θ_{w,i}) AR coefficients are optimized directly when enabled via
params.arCoefficients.fit(unconstrained — not log-transformed, matching MATLAB DLM behavior).When
params.obsStd.fixedis supplied (a scalar or per-timestep σ array, e.g. known measurement uncertainties), the observation noise is not estimated — it is treated as a known constant. Only processStd (and optionally arCoefficients) are optimized. The returnedobsStdfield will beNaNin this case.