Description Usage Arguments Value Author(s) References Examples
This function estimates the response functions of dichotomous models in a univariate framework using the method proposed by Lajaunie (2021). The response functions are based on the 4 specifications proposed by Kauppi & Saikkonen (2008).
1 | GIRF_Dicho(Dicho_Y, Exp_X, Lag, Int, t_mod, horizon, shock_size, OC)
|
Dicho_Y |
Vector of the binary time series. |
Exp_X |
Vector or Matrix of explanatory time series. |
Lag |
Number of lags used for the estimation. |
Int |
Boolean value: TRUE for an estimation with intercept, and FALSE otherwise. |
t_mod |
Model number: 1, 2, 3 or 4. -> 1 for the static model: P_{t-1}(Y_{t}) = F(π_{t})=F(α + β'X_{t}) -> 2 for the dynamic model with lag binary variable: P_{t-1}(Y_{t}) = F(π_{t})=F(α + β'X_{t} + γ Y_{t-l}) -> 3 for the dynamic model with lag index variable: P_{t-1}(Y_{t}) = F(π_{t})=F(α + β'X_{t} + η π_{t-l}) -> 4 for the dynamic model with both lag binary variable and lag index variable: P_{t-1}(Y_{t}) = F(π_{t})=F(α + β'X_{t} + η π_{t-l} + γ Y_{t-l}) |
horizon |
Numeric variable corresponding to the horizon target for the GIRF analysis. |
shock_size |
Numeric variable equal to the size of the shock. It can be estimated with the Vector_Error function. |
OC |
Numeric variable equal to the Optimal Cut-off (threshold). This threshold can be considered arbitrarily, with a value between 0 and 1, or it can be estimated with one of the functions EWS_AM_Criterion, EWS_CSA_Criterion, or EWS_NSR_Criterion. |
Matrix with 7 columns:
column 1 |
horizon |
column 2 |
index |
column 3 |
index with shock |
column 4 |
probability associated to the index |
column 5 |
probability associated to the index with shock |
column 6 |
binary variable associated to the index |
column 7 |
binary variable associated to the index with shock |
Jean-Baptiste Hasse and Quentin Lajaunie
Kauppi, Heikki, and Pentti Saikkonen. "Predicting US recessions with dynamic binary response models." The Review of Economics and Statistics 90.4 (2008): 777-791.
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 31 32 33 34 35 36 37 38 39 40 41 | # 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 = 1)
# 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
Threshold_AM <- EWS_AM_Criterion(Var_Proba = vector_proba, Dicho_Y = vector_binary,
cutoff_interval = 0.0001)
# Estimate the estimation errors
Residuals <- Vector_Error(Dicho_Y = Var_Y, Exp_X = Var_X, Intercept = TRUE,
Nb_Id = 1, Lag = 1, type_model = 1)
# Initialize the shock
size_shock <- quantile(Residuals,0.95)
# GIRF Analysis
results <- GIRF_Dicho(Dicho_Y = Var_Y, Exp_X = Var_X, Lag = 1, Int = TRUE, t_mod = 1,
horizon = 3, shock_size = size_shock, OC = Threshold_AM)
# print results
results
#}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.