# NOT RUN {
# }
# NOT RUN {
# These are long-running examples that use parallel computing.
# It takes approximately 30 seconds to run all the below examples.
# Structural GMVAR(2, 2), d=2 model identified with sign-constraints:
params22s <- c(0.36, 0.121, 0.484, 0.072, 0.223, 0.059, -0.151, 0.395,
0.406, -0.005, 0.083, 0.299, 0.218, 0.02, -0.119, 0.722, 0.093, 0.032,
0.044, 0.191, 0.057, 0.172, -0.46, 0.016, 3.518, 5.154, 0.58)
W_22 <- matrix(c(1, 1, -1, 1), nrow=2, byrow=FALSE)
mod22s <- GMVAR(gdpdef, p=2, M=2, params=params22s,
structural_pars=list(W=W_22))
mod22s
# Alternatively, use:
#fit22s <- fitGMVAR(gdpdef, p=2, M=2, structural_pars=list(W=W_22),
# ncalls=20, seeds=1:20)
# To obtain an estimated version of the same model.
## NOTE: Use larger R1 is empirical applications! Small R1 is used
## Below only to fasten the execution time of the examples.
# Estimating the GFEVD using all possible histories in the data as the
# initial values:
gfevd1 <- GFEVD(mod22s, N=24, R1=20, initval_type="data")
gfevd1
plot(gfevd1)
# Estimate GFEVD with the initial values generated from the stationary
# distribution of the process:
gfevd2 <- GFEVD(mod22s, N=24, R1=20, R2=100, initval_type="random")
gfevd2
plot(gfevd2)
# Estimate GFEVD with fixed hand specified initial values. We use the
# unconditional mean of the process:
myvals <- rbind(mod22s$uncond_moments$uncond_mean,
mod22s$uncond_moments$uncond_mean)
gfevd3 <- GFEVD(mod22s, N=36, R1=50, initval_type="fixed",
init_values=myvals, include_mixweights=TRUE)
gfevd3
plot(gfevd3)
# }
Run the code above in your browser using DataLab