posterior()#
- L2Solver.posterior()[source]#
Solve the Bayesian operator inference regression, constructing the means and inverse covariances of probability distributions for the rows of an operator matrix posterior.
In this method, the
regularizer, denoted \(\lambda\), is interpreted as a prior variance for the operator matrix distribution. The \(i\)-th row of the operator matrix follows a multivariate normal distribution with the following mean and covariance.\[\begin{split}\bfmu_i &= \argmin_{\bfxi}\left\{ \|\D\bfxi - \z_i\|_2^2 + \lambda^2\|\bfxi\|_2^2 \right\}, \\ \bfSigma_i &= \sigma_i^2 \left( \D\trp\D + \lambda^2\I \right)^{-1}, \\ \sigma_i^2 &= \frac{1}{k}\left( \|\D\bfmu_i - \z_i\|_2^2 + \lambda^2\|\bfmu_i\|_2^2 \right),\end{split}\]where \(\z_i\in\RR^k\) is the \(i\)-th row of \(\Z\). See [GMW22] for details.
- Returns:
- meanslist of r (d,) ndarrays
Mean vectors.
- precisionslist of r (d, d) ndarrays
Inverse covariance matrices.
- Raises:
- RuntimeError
If any solver residual \(\sigma_i^2\) is zero (a perfect regression), meaning the resulting covariance should be zero. In this case, do a deterministic regression with
solve(), not a Bayesian regression.