-
Notifications
You must be signed in to change notification settings - Fork 0
/
mainScriptMerton.m
56 lines (42 loc) · 1.2 KB
/
mainScriptMerton.m
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
clc
clear
close all
includeFolders = genpath('include');
addpath( includeFolders );
filePaths = ["data/merton/merton1.mat",...
"data/merton/merton2.mat",...
"data/merton/merton3.mat"];
nFiles = length( filePaths );
for ii = 1:nFiles
filePath_ii = filePaths(ii)
data = load( filePath_ii );
nData = length( data.y );
settings.dt = 0.01;
settings.nParticles = 15000;
dataMerton = struct();
dataMerton.y = data.y;
ssFun = @(theta, data) -2 * mertonParticleLikelihood( data, theta, settings);
model = struct();
model.ssfun = ssFun;
model.sigma2 = 1.0;
model.N = nData;
nIterations = 50000;
optionsDRAM.nsimu = nIterations;
optionsDRAM.updatesigma = 0;
optionsDRAM.waitbar = 0;
optionsDRAM.verbosity = 2;
optionsDRAM.method = 'dram';
optionsDRAM.burnintime = 100;
optionsDRAM.adaptint = 100;
optionsDRAM.drscale = 5;
parameters = {
{'k', 10}
{'sigma', 0.08, 0}
{'jumpMu', 0.01}
{'jumpDelta', 0.1, 0}
};
tic
[~, chainAM] = mcmcrun( model, dataMerton, parameters, optionsDRAM);
toc
saveResults( "merton", chainAM, data.y);
end