Unless otherwise noted, all filesystem paths are relative to the "Working path" named above.
Conditional clique node
Continuing from yesterday, let's convert our conditional gaussian distribution to a gaussian function over \(x_c\) and \(\mu_b\).
Let \(II\) represent a stack of identity matrices:
\[
II = \left( \begin{array}{c} I\\I\\...\\I \end{array}\right)
\]
The exponential expression for the conditional Gaussian distribution is
\[
-\frac{1}{2} (x_C - II \mu_b)^\top \left( \Sigma_C + II \Sigma_b II^\top \right )^{-1}(x_C - II \mu_b)
\]
Let's convert this to a linear function over \((x_C, \mu_b)\), instead of just \(x_C\):
\[
-\frac{1}{2} \left(\begin{array}{c}x_C \\ \mu_b \end{array} \right )^\top \left ( \begin{array}{cc}I & -II\end{array}\right )^\top \left( \Sigma_C + II \Sigma_b II^\top \right )^{-1}\left ( \begin{array}{cc}I & -II\end{array}\right )\left(\begin{array}{c}x_C \\ \mu_b \end{array}\right )
\]
Recall that \(\mu_b\) is a linear function of the data-points in the Markov-blanket, \(y_\mathcal{MB}\) (reproduced from yesterday's post)
(didn't implement) Marginalize clique tree. compare against result in 7.
I originally thought the result from 8 was only an approximation (mainly because I hadn't originally written it out that way). In fact, it's an exact computation, but it isn't very useful in this form, because deep trees still exhibit linear growth of the condition-set, meaning cubic growth in running time. In practice, we can replace \(y_1\) to the data markov-blanket, \(y_{1,\mathcal{MB}}\). The data markov-blanket is naturally larger than the prior m.b., which is a single point, but if the noise is low relative to the point-spacing, the data m.b. should still be relatively small. Thus, we can approximate the ML with a decomposed form that avoids cubic growth.
The alternative is to use the clique tree from step 9., but the former is simpler to implement, because we don't have to use the crazy linear form we developed above, and we don't have to do any message-passing. We just need \(\Sigma_b\) and \(\mu_b\).
Computing max posterior with attachments
Since this operation won't be run during production, we can just implement it the naive way.
But if we wanted a fast version, we could to a forward-pass approximation, i.e. find the max for the root curve, and then pass that as data to the child curves.
A full forward-backward algorithm probably wouldn't be too hard, but probably not worth the trouble at the moment.
Build Tasks
apply attacment to trackset
guess branch spacing
construct independent cliques, given branch spacing.
Guess branch point
construct markov-blanket, \(\mathcal{MB}\).
construct \(sigma_b\) and \(\mu_b\) from parent \(\mathcal{MB}\).