Debian Codegraph @

texmf-dist/doc/latex/tikz-bayesnet/model_pca2.tex

raw
1 % model_pca2.tex
2 %
3 % Copyright (C) 2010,2011 Laura Dietz
4 % Copyright (C) 2012 Jaakko Luttinen
5 %
6 % This file may be distributed and/or modified
7 %
8 % 1. under the LaTeX Project Public License and/or
9 % 2. under the GNU General Public License.
10 %
11 % See the files LICENSE_LPPL and LICENSE_GPL for more details.
12
13 % PCA model
14
15 %\beginpgfgraphicnamed{model-pca}
16 \begin{tikzpicture}
17
18 % Define nodes
19
20 % Y
21 \node[obs] (y) {$y$}; %
22 \factor[above=of y] {y-f} {left:$\mathcal{N}$} {} {} ; %
23
24 % W and X
25 \node[det, above=of y] (dot) {dot} ; %
26 \node[latent, above left=1.2 of dot] (w) {$\mathbf{w}$}; %
27 \node[latent, above right=1.2 of dot] (x) {$\mathbf{x}$}; %
28
29 % W hyperparameters
30 \node[const, above=1.2 of w, xshift=-0.5cm] (mw) {$\mu_w$} ; %
31 \node[const, above=1.2 of w, xshift=0.5cm] (aw) {$\alpha_w$} ; %
32
33 % X hyperparameters
34 \node[const, above=1.2 of x, xshift=-0.5cm] (mx) {$\mu_x$} ; %
35 \node[const, above=1.2 of x, xshift=0.5cm] (ax) {$\alpha_x$} ; %
36
37 % noise
38 \node[latent, right=2.5cm of y-f] (t) {$\tau$}; %
39 \node[const, above=of t, xshift=-0.5cm] (at) {$\alpha_\tau$} ; %
40 \node[const, above=of t, xshift=0.5cm] (bt) {$\beta_\tau$} ; %
41
42 % Factors
43 \factor[above=of w] {w-f} {left:$\mathcal{N}$} {mw,aw} {w} ; %
44 \factor[above=of x] {x-f} {left:$\mathcal{N}$} {mx,ax} {x} ; %
45 \factor[above=of t] {t-f} {left:$\mathcal{G}$} {at,bt} {t} ; %
46 \factoredge {dot,t} {y-f} {y} ; %
47
48 % Connect w and x to the dot node
49 \edge[-] {w,x} {dot} ;
50
51 % Plates
52 \plate {yx} { %
53 (y)(y-f)(y-f-caption) %
54 (x)(x-f)(x-f-caption) %
55 (dot) %
56 } {$N$} ;
57 \plate {} {%
58 (y)(y-f)(y-f-caption) %
59 (w)(w-f)(w-f-caption) %
60 (dot) %
61 (yx.north west)(yx.south west) %
62 } {$M$} ;
63
64 \end{tikzpicture}
65 %\endpgfgraphicnamed
66
67 %%% Local Variables:
68 %%% mode: tex-pdf
69 %%% TeX-master: "example"
70 %%% End:
71