user25375480
user25375480

Reputation: 1

can I recreate output of uecm of the best auto_ardl model using dynlm

Can you guys please help me find the reasoning whether I can use dynlm package to recreate a uecm model extracted from ARDL package? and if I could, why the summary produced is very different. Can I use dynlm to model several variables that are not stationary as what ECM is able to do?

I create a model using auto_ardl and extract uecm of the best model from auto_ardl with this code:

library(ARDL)
ardl_test \<- auto_ardl(logKINBU \~ SBIV+logGCSM+logDKTOT, data = KINBU_tn, max_order = c(3,3,3,3))
ard11 \<- ardl_test$best_model
ue.ardl1 \<- uecm(ard11)
summary(ue.ardl1)

The result of the summary is as follow:

Time series regression with "ts" data:
Start = 2011(2), End = 2022(4)

Call:
dynlm::dynlm(formula = full_formula, data = data, start = start, 
    end = end)

Residuals:
      Min        1Q    Median        3Q       Max 
-0.032620 -0.009780 -0.002166  0.007290  0.092606 

Coefficients:
                Estimate Std. Error t value Pr(>|t|)   
(Intercept)    -1.633134   0.797861  -2.047  0.04696 * 
L(logKINBU, 1) -0.141840   0.048997  -2.895  0.00599 **
SBIV            0.003054   0.005654   0.540  0.59193   
logGCSM         0.195276   0.083378   2.342  0.02399 * 
logDKTOT        0.052885   0.086300   0.613  0.54331   
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 0.02167 on 42 degrees of freedom
Multiple R-squared:  0.5268,    Adjusted R-squared:  0.4817 
F-statistic: 11.69 on 4 and 42 DF,  p-value: 1.811e-06

And then, when I tried using dynlm to recreate the uecm version of the model with this code:

ardl_model = dynlm::dynlm(formula = logKINBU ~ L(logKINBU, 1)+SBIV+logGCSM+logDKTOT, data = KINBU_tn)
summary(ardl_model)

the summary result is very different with R-squared that is very high:

Time series regression with "ts" data:
Start = 2011(2), End = 2022(4)

Call:
dynlm::dynlm(formula = logKINBU ~ L(logKINBU, 1) + SBIV + logGCSM + 
    logDKTOT, data = KINBU_tn)

Residuals:
      Min        1Q    Median        3Q       Max 
-0.032620 -0.009780 -0.002166  0.007290  0.092606 

Coefficients:
                Estimate Std. Error t value Pr(>|t|)    
(Intercept)    -1.633134   0.797861  -2.047    0.047 *  
L(logKINBU, 1)  0.858160   0.048997  17.515   <2e-16 ***
SBIV            0.003054   0.005654   0.540    0.592    
logGCSM         0.195276   0.083378   2.342    0.024 *  
logDKTOT        0.052885   0.086300   0.613    0.543    
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 0.02167 on 42 degrees of freedom
Multiple R-squared:  0.9973,    Adjusted R-squared:  0.997 
F-statistic:  3871 on 4 and 42 DF,  p-value: < 2.2e-16

Could you please educate me, what's wrong with the implementation of my code? Can UECM be recreated with dynlm? If both turned out okay, will the spurious regression be issue in the dynlm version of my model?

Your help is really appreciated.

Upvotes: 0

Views: 42

Answers (1)

Nats
Nats

Reputation: 346

That's simply because the dependent variable in the UECM should be Δy instead of y, i.e. D(logKINBU).

You actually said "the summary result is very different with R-squared that is very high" which could lead you to the solution.

Upvotes: 0

Related Questions