# NOT RUN {
# 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 minimizes the NSR criterion
results <- EWS_NSR_Criterion(Var_Proba = vector_proba, Dicho_Y = vector_binary,
cutoff_interval = 0.0001)
# print results
results
#}
# }
Run the code above in your browser using DataLab