f_histo_RM {atRisk} | R Documentation |
Historical parameters
Description
This function allows to calculate historical historical parameters and the VaR and ES for each historical period.
Usage
f_histo_RM(param_histo, type_function, alpha)
Arguments
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 |
Value
A list with historical estimated coefficients, VaR(alpha) and ES(alpha)
Examples
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)
[Package atRisk version 0.2.0 Index]