forked from mpfarrho/mf-bavart
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
53 lines (47 loc) · 3.24 KB
/
README
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
"Nowcasting in a Pandemic using Non-Parametric Mixed Frequency VARs"
by Huber, F., Koop, G., Onorante, L., Pfarrhofer, M., and J. Schreiner,
Journal of Econometrics (forthcoming)
- Published at https://www.sciencedirect.com/science/article/pii/S0304407620303936
- Working paper at https://arxiv.org/abs/2008.12706
These files create a function mfbavart(...) to estimate the MF-BAVART model.
- mfbavart_func.R contains the main function
- aux_func.R collects several auxiliary functions
- example.R contains an example code for using the function.
In addition to the baseline model in the paper, the code also includes an option
to introduce stochastic volatility (SV) in the error terms. Several parts of the original code
used for the paper in directory "replication" have been replaced to improve
computational efficiency. For replication files only, see "replication."
This code comes without technical support of any kind. Please report any typos
or errors to: [email protected]. The code is free to use for academic
purposes only, provided that the paper is cited properly.
Some codes and helper functions are taken or adapted from the "mfbvar" package.
Thanks to Vincent Dorie (mtn. of "dbarts") and Sebastian Ankargren (mtn. of "mfbvar")
for technical support regarding their excellent packages.
Inputs for mfbavart(...):
- data a list that contains ts-objects of different frequencies in its
M (number of endogenous variables) slots, such that high-frequency (monthly)
series are ordered first and followed by low-frequency series (quarterly)
- itr intertermporal restriction ("lvl" or "grw") of length
corresponding to number of low frequency series
- p numeric, lag-length of the VAR (minimum of 5 if itr=="grw", and 3 if itr=="lvl")
- fhorz numeric, forecast horizon in months (3 per quarter)
- cons TRUE/FALSE, whether a constant should be included
- exact TRUE/FALSE, whether BART fit is stored in output values or
filtered data based on approximation
- sv TRUE/FALSE, whether structural errors feature stochastic volatility
- var.thrsh numeric, threshold for resampling coefficients by draw (for sampler stability)
- max.count.var numeric, maximum number of resampling steps
- cgm.level numeric \in (0,1), \alpha in the paper (probability of terminal node)
- cgm.exp numeric > 0, \beta in the paper (probability of terminal node)
- sd.mu numeric, \gamma in the paper
- num.trees numeric, number of trees for BART, S in the paper
- prior.sig numeric of length 2, [1] nu_j, [2] v in the paper,
if VAR.mean=="linear" shape/rate of iG prior
- nburn numeric, number of burnins
- nsave numeric, number of draws for posterior/predictive inference
- thinfac numeric, thinning factor
- quiet TRUE/FALSE, whether progress bar is indicated during sampling
Function returns:
- Y [nsave,T,M] array that contains the latent states (see also option "exact")
- fcst [nsave,fhorz,M] array that contains forecasts
- Yq [nsave,T+fhorz,M] array that contains aggregated filtered and forecasted series