# NOT RUN {
# }
# NOT RUN {
# These are long-running examples that use parallel computing.
# It takes approximately 30 seconds to run all the below examples.
data(eurusd, package="gmvarkit")
data <- cbind(10*eurusd[,1], 100*eurusd[,2])
colnames(data) <- colnames(eurusd)
# Structural GMVAR(2, 2), d=2 model identified with sign-constraints:
params22s <- c(1.386, -0.766, 1.005, 5.928, 1.314, 0.145, 0.094, 1.292,
-0.389, -0.07, -0.109, -0.281, 1.248, 0.077, -0.04, 1.266, -0.272, -0.074,
0.034, -0.313, 0.903, 0.718, -0.324, 2.079, 7.001, 1.44, 0.741)
W_22 <- matrix(c(1, 1, -1, 1), nrow=2, byrow=FALSE)
mod22s <- GMVAR(data, p=2, M=2, params=params22s,
structural_pars=list(W=W_22))
mod22s
## 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