-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.R
84 lines (62 loc) · 1.43 KB
/
config.R
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
# Configuration file
# clear all
rm(list=ls())
graphics.off()
# set path
path <- list(
input = "~/ForecastReturnDistribution",
func = "~/ForecastReturnDistribution/functions",
coding = "~/ForecastReturnDistribution",
latexPic = "~/",
latexTab = "~/"
)
# set working directory
setwd(path$input)
# packages that are always required
library(dplyr, quietly = TRUE)
library(stringr)
# set suffix for the data that is generated
if(any(list.files()=="creationDataDate")){
load("creationDataDate")
}else{
creationDataDate <- "2022_04_01_"
}
# set temporary variables
n_fc <- sum(timeDate::isBizday(
timeDate::timeDate(seq.Date(from = as.Date("2022-04-01"),
to = as.Date(str_replace_all(creationDataDate,"\\_","-")),
by=1))))
q <- c(.05,.95)
# permit smaller window sizes?
permitSmallerW <- TRUE
##### Historic Simulation #####
HS <- list(
window.size = 250,
q = q,
h = 1
)
##### GARCH Models #####
sGarch <- list(
armaOrder = c(0,0),
model = "sGARCH",
garchOrder = c(1,1),
shape = 8,
window.size = 1e3,
n_fc = n_fc,
refit.every = 1,
refit.window = "moving",
q = q
)
##### DRF Model #####
DRF <- list(
splitting.rule = "CART",
window.size = 1e3,
n_fc = n_fc,
refit.every = 1,
n_lags = 3, # note that n_lags=1 if corsi.freq!="" automatically
absolute.inputs = TRUE,
corsi.freq = "m",
q = q
)
# delete some temporary variables
rm(n_fc)