# NOT RUN {
data(denmark)
## How to use cases under different models (regarding deterministic terms)
## Construct an ARDL(3,1,3,2) model with different deterministic terms -
# Without constant
ardl_3132_n <- ardl(LRM ~ LRY + IBO + IDE -1, data = denmark, order = c(3,1,3,2))
# With constant
ardl_3132_c <- ardl(LRM ~ LRY + IBO + IDE, data = denmark, order = c(3,1,3,2))
# With constant and trend
ardl_3132_ct <- ardl(LRM ~ LRY + IBO + IDE + trend(LRM), data = denmark, order = c(3,1,3,2))
## F-bounds test for no level relationship (no cointegration) ----------
# For the model without a constant
bounds_f_test(ardl_3132_n, case = 1)
# or
bounds_f_test(ardl_3132_n, case = "n")
# For the model with a constant
# Including the constant term in the long-run relationship (restricted constant)
bounds_f_test(ardl_3132_c, case = 2)
# or
bounds_f_test(ardl_3132_c, case = "rc")
# Including the constant term in the short-run relationship (unrestricted constant)
bounds_f_test(ardl_3132_c, case = "uc")
# or
bounds_f_test(ardl_3132_c, case = 3)
# For the model with constant and trend
# Including the constant term in the short-run and the trend in the long-run relationship
# (unrestricted constant and restricted trend)
bounds_f_test(ardl_3132_ct, case = "ucrt")
# or
bounds_f_test(ardl_3132_ct, case = 4)
# For the model with constant and trend
# Including the constant term and the trend in the short-run relationship
# (unrestricted constant and unrestricted trend)
bounds_f_test(ardl_3132_ct, case = "ucut")
# or
bounds_f_test(ardl_3132_ct, case = 5)
## Note that you can't restrict a deterministic term that doesn't exist
# For example, the following tests will produce an error:
# }
# NOT RUN {
bounds_f_test(ardl_3132_c, case = 1)
bounds_f_test(ardl_3132_ct, case = 3)
bounds_f_test(ardl_3132_c, case = 4)
# }
# NOT RUN {
## Asymptotic p-value and critical value bounds (assuming T = 1000) ----
# Include critical value bounds for a certain level of significance
# F-statistic is larger than the I(1) bound (for a=0.05) as expected (p-value < 0.05)
bft <- bounds_f_test(ardl_3132_c, case = 2, alpha = 0.05)
bft
bft$tab
# F-statistic is slightly larger than the I(1) bound (for a=0.005)
# as p-value is slightly smaller than 0.005
bounds_f_test(ardl_3132_c, case = 2, alpha = 0.005)
## Exact sample size p-value and critical value bounds -----------------
# Setting a seed is suggested to allow the replication of results
# 'R' can be increased for more accurate resutls
# F-statistic is smaller than the I(1) bound (for a=0.01) as expected (p-value > 0.01)
# Note that the exact sample p-value (0.01285) is very different than the asymptotic (0.004418)
# It can take more than 30 seconds
# }
# NOT RUN {
set.seed(2020)
bounds_f_test(ardl_3132_c, case = 2, alpha = 0.01, exact = TRUE)
# }
# NOT RUN {
## "F" and "Chisq" statistics ------------------------------------------
# The p-value is the same, the test-statistic and critical value bounds are different but analogous
bounds_f_test(ardl_3132_c, case = 2, alpha = 0.01)
bounds_f_test(ardl_3132_c, case = 2, alpha = 0.01, test = "Chisq")
# }
Run the code above in your browser using DataLab