Download SMCTC: Sequential Monte Carlo in C++

Transcript
30
SMCTC: Sequential Monte Carlo in C++
Threshold, V̂
5
10
15
20
25
30
√
9 √15
10 15
True log probability
-2.32
-5.32
-9.83
-15.93
-23.64
-33.00
-43.63
-53.23
SMC mean
-2.30
-5.30
-9.81
-15.94
-23.83
-33.08
-43.61
-53.20
SMC variance
0.016
0.028
0.026
0.113
0.059
0.106
0.133
0.142
k
2
4
6
10
12.5
14
12
11.5
T
333
667
1000
2000
2500
3500
3600
4000
Table 4: Means and variances of the estimates produced by 10 runs of the proposed algorithm
using 100 particles at each threshold value for the Gaussian random walk example.
it will generally be necessary to make use of accompanying MCMC moves to maintain sample
diversity. More seriously, these grid-type proposals are typically extremely expensive to use
as they require numerous evaluations of the target distribution for each proposal. Although
it provides a more-or-less automatic mechanism for constructing a proposal and using its
optimal auxiliary kernel, the cost of each sample obtained in this way can be sufficiently high
that using a simpler proposal kernel with an approximation to its optimal auxiliary kernel
could yield rather better performance at a given computational cost.
Implementation
The simfunctions.hh file in this case contains the usual overhead of function prototypes and
global variable definitions. It also includes a file markovchain.h which provides a template
class for objects corresponding to evolutions of a Markov chain. This is a container class
which operates as a doubly-linked list. The use of this class is intended to illustrate the ease
with which complex classes can be used to represent the state space. The details of this class
are not documented here, as it is somewhat outside the scope of this article; it should be
sufficiently straightforward to understand the features used here.
The file main.cc contains the main function:
int main(int argc, char** argv)
{
cout << "Number of Particles: ";
long lNumber;
cin >> lNumber;
cout << "Number of Iterations: ";
cin >> lIterates;
cout << "Threshold: ";
cin >> dThreshold;
cout << "Schedule Constant: ";
cin >> dSchedule;
try{