# NOT RUN {
# Load the data
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:
W_222 <- matrix(c(1, NA, -1, 1), nrow=2, byrow=FALSE)
fit222s <- fitGMVAR(data, p=2, M=2, structural_pars=list(W=W_222),
ncalls=1, seeds=1)
# The same model but the AR coefficients restricted to be the same
# in both regimes:
C_mat <- rbind(diag(2*2^2), diag(2*2^2))
fit222sc <- fitGMVAR(data, p=2, M=2, constraints=C_mat,
structural_pars=list(W=W_222),
ncalls=1, seeds=1)
# Test whether the constraints are supported by the data:
LR_test(fit222s, fit222sc)
# }
Run the code above in your browser using DataLab