-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMCMC.tex
144 lines (132 loc) · 6.32 KB
/
MCMC.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
\section{$B%Y%$%:E}7W$H%^%k%3%UO":?%b%s%F%+%k%mK!(B}
\label{sec_MCMC}
$B$3$N@a$r=q$/$?$a$KJ88%(B\cite{MCMC_2005},\cite{finance_MCMC_2003}$B$r;29M$K$7$?!#(B
\subsection{$B%Y%$%:E}7W$H%Y%$%:$NDjM}(B}
\label{sec:Bayes_Stat}
$B%Y%$%:E}7W$G$O!"IT3N<B$J8=>]$NGX8e$K$"$k%Q%i%a!<%?(B$\mathbf{\theta}$$B$N3NN(J,I[$G$"$k;vA0J,I[$r2>Dj$7$?>e$G!"3NN(J,I[$N@-<A$r7hDj$9$k%Q%i%a!<%?$NCM$r4QB,$5$l$?(B
$B%G!<%?$K4p$E$$$F;v8eJ,I[$r?dB,$9$k!#(B
$B;v8eJ,I[$O!"%Y%$%:$NDjM}$K$h$j;vA0J,I[$HL`EY4X?t$+$i7W;;$9$k;v$,$G$-$k!#(B
$\mathbf{x}$$B$,%Q%i%a!<%?(B$\mathbf{\theta}$$B$b$D!"$"$k3NN(J,I[(B
$X(\mathbf{\theta})$$B$+$i@8@.$5$l$?4QB,%G!<%?$G$"$k$H$9$k!#(B
$\mathbf{x} \sim X(\mathbf{\theta})$
$B$H$J$k4QB,CM(B$\mathbf{x}$$B!!(B
$BL$CN$N%Q%i%a!<%?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O":?$r<!$N%a%H%m%]%j%9(B-$B%X%$%9%F%#%s%0%"%k%4%j%:%`$G9=(B
$B@.$9$k$3$H$,$G$-$k!#(B
%$B>\:YD`$j9g$$>r7o(B
%\begin{equation}
%P(\mathbf{x}) \pi(\mathbf{x} \to \mathbf{x}')
%\end{equation}
\subsection{$B%a%H%m%]%j%9(B-$B%X%$%9%F%#%s%0%"%k%4%j%:%`(B}
\label{sec:Metropolis}
$B%a%H%m%]%j%9(B-$B%X%$%9%F%#%s%0%"%k%4%j%:%`$r;H$&$H!"(B
$B7W;;5!$+$iMF0W$K@8@.$9$k;v$,$G$-$J$$;v8eJ,I[(B$\pi*$$B$+$i$NMp?t$r!"(B
$B;v8eJ,I[$r6a;w$9$kDs0FJ,I[(Bq*$B$r;H$&;v$G(B
$B@8@.$9$k$3$H$,$G$-$k!#(B
$BDs0FJ,I[$O7W;;5!$+$i$NMp?t$N@8@.$,4JC1$J$b$N$rA*$V!#(B
$B;v8eJ,I[$N3NN(L)EY4X?t$r(B$\pi(\mathbf{\theta}|\mathbf{x})$
,$BDs0FJ,I[$N3NN(L)EY4X?t$r(B$q(\mathbf{\theta}|\mathbf{x})$$B$H$9$k!#(B
$B%Q%i%a!<%?(B$\mathbf{\theta}=(\theta_{1},\theta_{2},\dots,\theta_{p})$$B$H$7!"(B
t$B%9%F%C%WL\$N%Q%i%a!<%?$r(B$\mathbf{\theta}^{(t)}$$B$GI=$9!#(B
\begin{quote}
%\begin{verbatim}
\begin{enumerate}
\item $B=i4|CM(B$\mathbf{\theta^{(0)}}$$B$r7h$a$k!#(B
\item $i=1,2,\dots,p$$B$K$D$$$F!"0J2<$r7+$jJV$9!#(B
$B!!8=:_(B$\mathbf{\theta}_{i}^{t-1}$$B$G$"$k$H$-!"<!$N>uBV(B$\mathbf{\theta}_{i}^{t}$$B$N8uJd(B
$\mathbf{\theta '}_{i}$$B$rDs0FJ,I[(B
$q_{i}(\mathbf{\theta}_{i}^{(t-1)},\mathbf{\theta}_{i}|\mathbf{x})$$B$+$iH/@8$5$;$k!#(B
\begin{eqnarray}
\alpha_{i} (\mathbf{\theta}_{i}^{(t-1)},\mathbf{\theta '}|\mathbf{\theta}_{-i}^{(t)},\mathbf{x}) =
\left\{
\begin{array}{l}
min \{ \frac{ \pi(\mathbf{\theta}_{i}
|\mathbf{\theta}_{-i}^{i},\mathbf{x}) q(\mathbf{\theta}_{i}
, \mathbf{\theta}^{(t-1)})}
{ \pi(\mathbf{\theta}_{i}
|\mathbf{\theta}_{-i}^{i},\mathbf{x})
q(\mathbf{\theta}_{i} , \mathbf{\theta}^{(t-1)})}
,1 \}, \
(\pi(\mathbf{\theta}_{i}^{(t-1)}|\mathbf{\theta}_{-i}^{(t)},\mathbf{x})
q_{i}(\mathbf{\theta}_{i}^{t-1}
\mathbf{\theta '}_{i}|\mathbf{\theta}_{-i}^{(t)},\mathbf{x}) \ge 0)
\\ 1, \
(\pi(\mathbf{\theta}_{i}^{(t-1)}|\mathbf{\theta}_{-i}^{(t)},\mathbf{x})
q_{i}(\mathbf{\theta}_{i}^{t-1}
\mathbf{\theta '}_{i}|\mathbf{\theta}_{-i}^{(t)},\mathbf{x}) = 0)
\end{array}
\right.
\end{eqnarray}
$B$3$3$G!"(B
$\mathbf{\theta}_{-i}^{t}=(\mathbf{\theta}_{1}^{t},\dots,\mathbf{\theta}_{i}^{t},
\mathbf{\theta}_{i+1}^{(t-1)},\dots,\mathbf{\theta}_{p}^{(t)})$$B$G$"$k!#(B
\item (0,1)$B>e$N0lMMMp?t(Bu$B$rH/@8$5$;$F!"(B
\begin{eqnarray}
\mathbf{\theta}_{i}^{(t)} =
\left\{
\begin{array}{l}
\mathbf{ \theta '}_{i} ,
\ u \leq \alpha_{i}
(\mathbf{\theta}_{i}^{(t-1)},\mathbf{\theta '}
|\mathbf{\theta}_{-i}^{(t)},\mathbf{x})$B$N$H$-(B \\
\mathbf{\theta}_{i}^{(t-1)},
\ u \ge \alpha_{i}
(\mathbf{\theta}_{i}^{(t-1)},\mathbf{\theta '}
|\mathbf{\theta}_{-i}^{(t)},\mathbf{x})$B$N$H$-(B \\
\end{array}
\right.
\label{eq_MCMC_u}
\end{eqnarray}
$B$H$9$k!#(B
\item t $B$r!!(Bt+1$B!!$H$7$F(B(2)$B$K$b$I$k!#(B
\end{enumerate}
% \end{verbatim}
\end{quote}
$B!!(B
\subsubsection{$B?lJb2aDx(B}
\label{sec:randomwalk}
$B;v8eJ,I[$r6a;w$9$k$h$&$JDs0FJ,I[$rC5$9;v$OFq$7$$!#(B
$B$=$3$G!"%Q%i%a!<%?(B$\mu$$B$N?7$7$$8uJd$K!"<!$N?lJb2aDx$rDs0FJ,I[$H$7$FMQ$$$k;v$,$G(B
$B$-$k!#(B
\begin{eqnarray}
\mu ' &=& \mu^{t-1} + \epsilon \\
\epsilon &\sim& N(0,\tau^{2})
\label{eq:randomwalk}
\end{eqnarray}
%$BI8=`JP:9(B$\tau^{2}$%\\\\