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