Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: keeping cointegrating parameters


From   Christopher Baum <[email protected]>
To   "[email protected]" <[email protected]>
Subject   Re: st: keeping cointegrating parameters
Date   Mon, 8 Oct 2012 17:58:56 +0000

<>
Jeremy said

I am running a rolling vector error correction model and want to evaluate the stability of the adjustment parameters (alpha) and the cointegrating parameters (beta). 
The issue though is that when I use:
"rolling, recursive window(10): vec cpiINF lendingrate borrowingrate l_capital l_production l_loans, lags(5) rank(2) alpha bconstraints(1/5) aconstraints(6/9) nolog", the only variables that are left are all the short term variables.
Is there a way to tell Stata to keep the alpha and beta parameters that are stored in the results from a typical "vec"? With "vec" they are stored as e(alpha), e(beta) respectively.


The complication here is that e(alpha) and e(beta) are matrices. The exp_list supported by -rolling- can only contain scalars, but can contain any number of them. You need a "wrapper program" strategy similar to that of -myregress- in itsp.ado (findit myregress), as discussed in ITSP (Baum, 2009). Here is a quick and dirty hack of -myregress-:

-----------------------------
capt prog drop myvec
program myvec, rclass
version 12
syntax varlist(ts) [if] [in]
vec `varlist' `if' `in'
mat alpha = e(alpha)
loc nc = colsof(alpha)
forv i=1/`nc' {
	ret sca alpha`i' = alpha[1,`i']
}
mat beta = e(beta)
loc nc = colsof(beta)
forv i=1/`nc' {
	ret sca beta`i' = beta[1,`i']
}
end

webuse rdinc
// test the program to see if it sends back the right stuff
myvec ln_ne ln_se
ret li

rolling alpha1=r(alpha1) alpha2=r(alpha2) beta1=r(beta1) beta2=r(beta2) beta3=r(beta3), ///
 recursive window(10): myvec ln_ne ln_se
list
---------------------

Kit

Kit Baum   |   Boston College Economics & DIW Berlin   |   http://ideas.repec.org/e/pba1.html
                             An Introduction to Stata Programming  |   http://www.stata-press.com/books/isp.html
  An Introduction to Modern Econometrics Using Stata  |   http://www.stata-press.com/books/imeus.html


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index