Code: Select all
SET Q / = %seesq**0.5
SET H / = EXP(RANGE - 0.43)
SET U / = 0.0
SET series start end = function(T)
SET series * end = function(T)
SET series start * = function(T)
SET series = function(T)
The first of those controls both the start and end entries. The second begins from the default "start" (usually entry 1) and goes to the entry given by end. The third begins at entry start and runs until the default "end" (usually the end of the workspace), and the last runs over the whole range (generally 1 to the end of the workspace). The "/" in the old style of code shown above chooses the default range for both limits (it's the equivalent of * *). But that's assumed anyway, so it isn't necessary.
In most cases, you can just use that last, simplest form. If the function can't be evaluated at all entries (due to lags, for instance), the output series will just have missing values for those entries that must be skipped. Some control of the range is needed in a few situations:
1. You're creating the series in two (or more) separate ranges.
For instance:
Code: Select all
set y 1 2 = 0.0
set y 3 100 = 2*y{1}-y{2}+u+.3*u{1}
Code: Select all
set y = 0.0
set y = 2*y{1}-y{2}+u+.3*u{1}
2. You have series defined over a completely different range from the main workspace.
A common situation is where you have series of simulations. Any SET instructions operating on a series running over the number of simulations will likely need the explicit range:
Code: Select all
set workwt 1 ndraws = weights(t)
This commonly occurs with DLM, which defines most of its output series in the form of SERIES[VECTOR]. In this example, xstates is a SERIES[VECT] which is only defined over the estimation range (dstart to dend).
Code: Select all
set nairu dstart dend = xstates(t)(5)