if (FALSE) {
data(stocks)
# Fit at least two models on a subset of the stocks data
# to compute model weights
fit <- bmgarch(data = stocks[1:100, c("toyota", "nissan" )],
parameterization = "DCC", standardize_data = TRUE,
iterations = 500)
fit2 <- bmgarch(data = stocks[1:100, c("toyota", "nissan" )],
P = 2, Q = 2,
parameterization = "DCC", standardize_data = TRUE,
iterations = 500)
# create a bmgarch_list object
blist <- bmgarch_list(fit, fit2 )
# Compute model weights with the default stacking metod
# L is the upper boundary of the time-series before we engage in LFO-CV
mw <- model_weights( blist, L = 50, method = 'stacking', order = 'backwards' )
# Print model weights in the ordert of the bmgarch_list()
print(mw)
}
Run the code above in your browser using DataLab