SlowGuess/NeurIPS_2023_OCR huggingface dataset:
If  $\mu, \Sigma \sim \mathrm{NIW}(S, m, \lambda, \nu)$  for (i)  $\mu, m \in \mathbb{R}^n$ , (ii)  $\Sigma, S \in S_{++}^n$ , (iii)  $\lambda \in \mathbb{R}_+$ , and (iv)  $\nu \in \mathbb{R}_{>n-1}$ , then  $p(\mu, \Sigma; S, m, \lambda, \nu)$  is given by:
$$
\eta = \left[ \begin{array}{c} S + \lambda m m ^ {T} \\ \lambda m \\ \lambda \\ \nu + n + 2 \end{array} \right] \quad t (\mu , \Sigma) = \left[ \begin{array}{c} - \frac {1}{2} \Sigma^ {- 1} \\ \Sigma^ {- 1} \mu \\ - \frac {1}{2} \mu^ {T} \Sigma^ {- 1} \mu \\ - \frac {1}{2} \log | \Sigma | \end{array} \right] \quad \mathbb {E} [ t (\mu , \Sigma) ] = \left[ \begin{array}{c} - \frac {1}{2} \nu S ^ {- 1} \\ \nu S ^ {- 1} m \\ - \frac {1}{2} (n / \lambda + \nu m ^ {T} S ^ {- 1} m) \\ \frac {1}{2} (n \log 2 - \log | S | + \Sigma_ {i = 0} ^ {n - 1} \psi (\frac {\nu - i}{2})) \end{array} \right] \tag {187}
$$
Where  $\psi$  is the digamma function. The log partition function is given by:
$$
\log Z (\eta) = \frac {\nu}{2} \cdot (n \log 2 - \log | S |) + \log \Gamma_ {n} \left(\frac {\nu}{2}\right) + \frac {n}{2} (\log (2 \pi) - \log \lambda) \tag {188}
$$
With the multivariate gamma function  $\Gamma_{n}$
G.3 Matrix normal inverse Wishart (MNIW) distribution
If  $X, \Sigma \sim \mathrm{MNIW}(S, M, V, \nu)$  for (i)  $X, M \in \mathbb{R}^{n \times m}$ , (ii)  $\Sigma, S \in S_{++}^n$ , (iii)  $V \in S_{++}^m$ , and (iv)  $\nu \in \mathbb{R}_{>n-1}$ , then  $p(X, \Sigma; S, M, V, \nu)$  is given by:
$$
\eta = \left[ \begin{array}{c} S + M V M ^ {T} \\ M V \\ V \\ \nu + n + m + 1 \end{array} \right] \quad t (X, \Sigma) = \left[ \begin{array}{c} - \frac {1}{2} \Sigma^ {- 1} \\ \Sigma^ {- 1} X \\ - \frac {1}{2} X ^ {T} \Sigma^ {- 1} X \\ - \frac {1}{2} \log | \Sigma | \end{array} \right] \quad \mathbb {E} [ t (X, \Sigma) ] = \left[ \begin{array}{c} - \frac {1}{2} \nu S ^ {- 1} \\ \nu S ^ {- 1} M \\ - \frac {1}{2} (n V ^ {- 1} + \nu M ^ {T} S ^ {- 1} M) \\ n \log 2 - \log | S | + \Sigma_ {i = 0} ^ {n - 1} \psi (\frac {\nu - i}{2}) \end{array} \right] \tag {189}
$$
$$
\log Z (\eta) = \frac {\nu}{2} \cdot (n \log 2 - \log | S |) + \log \Gamma_ {n} \left(\frac {\nu}{2}\right) - \frac {n}{2} | V | + \frac {n \cdot m}{2} \log (2 \pi) \tag {190}
$$
With the multivariate gamma function  $\Gamma_{n}$ . For the SLDS, we use this MNIW distribution by defining  $X\in \mathbb{R}^{n\times n + 1} = [A|b]$  where  $z_{t + 1}\sim \mathcal{N}(Az_t + b,\Sigma)$  so the MNIW distribution provides a prior on the transition matrix, offset, and conditional noise.