Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Residual-based bootstrap for a VECM

    Hi, everyone,

    I have estimated a vector error correction model (VECM) including 5 variables with 230 observations each. All variables are stationary after first differencing and there are 2 cointegrating relationships (vecrank). Lag order selection criteria (varsoc) recommends 2-3 lags. When I test for normality (vecnorm) I find strong evidence of joint non-normality. I’ve read that this isn’t necessarily an issue so long as I bootstrap the confidence intervals for the impulse-response functions. If I understand correctly, this means I need to write a program that resamples the residuals from my estimated model. Then I need use the simulate command to run this program ~200 times and calculate a new 95% confidence interval. There is an example of creating a bootstrap dataset in the Stata bstat manual, but it’s for a linear regression, not a VECM. How would I modify the code below for a VECM, which has multiple equations for the residuals?

    Code:
    matrix b = e(b)
    local n = e(N)
    predict res, residuals
    
    program mysim_r
    version 19.5
    syntax name(name=bvector), res(varname)
    tempvar y rid
    local xvars : colnames ‘bvector’
    local cons _cons
    local xvars : list xvars - cons
    matrix score double ‘y’ = ‘bvector’
    generate long ‘rid’ = int(_N*runiform()) + 1
    replace ‘y’ = ‘y’ + ‘res’[‘rid’]
    regress ‘y’ ‘xvars’
    end
    Last edited by Marc Triller; 24 Jul 2025, 12:20.
Working...
X