<>
*************
su datenum if estimation_window==1, mean
*************
and then feed the result to the -dynamic- option as -dynamic(`r(max)')-
HTH
Martin
-----Ursprüngliche Nachricht-----
Von: [email protected]
[mailto:[email protected]] Im Auftrag von Ronan Gallagher
Gesendet: Mittwoch, 28. Oktober 2009 15:45
An: [email protected]
Betreff: st: Defining a value from which to start dynamic prediction
Hi Statalisters,
I am presently writing some code to implement a multivariate garch model and
make dynamic out of sample predictions. My variables are as follows:
reta = firm a's stock return
l.reta = firm a's lagged stock return
retb = firm b's stock return
In addition I have a time variable called datenum and a binary variable
called estimation_window which essentially tells me whether the relevant
datenum falls within the window over which I want to fit my garch model.
Outside my estimation window I want to make dynamic predictions. My code is
as follows:
dvech (reta = l.reta retb) if estimation_window==1, arch(1) garch(1)
predict outsampred, dynamic(2283)
The value 2283 above refers to the maximum value of datenum for which
estimation_window==1. Rather than use 2283, i need the dynamic() option to
take an argument which for this stock happens to be 2283. Is there anyway I
can set dynamic to take an argument defined as max of datenum when
estimation_window==1?
My goal is then to amend my code to loop over the different stocks I am
analysing which is quite straight forward.
Any help is greatly appreciated.
Kind regards,
Ronan
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/