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

st: Defining a value from which to start dynamic prediction

From   "Ronan Gallagher" <>
To   <>
Subject   st: Defining a value from which to start dynamic prediction
Date   Wed, 28 Oct 2009 14:44:41 -0000

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

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,

*   For searches and help try:

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index