Description Usage Arguments Value Author(s) References Examples
View source: R/EWS_functions.R
This function provides a method to compute the optimal AM (Accuracy Measure) criterion. As defined in Candelon, Dumitrescu and Hurlin (2012), this approach consists in aggregating the number of crisis and calm periods correctly identified by the EWS. The optimal cut-off maximizes the number of correctly identified periods.
1 | EWS_AM_Criterion(Var_Proba, Dicho_Y, cutoff_interval)
|
Var_Proba |
Vector containing the estimated probabilities obtained with the Logistic Estimation function. |
Dicho_Y |
Vector of the binary time series. |
cutoff_interval |
Numeric variable between 0 and 1. |
A numeric variable containing the optimal cut-off that maximizes the higher proportion of calm and crisis periods correctly identified.
Jean-Baptiste Hasse and Quentin Lajaunie
Candelon, Bertrand, Elena-Ivona Dumitrescu, and Christophe Hurlin. "How to evaluate an early-warning system: Toward a unified statistical framework for assessing financial crises forecasting methods." IMF Economic Review 60.1 (2012): 75-113.
Lajaunie, Quentin. Generalized Impulse Response Function for Dichotomous Models. No. 2852. Orleans Economics Laboratory/Laboratoire d'Economie d'Orleans (LEO), University of Orleans, 2021.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | # NOT RUN {
# Import data
data("data_USA")
# Data process
Var_Y <- as.vector(data_USA$NBER)
Var_X <- as.vector(data_USA$Spread)
# Estimate the logit regression
Logistic_results <- Logistic_Estimation(Dicho_Y = Var_Y, Exp_X = Var_X, Intercept = TRUE,
Nb_Id = 1, Lag = 1, type_model = 4)
# Vector of probabilities
vector_proba <- as.vector(rep(0,length(Var_Y)-1))
vector_proba <- Logistic_results$prob
# Vector of binary variables
Lag <- 1
vector_binary <- as.vector(rep(0,length(Var_Y)-1))
vector_binary <- Var_Y[(1+Lag):length(Var_Y)]
# optimal cut-off that maximizes the AM criterion
results <- EWS_AM_Criterion(Var_Proba = vector_proba, Dicho_Y = vector_binary,
cutoff_interval = 0.0001)
# print results
results
#}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.