Writing a loop within the .mod file
Posted: Tue Feb 28, 2017 11:37 pm
Hello all,
I am afraid this may be a trivial question, but I am nonetheless curious; one of the options in the "estimation" function is the starting value for the data set one is using in order to estimate the model. Another option is the length of the "window" of data. So, for example, if one has a data set of 500 observations and uses a starting value of 25 and a length of 100, only the observations #25 through 125 will be used.
I am wondering if anyone has ever written a loop within the matlab environment or even within the .mod file in order to run a routine where the "window" stays the same size, but the beginning value is incrementally increased so that a "rolling window" type of estimation is performed and after each iteration, the posterior means of specified parameters to be estimated are stored in a vector of sorts?
Has anyone ever done anything remotely similar to this, and if so, do you mind posting your code?
I am afraid this may be a trivial question, but I am nonetheless curious; one of the options in the "estimation" function is the starting value for the data set one is using in order to estimate the model. Another option is the length of the "window" of data. So, for example, if one has a data set of 500 observations and uses a starting value of 25 and a length of 100, only the observations #25 through 125 will be used.
I am wondering if anyone has ever written a loop within the matlab environment or even within the .mod file in order to run a routine where the "window" stays the same size, but the beginning value is incrementally increased so that a "rolling window" type of estimation is performed and after each iteration, the posterior means of specified parameters to be estimated are stored in a vector of sorts?
Has anyone ever done anything remotely similar to this, and if so, do you mind posting your code?