f_histo_RM | R Documentation |
This function allows to calculate historical historical parameters and the VaR and ES for each historical period.
f_histo_RM(param_histo, type_function, alpha)
param_histo |
Dataframe with the parameters of the distribution for each period. |
type_function |
String argument : "gaussian" for Normal Distribution, "skew-gaussian" for Skew-Normal Distribution or "skew-t" for t-student distribution |
alpha |
Numeric argument for Expected-Shortfall, between 0 and 1 |
A list with historical estimated coefficients, VaR(alpha) and ES(alpha)
data("data_euro")
# Data process
PIB_euro_forward_4 = data_euro["GDP"][c(5:length(data_euro["GDP"][,1])),]
FCI_euro_lag_4 = data_euro["FCI"][c(1:(length(data_euro["GDP"][,1]) - 4)),]
CISS_euro_lag_4 = data_euro["CISS"][c(1:(length(data_euro["GDP"][,1]) - 4)),]
results_quantile_reg <- f_compile_quantile(qt_trgt=as.vector(c(0.10,0.25,0.75,0.90)),
v_dep=PIB_euro_forward_4,
v_expl=cbind(FCI_euro_lag_4, CISS_euro_lag_4))
histo_param <- f_distrib(type_function="skew-t",
compile_qt=results_quantile_reg,
starting_values=c(0, 1, -0.5, 1.3))
# for a skew-t
results_s <- f_histo_RM(param_histo = histo_param,
type_function="skew-t",
alpha=0.95)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.