Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- library("copula")
- library("VineCopula")
- library("lubridate")
- library("xts")
- library("stringr")
- library("dplyr")
- library("zoo")
- library("lmtest")
- library("vars")
- library("car")
- library("ggpubr")
- library("tseries")
- library("fitdistrplus")
- library("distr")
- library("MonteCarlo")
- library("car")
- library("MASS")
- library("caret")
- source("Copula_Class.R")
- #install.packages("caret")
- #Initializing Copula classes:
- Gaussian_Copula <- Copula_Class$new(Copula_Family = 1)
- t_Copula <- Copula_Class$new(Copula_Family = 2)
- Frank_Copula <- Copula_Class$new(Copula_Family = 5)
- # Setting:
- setwd("C:/Users/Nam_Hoang/Desktop/Copula Forecasting/")
- options(scipen = 30)
- # Function that editing input data:
- data_edit <- function(index_input, headers_input, headers_kept){
- colnames(index_input) <- headers_input
- index_input$Date <- as.Date(index_input$Date, "%b %d, %Y")
- index_input$Change <- str_replace(index_input$Change , '\\%', '')
- index_input$Change <- as.numeric(index_input$Change)
- index_input$Price <- str_replace(index_input$Price , '\\,', '')
- index_input$Price <- as.numeric(index_input$Price)
- index_input$Change <- index_input$Change/100
- index_input <- subset(index_input, select = headers_kept)
- return (index_input)
- }
- # Function that generates random values from selected Parametric Bivariate Copula:
- BiCop_Simulation <- function(n, family, par, par2){
- result = BiCopSim(n, family, par, par2)
- return(list('result1' = result[1], 'result2' = result[2]))
- }
- # Monte Carlos Simulation:
- Monte_Carlo_Simulation <- function(cop_family, nreps, forecast_intervals, series){
- if (cop_family == 1){
- Copula_Calibration = Gaussian_Copula$Copula_Calibration(series,1,2)
- } else if (cop_family == 2){
- Copula_Calibration = t_Copula$Copula_Calibration(series,1,2)
- } else {
- Copula_Calibration = Frank_Copula$Copula_Calibration(series,1,2)
- }
- Copula_Object = BiCop(Copula_Calibration$family, Copula_Calibration$par, Copula_Calibration$par2,
- Copula_Calibration$tau)
- parameters_list = list('n' = forecast_intervals, 'family' = Copula_Object$family, 'par' = Copula_Object$par,
- 'par2' = Copula_Object$par2)
- Copula_Generator = MonteCarlo(func = BiCop_Simulation, nrep = nreps,
- param_list = parameters_list, ncpus = 4, raw = TRUE)
- Marginal_Dist_Calibration_1 = fitdist(unclass(series)[,1], distr = "logis")
- Marginal_Dist_Calibration_2 = fitdist(unclass(series)[,2], distr = "logis")
- Simulated_Values_1 = qlogis(Copula_Generator$result$result1[1:forecast_intervals], location = Marginal_Dist_Calibration_1$estimate['location'],
- scale = Marginal_Dist_Calibration_1$estimate['scale'])
- Simulated_Values_2 = qlogis(Copula_Generator$result$result2[1:forecast_intervals], location = Marginal_Dist_Calibration_2$estimate['location'],
- scale = Marginal_Dist_Calibration_2$estimate['scale'])
- return (list('Simulated_Value_1' = Simulated_Values_1, 'Simulated_Value_2' = Simulated_Values_2))
- }
- # Load indexes' historical data
- SP500 <- read.csv(file = 'SP500.csv')
- VIX <- read.csv(file = 'VIX.csv')
- STOXX <- read.csv(file = 'STOXX50.csv')
- VSTOXX <- read.csv(file = 'VSTOXX50.csv')
- HSI <- read.csv(file = 'HSI.csv')
- VHSI <- read.csv(file = 'VHSI.csv')
- #Setting headers' names
- index <- list(
- "SP500" = SP500,
- "VIX" = VIX,
- "STOXX" = STOXX,
- "VSTOXX" = VSTOXX,
- "HSI" = HSI,
- "VHSI" = VHSI)
- headers <- c("Date", "Price", "Open", "High", "Low", "Vol", "Change")
- headers_select <- c("Date", "Price", "Change")
- SP500 <- data_edit(SP500,headers,headers_select)
- VIX <- data_edit(VIX,headers,headers_select)
- STOXX <- data_edit(STOXX,headers,headers_select)
- VSTOXX <- data_edit(VSTOXX,headers,headers_select)
- HSI <- data_edit(HSI,headers,headers_select)
- VHSI <- data_edit(VHSI,headers,headers_select)
- SP500_VIX <- merge(SP500,VIX,by="Date",all=T)
- STOXX_VSTOXX <- merge(STOXX,VSTOXX,by="Date",all=T)
- HSI_VHSI <- merge(HSI,VHSI,by="Date",all=T)
- SP_VIX_headers <- c("Date", "Price_SP500", "Change_SP500", "Price_VIX", "Change_VIX")
- STOXX_VSTOXX_headers <- c("Date", "Price_STOXX", "Change_STOXX", "Price_VSTOXX", "Change_VSTOXX")
- HSI_VHSI_headers <- c("Date", "Price_HSI", "Change_HSI", "Price_VHSI", "Change_VHSI")
- colnames(SP500_VIX) <- SP_VIX_headers
- colnames(STOXX_VSTOXX) <- STOXX_VSTOXX_headers
- colnames(HSI_VHSI) <- HSI_VHSI_headers
- # training/testing periods - SP500_VIX
- SP500_VIX_training <- SP500_VIX[1775:3556,]
- SP500_VIX_testing <- SP500_VIX[3557:3856,]
- # max 2396
- # training period - STOXX_VSTOXX
- STOXX_VSTOXX_training <- STOXX_VSTOXX[357:2096,]
- STOXX_VSTOXX_testing <- STOXX_VSTOXX[2097:2396,]
- # max 4964
- # training period - HSI_VHSI
- HSI_VHSI_training <- HSI_VHSI[3006:4664,]
- HSI_VHSI_testing <- HSI_VHSI[4665:4964,]
- SP500_VIX_training$Price_SP500 <- na.locf(SP500_VIX_training$Price_SP500)
- SP500_VIX_training$Change_SP500 <- na.fill(SP500_VIX_training$Change_SP500, fill = 0)
- SP500_VIX_training$Price_VIX <- na.locf(SP500_VIX_training$Price_VIX)
- SP500_VIX_training$Change_VIX <- na.fill(SP500_VIX_training$Change_VIX, fill = 0)
- SP500_VIX_testing$Price_SP500 <- na.locf(SP500_VIX_testing$Price_SP500)
- SP500_VIX_testing$Change_SP500 <- na.fill(SP500_VIX_testing$Change_SP500, fill = 0)
- SP500_VIX_testing$Price_VIX <- na.locf(SP500_VIX_testing$Price_VIX)
- SP500_VIX_testing$Change_VIX <- na.fill(SP500_VIX_testing$Change_VIX, fill = 0)
- STOXX_VSTOXX_training$Price_STOXX <- na.locf(STOXX_VSTOXX_training$Price_STOXX)
- STOXX_VSTOXX_training$Change_STOXX <- na.fill(STOXX_VSTOXX_training$Change_STOXX, fill = 0)
- STOXX_VSTOXX_training$Price_VSTOXX <- na.locf(STOXX_VSTOXX_training$Price_VSTOXX)
- STOXX_VSTOXX_training$Change_VSTOXX <- na.fill(STOXX_VSTOXX_training$Change_VSTOXX, fill = 0)
- STOXX_VSTOXX_testing$Price_STOXX <- na.locf(STOXX_VSTOXX_testing$Price_STOXX)
- STOXX_VSTOXX_testing$Change_STOXX <- na.fill(STOXX_VSTOXX_testing$Change_STOXX, fill = 0)
- STOXX_VSTOXX_testing$Price_VSTOXX <- na.locf(STOXX_VSTOXX_testing$Price_VSTOXX)
- STOXX_VSTOXX_testing$Change_VSTOXX <- na.fill(STOXX_VSTOXX_testing$Change_VSTOXX, fill = 0)
- HSI_VHSI_training$Price_HSI <- na.locf(HSI_VHSI_training$Price_HSI)
- HSI_VHSI_training$Change_HSI <- na.fill(HSI_VHSI_training$Change_HSI, fill = 0)
- HSI_VHSI_training$Price_VHSI <- na.locf(HSI_VHSI_training$Price_VHSI)
- HSI_VHSI_training$Change_VHSI <- na.fill(HSI_VHSI_training$Change_VHSI, fill = 0)
- HSI_VHSI_testing$Price_HSI <- na.locf(HSI_VHSI_testing$Price_HSI)
- HSI_VHSI_testing$Change_HSI <- na.fill(HSI_VHSI_testing$Change_HSI, fill = 0)
- HSI_VHSI_testing$Price_VHSI <- na.locf(HSI_VHSI_testing$Price_VHSI)
- HSI_VHSI_testing$Change_VHSI <- na.fill(HSI_VHSI_testing$Change_VHSI, fill = 0)
- SP500_VIX_Price <- subset(SP500_VIX_training, select = c("Date", "Price_SP500", "Price_VIX"))
- SP500_VIX_Price <- xts(SP500_VIX_Price[,-1], SP500_VIX_Price$Date)
- SP500_VIX_Change <- subset(SP500_VIX_training, select = c("Date", "Change_SP500", "Change_VIX"))
- SP500_VIX_Change <- xts(SP500_VIX_Change[,-1], SP500_VIX_Change$Date)
- STOXX_VSTOXX_Price <- subset(STOXX_VSTOXX_training, select = c("Date", "Price_STOXX", "Price_VSTOXX"))
- STOXX_VSTOXX_Price <- xts(STOXX_VSTOXX_Price[,-1], STOXX_VSTOXX_Price$Date)
- STOXX_VSTOXX_Change <- subset(STOXX_VSTOXX_training, select = c("Date", "Change_STOXX", "Change_VSTOXX"))
- STOXX_VSTOXX_Change <- xts(STOXX_VSTOXX_Change[,-1], STOXX_VSTOXX_Change$Date)
- HSI_VHSI_Price <- subset(HSI_VHSI_training, select = c("Date", "Price_HSI", "Price_VHSI"))
- HSI_VHSI_Price <- xts(HSI_VHSI_Price[,-1], HSI_VHSI_Price$Date)
- HSI_VHSI_Change <- subset(HSI_VHSI_training, select = c("Date", "Change_HSI", "Change_VHSI"))
- HSI_VHSI_Change <- xts(HSI_VHSI_Change[,-1], HSI_VHSI_Change$Date)
- # Pre-scanning for potential marginal distribution:
- descdist(SP500_VIX_training$Change_SP500, discrete = FALSE)
- descdist(SP500_VIX_training$Change_VIX, discrete = FALSE)
- descdist(STOXX_VSTOXX_training$Change_STOXX, discrete = FALSE)
- descdist(STOXX_VSTOXX_training$Change_VSTOXX, discrete = FALSE)
- descdist(HSI_VHSI_training$Change_HSI, discrete = FALSE)
- descdist(HSI_VHSI_training$Change_VHSI, discrete = FALSE)
- # fitting distribution:
- SP500_logistic = fitdist(SP500_VIX_training$Change_SP500, distr = "logis")
- SP500_norm = fitdist(SP500_VIX_training$Change_SP500, distr = "norm")
- VIX_logistic = fitdist(SP500_VIX_training$Change_VIX, distr = "logis")
- VIX_norm = fitdist(SP500_VIX_training$Change_VIX, distr = "norm")
- STOXX_logistic = fitdist(STOXX_VSTOXX_training$Change_STOXX, distr = "logis")
- STOXX_norm = fitdist(STOXX_VSTOXX_training$Change_STOXX, distr = "norm")
- VSTOXX_logistic = fitdist(STOXX_VSTOXX_training$Change_VSTOXX, distr = "logis")
- VSTOXX_norm = fitdist(STOXX_VSTOXX_training$Change_VSTOXX, distr = "norm")
- HSI_logistic = fitdist(HSI_VHSI_training$Change_HSI, distr = "logis")
- HSI_norm = fitdist(HSI_VHSI_training$Change_HSI, distr = "norm")
- VHSI_logistic = fitdist(HSI_VHSI_training$Change_VHSI, distr = "logis")
- VHSI_norm = fitdist(HSI_VHSI_training$Change_VHSI, distr = "norm")
- # checking fitness via parametric CDF vs. empirical CDF:
- cdfcomp(list(STOXX_logistic, STOXX_norm), legendtext = c("logistic", "norm"), main = "STOXX's return fits")
- cdfcomp(list(VSTOXX_logistic, VSTOXX_norm), legendtext = c("logistic", "norm"), main = "VSTOXX's return fits")
- cdfcomp(list(SP500_logistic, SP500_norm), legendtext = c("logistic", "norm"), main = "SP500's return fits")
- cdfcomp(list(VIX_logistic, VIX_norm), legendtext = c("logistic", "norm"), main = "VIX's return fits")
- cdfcomp(list(HSI_logistic, HSI_norm), legendtext = c("logistic", "norm"), main = "HSI's return fits")
- cdfcomp(list(VHSI_logistic, VHSI_norm), legendtext = c("logistic", "norm"), main = "VHSI's return fits")
- # Goodness of fit statistics:
- SP500_GoF = gofstat(list(SP500_logistic, SP500_norm),
- fitnames = c("logistic", "normal"))
- VIX_GoF = gofstat(list(VIX_logistic, VIX_norm),
- fitnames = c("logistic", "normal"))
- VSTOXX_GoF = gofstat(list(VSTOXX_logistic, VSTOXX_norm),
- fitnames = c("logistic", "normal"))
- STOXX_GoF = gofstat(list(STOXX_logistic, STOXX_norm),
- fitnames = c("logistic", "normal"))
- VHSI_GoF = gofstat(list(VHSI_logistic, VHSI_norm),
- fitnames = c("logistic", "normal"))
- HSI_GoF = gofstat(list(HSI_logistic, HSI_norm),
- fitnames = c("logistic", "normal"))
- # Simulating forecast values:
- # Gaussian Copula:
- SP500_VIX_Simulation_Gaussian_50 = Monte_Carlo_Simulation(1,10000,50,SP500_VIX_Change)
- HSI_VHSI_Simulation_Gaussian_50 = Monte_Carlo_Simulation(1,10000,50,HSI_VHSI_Change)
- STOXX_VSTOXX_Simulation_Gaussian_50 = Monte_Carlo_Simulation(1,10000,50,STOXX_VSTOXX_Change)
- SP500_VIX_Simulation_Gaussian_100 = Monte_Carlo_Simulation(1,10000,100,SP500_VIX_Change)
- HSI_VHSI_Simulation_Gaussian_100 = Monte_Carlo_Simulation(1,10000,100,HSI_VHSI_Change)
- STOXX_VSTOXX_Simulation_Gaussian_100 = Monte_Carlo_Simulation(1,10000,100,STOXX_VSTOXX_Change)
- SP500_VIX_Simulation_Gaussian_200 = Monte_Carlo_Simulation(1,10000,200,SP500_VIX_Change)
- HSI_VHSI_Simulation_Gaussian_200 = Monte_Carlo_Simulation(1,10000,200,HSI_VHSI_Change)
- STOXX_VSTOXX_Simulation_Gaussian_200 = Monte_Carlo_Simulation(1,10000,200,STOXX_VSTOXX_Change)
- SP500_VIX_Simulation_Gaussian_300 = Monte_Carlo_Simulation(1,10000,300,SP500_VIX_Change)
- HSI_VHSI_Simulation_Gaussian_300 = Monte_Carlo_Simulation(1,10000,300,HSI_VHSI_Change)
- STOXX_VSTOXX_Simulation_Gaussian_300 = Monte_Carlo_Simulation(1,10000,300,STOXX_VSTOXX_Change)
- # t Copula:
- SP500_VIX_Simulation_t_50 = Monte_Carlo_Simulation(2,10000,50,SP500_VIX_Change)
- HSI_VHSI_Simulation_t_50 = Monte_Carlo_Simulation(2,10000,50,HSI_VHSI_Change)
- STOXX_VSTOXX_Simulation_t_50 = Monte_Carlo_Simulation(2,10000,50,STOXX_VSTOXX_Change)
- SP500_VIX_Simulation_t_100 = Monte_Carlo_Simulation(2,10000,100,SP500_VIX_Change)
- HSI_VHSI_Simulation_t_100 = Monte_Carlo_Simulation(2,10000,100,HSI_VHSI_Change)
- STOXX_VSTOXX_Simulation_t_100 = Monte_Carlo_Simulation(2,10000,100,STOXX_VSTOXX_Change)
- SP500_VIX_Simulation_t_200 = Monte_Carlo_Simulation(2,10000,200,SP500_VIX_Change)
- HSI_VHSI_Simulation_t_200 = Monte_Carlo_Simulation(2,10000,200,HSI_VHSI_Change)
- STOXX_VSTOXX_Simulation_t_200 = Monte_Carlo_Simulation(2,10000,200,STOXX_VSTOXX_Change)
- SP500_VIX_Simulation_t_300 = Monte_Carlo_Simulation(2,10000,300,SP500_VIX_Change)
- HSI_VHSI_Simulation_t_300 = Monte_Carlo_Simulation(2,10000,300,HSI_VHSI_Change)
- STOXX_VSTOXX_Simulation_t_300 = Monte_Carlo_Simulation(2,10000,300,STOXX_VSTOXX_Change)
- # Frank Copula:
- SP500_VIX_Simulation_Frank_50 = Monte_Carlo_Simulation(5,10000,50,SP500_VIX_Change)
- HSI_VHSI_Simulation_Frank_50 = Monte_Carlo_Simulation(5,10000,50,HSI_VHSI_Change)
- STOXX_VSTOXX_Simulation_Frank_50 = Monte_Carlo_Simulation(5,10000,50,STOXX_VSTOXX_Change)
- SP500_VIX_Simulation_Frank_100 = Monte_Carlo_Simulation(5,10000,100,SP500_VIX_Change)
- HSI_VHSI_Simulation_Frank_100 = Monte_Carlo_Simulation(5,10000,100,HSI_VHSI_Change)
- STOXX_VSTOXX_Simulation_Frank_100 = Monte_Carlo_Simulation(5,10000,100,STOXX_VSTOXX_Change)
- SP500_VIX_Simulation_Frank_200 = Monte_Carlo_Simulation(5,10000,200,SP500_VIX_Change)
- HSI_VHSI_Simulation_Frank_200 = Monte_Carlo_Simulation(5,10000,200,HSI_VHSI_Change)
- STOXX_VSTOXX_Simulation_Frank_200 = Monte_Carlo_Simulation(5,10000,200,STOXX_VSTOXX_Change)
- SP500_VIX_Simulation_Frank_300 = Monte_Carlo_Simulation(5,10000,300,SP500_VIX_Change)
- HSI_VHSI_Simulation_Frank_300 = Monte_Carlo_Simulation(5,10000,300,HSI_VHSI_Change)
- STOXX_VSTOXX_Simulation_Frank_300 = Monte_Carlo_Simulation(5,10000,300,STOXX_VSTOXX_Change)
- #Note: 1 = Gaussian Copula, 2 = t Copula, 5 = Frank Copula
- # Testing samples:
- SP500_testing_50 = SP500_VIX_testing$Change_SP500[1:50]
- SP500_testing_100 = SP500_VIX_testing$Change_SP500[1:100]
- SP500_testing_200 = SP500_VIX_testing$Change_SP500[1:200]
- SP500_testing_300 = SP500_VIX_testing$Change_SP500[1:300]
- VIX_testing_50 = SP500_VIX_testing$Change_VIX[1:50]
- VIX_testing_100 = SP500_VIX_testing$Change_VIX[1:100]
- VIX_testing_200 = SP500_VIX_testing$Change_VIX[1:200]
- VIX_testing_300 = SP500_VIX_testing$Change_VIX[1:300]
- STOXX_testing_50 = STOXX_VSTOXX_testing$Change_STOXX[1:50]
- STOXX_testing_100 = STOXX_VSTOXX_testing$Change_STOXX[1:100]
- STOXX_testing_200 = STOXX_VSTOXX_testing$Change_STOXX[1:200]
- STOXX_testing_300 = STOXX_VSTOXX_testing$Change_STOXX[1:300]
- VSTOXX_testing_50 = STOXX_VSTOXX_testing$Change_VSTOXX[1:50]
- VSTOXX_testing_100 = STOXX_VSTOXX_testing$Change_VSTOXX[1:100]
- VSTOXX_testing_200 = STOXX_VSTOXX_testing$Change_VSTOXX[1:200]
- VSTOXX_testing_300 = STOXX_VSTOXX_testing$Change_VSTOXX[1:300]
- HSI_testing_50 = HSI_VHSI_testing$Change_HSI[1:50]
- HSI_testing_100 = HSI_VHSI_testing$Change_HSI[1:100]
- HSI_testing_200 = HSI_VHSI_testing$Change_HSI[1:200]
- HSI_testing_300 = HSI_VHSI_testing$Change_HSI[1:300]
- VHSI_testing_50 = HSI_VHSI_testing$Change_VHSI[1:50]
- VHSI_testing_100 = HSI_VHSI_testing$Change_VHSI[1:100]
- VHSI_testing_200 = HSI_VHSI_testing$Change_VHSI[1:200]
- VHSI_testing_300 = HSI_VHSI_testing$Change_VHSI[1:300]
- # Forecast KPIs:
- # SP500_VIX:
- Gaussian_MAE_SP500_50 = MAE(unlist(SP500_VIX_Simulation_Gaussian_50[1]),SP500_testing_50)
- Gaussian_MAE_SP500_100 = MAE(unlist(SP500_VIX_Simulation_Gaussian_100[1]),SP500_testing_100)
- Gaussian_MAE_SP500_200 = MAE(unlist(SP500_VIX_Simulation_Gaussian_200[1]),SP500_testing_200)
- Gaussian_MAE_SP500_300 = MAE(unlist(SP500_VIX_Simulation_Gaussian_300[1]),SP500_testing_300)
- plot(unlist(SP500_VIX_Simulation_Gaussian_300[1]), type="l", col="green", lwd=2)
- lines(SP500_testing_300, col="red", lwd=2)
- Gaussian_MAE_VIX_50 = MAE(unlist(SP500_VIX_Simulation_Gaussian_50[2]),VIX_testing_50)
- Gaussian_MAE_VIX_100 = MAE(unlist(SP500_VIX_Simulation_Gaussian_100[2]),VIX_testing_100)
- Gaussian_MAE_VIX_200 = MAE(unlist(SP500_VIX_Simulation_Gaussian_200[2]),VIX_testing_200)
- Gaussian_MAE_VIX_300 = MAE(unlist(SP500_VIX_Simulation_Gaussian_300[2]),VIX_testing_300)
- Gaussian_RMSE_SP500_50 = RMSE(unlist(SP500_VIX_Simulation_Gaussian_50[1]),SP500_testing_50)
- Gaussian_RMSE_SP500_100 = RMSE(unlist(SP500_VIX_Simulation_Gaussian_100[1]),SP500_testing_100)
- Gaussian_RMSE_SP500_200 = RMSE(unlist(SP500_VIX_Simulation_Gaussian_200[1]),SP500_testing_200)
- Gaussian_RMSE_SP500_300 = RMSE(unlist(SP500_VIX_Simulation_Gaussian_300[1]),SP500_testing_300)
- Gaussian_RMSE_VIX_50 = RMSE(unlist(SP500_VIX_Simulation_Gaussian_50[2]),VIX_testing_50)
- Gaussian_RMSE_VIX_100 = RMSE(unlist(SP500_VIX_Simulation_Gaussian_100[2]),VIX_testing_100)
- Gaussian_RMSE_VIX_200 = RMSE(unlist(SP500_VIX_Simulation_Gaussian_200[2]),VIX_testing_200)
- Gaussian_RMSE_VIX_300 = RMSE(unlist(SP500_VIX_Simulation_Gaussian_300[2]),VIX_testing_300)
- t_MAE_SP500_50 = MAE(unlist(SP500_VIX_Simulation_t_50[1]),SP500_testing_50)
- t_MAE_SP500_100 = MAE(unlist(SP500_VIX_Simulation_t_100[1]),SP500_testing_100)
- t_MAE_SP500_200 = MAE(unlist(SP500_VIX_Simulation_t_200[1]),SP500_testing_200)
- t_MAE_SP500_300 = MAE(unlist(SP500_VIX_Simulation_t_300[1]),SP500_testing_300)
- t_MAE_VIX_50 = MAE(unlist(SP500_VIX_Simulation_t_50[2]),VIX_testing_50)
- t_MAE_VIX_100 = MAE(unlist(SP500_VIX_Simulation_t_100[2]),VIX_testing_100)
- t_MAE_VIX_200 = MAE(unlist(SP500_VIX_Simulation_t_200[2]),VIX_testing_200)
- t_MAE_VIX_300 = MAE(unlist(SP500_VIX_Simulation_t_300[2]),VIX_testing_300)
- t_RMSE_SP500_50 = RMSE(unlist(SP500_VIX_Simulation_t_50[1]),SP500_testing_50)
- t_RMSE_SP500_100 = RMSE(unlist(SP500_VIX_Simulation_t_100[1]),SP500_testing_100)
- t_RMSE_SP500_200 = RMSE(unlist(SP500_VIX_Simulation_t_200[1]),SP500_testing_200)
- t_RMSE_SP500_300 = RMSE(unlist(SP500_VIX_Simulation_t_300[1]),SP500_testing_300)
- t_RMSE_VIX_50 = RMSE(unlist(SP500_VIX_Simulation_t_50[2]),VIX_testing_50)
- t_RMSE_VIX_100 = RMSE(unlist(SP500_VIX_Simulation_t_100[2]),VIX_testing_100)
- t_RMSE_VIX_200 = RMSE(unlist(SP500_VIX_Simulation_t_200[2]),VIX_testing_200)
- t_RMSE_VIX_300 = RMSE(unlist(SP500_VIX_Simulation_t_300[2]),VIX_testing_300)
- Frank_MAE_SP500_50 = MAE(unlist(SP500_VIX_Simulation_Frank_50[1]),SP500_testing_50)
- Frank_MAE_SP500_100 = MAE(unlist(SP500_VIX_Simulation_Frank_100[1]),SP500_testing_100)
- Frank_MAE_SP500_200 = MAE(unlist(SP500_VIX_Simulation_Frank_200[1]),SP500_testing_200)
- Frank_MAE_SP500_300 = MAE(unlist(SP500_VIX_Simulation_Frank_300[1]),SP500_testing_300)
- Frank_MAE_VIX_50 = MAE(unlist(SP500_VIX_Simulation_Frank_50[2]),VIX_testing_50)
- Frank_MAE_VIX_100 = MAE(unlist(SP500_VIX_Simulation_Frank_100[2]),VIX_testing_100)
- Frank_MAE_VIX_200 = MAE(unlist(SP500_VIX_Simulation_Frank_200[2]),VIX_testing_200)
- Frank_MAE_VIX_300 = MAE(unlist(SP500_VIX_Simulation_Frank_300[2]),VIX_testing_300)
- Frank_RMSE_SP500_50 = RMSE(unlist(SP500_VIX_Simulation_Frank_50[1]),SP500_testing_50)
- Frank_RMSE_SP500_100 = RMSE(unlist(SP500_VIX_Simulation_Frank_100[1]),SP500_testing_100)
- Frank_RMSE_SP500_200 = RMSE(unlist(SP500_VIX_Simulation_Frank_200[1]),SP500_testing_200)
- Frank_RMSE_SP500_300 = RMSE(unlist(SP500_VIX_Simulation_Frank_300[1]),SP500_testing_300)
- Frank_RMSE_VIX_50 = RMSE(unlist(SP500_VIX_Simulation_Frank_50[2]),VIX_testing_50)
- Frank_RMSE_VIX_100 = RMSE(unlist(SP500_VIX_Simulation_Frank_100[2]),VIX_testing_100)
- Frank_RMSE_VIX_200 = RMSE(unlist(SP500_VIX_Simulation_Frank_200[2]),VIX_testing_200)
- Frank_RMSE_VIX_300 = RMSE(unlist(SP500_VIX_Simulation_Frank_300[2]),VIX_testing_300)
- # HSI_VHSI:
- Gaussian_MAE_HSI_50 = MAE(unlist(HSI_VHSI_Simulation_Gaussian_50[1]),HSI_testing_50)
- Gaussian_MAE_HSI_100 = MAE(unlist(HSI_VHSI_Simulation_Gaussian_100[1]),HSI_testing_100)
- Gaussian_MAE_HSI_200 = MAE(unlist(HSI_VHSI_Simulation_Gaussian_200[1]),HSI_testing_200)
- Gaussian_MAE_HSI_300 = MAE(unlist(HSI_VHSI_Simulation_Gaussian_300[1]),HSI_testing_300)
- Gaussian_MAE_VHSI_50 = MAE(unlist(HSI_VHSI_Simulation_Gaussian_50[2]),VHSI_testing_50)
- Gaussian_MAE_VHSI_100 = MAE(unlist(HSI_VHSI_Simulation_Gaussian_100[2]),VHSI_testing_100)
- Gaussian_MAE_VHSI_200 = MAE(unlist(HSI_VHSI_Simulation_Gaussian_200[2]),VHSI_testing_200)
- Gaussian_MAE_VHSI_300 = MAE(unlist(HSI_VHSI_Simulation_Gaussian_300[2]),VHSI_testing_300)
- Gaussian_RMSE_HSI_50 = RMSE(unlist(HSI_VHSI_Simulation_Gaussian_50[1]),HSI_testing_50)
- Gaussian_RMSE_HSI_100 = RMSE(unlist(HSI_VHSI_Simulation_Gaussian_100[1]),HSI_testing_100)
- Gaussian_RMSE_HSI_200 = RMSE(unlist(HSI_VHSI_Simulation_Gaussian_200[1]),HSI_testing_200)
- Gaussian_RMSE_HSI_300 = RMSE(unlist(HSI_VHSI_Simulation_Gaussian_300[1]),HSI_testing_300)
- Gaussian_RMSE_VHSI_50 = RMSE(unlist(HSI_VHSI_Simulation_Gaussian_50[2]),VHSI_testing_50)
- Gaussian_RMSE_VHSI_100 = RMSE(unlist(HSI_VHSI_Simulation_Gaussian_100[2]),VHSI_testing_100)
- Gaussian_RMSE_VHSI_200 = RMSE(unlist(HSI_VHSI_Simulation_Gaussian_200[2]),VHSI_testing_200)
- Gaussian_RMSE_VHSI_300 = RMSE(unlist(HSI_VHSI_Simulation_Gaussian_300[2]),VHSI_testing_300)
- t_MAE_HSI_50 = MAE(unlist(HSI_VHSI_Simulation_t_50[1]),HSI_testing_50)
- t_MAE_HSI_100 = MAE(unlist(HSI_VHSI_Simulation_t_100[1]),HSI_testing_100)
- t_MAE_HSI_200 = MAE(unlist(HSI_VHSI_Simulation_t_200[1]),HSI_testing_200)
- t_MAE_HSI_300 = MAE(unlist(HSI_VHSI_Simulation_t_300[1]),HSI_testing_300)
- t_MAE_VHSI_50 = MAE(unlist(HSI_VHSI_Simulation_t_50[2]),VHSI_testing_50)
- t_MAE_VHSI_100 = MAE(unlist(HSI_VHSI_Simulation_t_100[2]),VHSI_testing_100)
- t_MAE_VHSI_200 = MAE(unlist(HSI_VHSI_Simulation_t_200[2]),VHSI_testing_200)
- t_MAE_VHSI_300 = MAE(unlist(HSI_VHSI_Simulation_t_300[2]),VHSI_testing_300)
- t_RMSE_HSI_50 = RMSE(unlist(HSI_VHSI_Simulation_t_50[1]),HSI_testing_50)
- t_RMSE_HSI_100 = RMSE(unlist(HSI_VHSI_Simulation_t_100[1]),HSI_testing_100)
- t_RMSE_HSI_200 = RMSE(unlist(HSI_VHSI_Simulation_t_200[1]),HSI_testing_200)
- t_RMSE_HSI_300 = RMSE(unlist(HSI_VHSI_Simulation_t_300[1]),HSI_testing_300)
- t_RMSE_VHSI_50 = RMSE(unlist(HSI_VHSI_Simulation_t_50[2]),VHSI_testing_50)
- t_RMSE_VHSI_100 = RMSE(unlist(HSI_VHSI_Simulation_t_100[2]),VHSI_testing_100)
- t_RMSE_VHSI_200 = RMSE(unlist(HSI_VHSI_Simulation_t_200[2]),VHSI_testing_200)
- t_RMSE_VHSI_300 = RMSE(unlist(HSI_VHSI_Simulation_t_300[2]),VHSI_testing_300)
- Frank_MAE_HSI_50 = MAE(unlist(HSI_VHSI_Simulation_Frank_50[1]),HSI_testing_50)
- Frank_MAE_HSI_100 = MAE(unlist(HSI_VHSI_Simulation_Frank_100[1]),HSI_testing_100)
- Frank_MAE_HSI_200 = MAE(unlist(HSI_VHSI_Simulation_Frank_200[1]),HSI_testing_200)
- Frank_MAE_HSI_300 = MAE(unlist(HSI_VHSI_Simulation_Frank_300[1]),HSI_testing_300)
- Frank_MAE_VHSI_50 = MAE(unlist(HSI_VHSI_Simulation_Frank_50[2]),VHSI_testing_50)
- Frank_MAE_VHSI_100 = MAE(unlist(HSI_VHSI_Simulation_Frank_100[2]),VHSI_testing_100)
- Frank_MAE_VHSI_200 = MAE(unlist(HSI_VHSI_Simulation_Frank_200[2]),VHSI_testing_200)
- Frank_MAE_VHSI_300 = MAE(unlist(HSI_VHSI_Simulation_Frank_300[2]),VHSI_testing_300)
- Frank_RMSE_HSI_50 = RMSE(unlist(HSI_VHSI_Simulation_Frank_50[1]),HSI_testing_50)
- Frank_RMSE_HSI_100 = RMSE(unlist(HSI_VHSI_Simulation_Frank_100[1]),HSI_testing_100)
- Frank_RMSE_HSI_200 = RMSE(unlist(HSI_VHSI_Simulation_Frank_200[1]),HSI_testing_200)
- Frank_RMSE_HSI_300 = RMSE(unlist(HSI_VHSI_Simulation_Frank_300[1]),HSI_testing_300)
- Frank_RMSE_VHSI_50 = RMSE(unlist(HSI_VHSI_Simulation_Frank_50[2]),VHSI_testing_50)
- Frank_RMSE_VHSI_100 = RMSE(unlist(HSI_VHSI_Simulation_Frank_100[2]),VHSI_testing_100)
- Frank_RMSE_VHSI_200 = RMSE(unlist(HSI_VHSI_Simulation_Frank_200[2]),VHSI_testing_200)
- Frank_RMSE_VHSI_300 = RMSE(unlist(HSI_VHSI_Simulation_Frank_300[2]),VHSI_testing_300)
- # STOXX_VSTOXX:
- Gaussian_MAE_STOXX_50 = MAE(unlist(STOXX_VSTOXX_Simulation_Gaussian_50[1]),STOXX_testing_50)
- Gaussian_MAE_STOXX_100 = MAE(unlist(STOXX_VSTOXX_Simulation_Gaussian_100[1]),STOXX_testing_100)
- Gaussian_MAE_STOXX_200 = MAE(unlist(STOXX_VSTOXX_Simulation_Gaussian_200[1]),STOXX_testing_200)
- Gaussian_MAE_STOXX_300 = MAE(unlist(STOXX_VSTOXX_Simulation_Gaussian_300[1]),STOXX_testing_300)
- Gaussian_MAE_VSTOXX_50 = MAE(unlist(STOXX_VSTOXX_Simulation_Gaussian_50[2]),VSTOXX_testing_50)
- Gaussian_MAE_VSTOXX_100 = MAE(unlist(STOXX_VSTOXX_Simulation_Gaussian_100[2]),VSTOXX_testing_100)
- Gaussian_MAE_VSTOXX_200 = MAE(unlist(STOXX_VSTOXX_Simulation_Gaussian_200[2]),VSTOXX_testing_200)
- Gaussian_MAE_VSTOXX_300 = MAE(unlist(STOXX_VSTOXX_Simulation_Gaussian_300[2]),VSTOXX_testing_300)
- Gaussian_RMSE_STOXX_50 = RMSE(unlist(STOXX_VSTOXX_Simulation_Gaussian_50[1]),STOXX_testing_50)
- Gaussian_RMSE_STOXX_100 = RMSE(unlist(STOXX_VSTOXX_Simulation_Gaussian_100[1]),STOXX_testing_100)
- Gaussian_RMSE_STOXX_200 = RMSE(unlist(STOXX_VSTOXX_Simulation_Gaussian_200[1]),STOXX_testing_200)
- Gaussian_RMSE_STOXX_300 = RMSE(unlist(STOXX_VSTOXX_Simulation_Gaussian_300[1]),STOXX_testing_300)
- Gaussian_RMSE_VSTOXX_50 = RMSE(unlist(STOXX_VSTOXX_Simulation_Gaussian_50[2]),VSTOXX_testing_50)
- Gaussian_RMSE_VSTOXX_100 = RMSE(unlist(STOXX_VSTOXX_Simulation_Gaussian_100[2]),VSTOXX_testing_100)
- Gaussian_RMSE_VSTOXX_200 = RMSE(unlist(STOXX_VSTOXX_Simulation_Gaussian_200[2]),VSTOXX_testing_200)
- Gaussian_RMSE_VSTOXX_300 = RMSE(unlist(STOXX_VSTOXX_Simulation_Gaussian_300[2]),VSTOXX_testing_300)
- t_MAE_STOXX_50 = MAE(unlist(STOXX_VSTOXX_Simulation_t_50[1]),STOXX_testing_50)
- t_MAE_STOXX_100 = MAE(unlist(STOXX_VSTOXX_Simulation_t_100[1]),STOXX_testing_100)
- t_MAE_STOXX_200 = MAE(unlist(STOXX_VSTOXX_Simulation_t_200[1]),STOXX_testing_200)
- t_MAE_STOXX_300 = MAE(unlist(STOXX_VSTOXX_Simulation_t_300[1]),STOXX_testing_300)
- t_MAE_VSTOXX_50 = MAE(unlist(STOXX_VSTOXX_Simulation_t_50[2]),VSTOXX_testing_50)
- t_MAE_VSTOXX_100 = MAE(unlist(STOXX_VSTOXX_Simulation_t_100[2]),VSTOXX_testing_100)
- t_MAE_VSTOXX_200 = MAE(unlist(STOXX_VSTOXX_Simulation_t_200[2]),VSTOXX_testing_200)
- t_MAE_VSTOXX_300 = MAE(unlist(STOXX_VSTOXX_Simulation_t_300[2]),VSTOXX_testing_300)
- t_RMSE_STOXX_50 = RMSE(unlist(STOXX_VSTOXX_Simulation_t_50[1]),STOXX_testing_50)
- t_RMSE_STOXX_100 = RMSE(unlist(STOXX_VSTOXX_Simulation_t_100[1]),STOXX_testing_100)
- t_RMSE_STOXX_200 = RMSE(unlist(STOXX_VSTOXX_Simulation_t_200[1]),STOXX_testing_200)
- t_RMSE_STOXX_300 = RMSE(unlist(STOXX_VSTOXX_Simulation_t_300[1]),STOXX_testing_300)
- t_RMSE_VSTOXX_50 = RMSE(unlist(STOXX_VSTOXX_Simulation_t_50[2]),VSTOXX_testing_50)
- t_RMSE_VSTOXX_100 = RMSE(unlist(STOXX_VSTOXX_Simulation_t_100[2]),VSTOXX_testing_100)
- t_RMSE_VSTOXX_200 = RMSE(unlist(STOXX_VSTOXX_Simulation_t_200[2]),VSTOXX_testing_200)
- t_RMSE_VSTOXX_300 = RMSE(unlist(STOXX_VSTOXX_Simulation_t_300[2]),VSTOXX_testing_300)
- Frank_MAE_STOXX_50 = MAE(unlist(STOXX_VSTOXX_Simulation_Frank_50[1]),STOXX_testing_50)
- Frank_MAE_STOXX_100 = MAE(unlist(STOXX_VSTOXX_Simulation_Frank_100[1]),STOXX_testing_100)
- Frank_MAE_STOXX_200 = MAE(unlist(STOXX_VSTOXX_Simulation_Frank_200[1]),STOXX_testing_200)
- Frank_MAE_STOXX_300 = MAE(unlist(STOXX_VSTOXX_Simulation_Frank_300[1]),STOXX_testing_300)
- Frank_MAE_VSTOXX_50 = MAE(unlist(STOXX_VSTOXX_Simulation_Frank_50[2]),VSTOXX_testing_50)
- Frank_MAE_VSTOXX_100 = MAE(unlist(STOXX_VSTOXX_Simulation_Frank_100[2]),VSTOXX_testing_100)
- Frank_MAE_VSTOXX_200 = MAE(unlist(STOXX_VSTOXX_Simulation_Frank_200[2]),VSTOXX_testing_200)
- Frank_MAE_VSTOXX_300 = MAE(unlist(STOXX_VSTOXX_Simulation_Frank_300[2]),VSTOXX_testing_300)
- Frank_RMSE_STOXX_50 = RMSE(unlist(STOXX_VSTOXX_Simulation_Frank_50[1]),STOXX_testing_50)
- Frank_RMSE_STOXX_100 = RMSE(unlist(STOXX_VSTOXX_Simulation_Frank_100[1]),STOXX_testing_100)
- Frank_RMSE_STOXX_200 = RMSE(unlist(STOXX_VSTOXX_Simulation_Frank_200[1]),STOXX_testing_200)
- Frank_RMSE_STOXX_300 = RMSE(unlist(STOXX_VSTOXX_Simulation_Frank_300[1]),STOXX_testing_300)
- Frank_RMSE_VSTOXX_50 = RMSE(unlist(STOXX_VSTOXX_Simulation_Frank_50[2]),VSTOXX_testing_50)
- Frank_RMSE_VSTOXX_100 = RMSE(unlist(STOXX_VSTOXX_Simulation_Frank_100[2]),VSTOXX_testing_100)
- Frank_RMSE_VSTOXX_200 = RMSE(unlist(STOXX_VSTOXX_Simulation_Frank_200[2]),VSTOXX_testing_200)
- Frank_RMSE_VSTOXX_300 = RMSE(unlist(STOXX_VSTOXX_Simulation_Frank_300[2]),VSTOXX_testing_300)
Add Comment
Please, Sign In to add comment