-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.m
More file actions
63 lines (49 loc) · 1.58 KB
/
Copy pathsetup.m
File metadata and controls
63 lines (49 loc) · 1.58 KB
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
clear
close all
rehash path
addpath ../sandbox
addpath ../bear
estimStart = datex.q(1972,1);
estimEnd = datex.q(2020,1);
estimSpan = datex.span(estimStart, estimEnd);
turningPoint1 = datex.q(2008,1);
turningPoint2 = datex.q(2014,4);
inputTbx = tablex.fromCsv("SV.csv");
meta = meanAdjusted.Meta( ...
endogenous=["YER", "HICSA", "STN"], ...
units="", ...
exogenous=[], ...
order=4, ...
intercept=false, ...
estimationSpan=estimSpan, ...
trendType = ["time", "constant", "constant"],...
numRegimes = [2, 2, 1],...
regimeSpans = { ...
{[datex.span(estimStart, turningPoint1), ...
datex.span(datex.shift(turningPoint2, 1), estimEnd)]}, ...
{datex.span(datex.shift(turningPoint1, 1), turningPoint2)} ...
}, ...
bounds = {{[]}, {[1 4], [0 2]}, {[2 5]}}, ...
identificationHorizon=20 ...
...
);
dataH = meanAdjusted.DataHolder(meta, inputTbx);
estimatorR = estimator.MeanAdjusted(meta,...
ScaleUp = 100);
modelR = meanAdjusted.ReducedForm( ...
meta=meta ...
, dataHolder=dataH ...
, estimator=estimatorR ...
, stabilityThreshold=Inf ...
);
modelR.Estimator.Settings
modelR.initialize();
info = modelR.presample(1000);
fcastStart = datex.shift(modelR.Meta.EstimationEnd, -10);
fcastEnd = datex.shift(modelR.Meta.EstimationEnd, 0);
fcastSpan = datex.span(fcastStart, fcastEnd);
fcastTbx = modelR.forecast(fcastSpan);
fcastPrctileTbx = tablex.apply(fcastTbx, prctileFunc);
fcastPrctileTbx = tablex.flatten(fcastPrctileTbx);
fcastTbx
fcastPrctileTbx