GSET Instruction |
GSET( options ) series start end = function(t)
GSET can be used to set entries of SERIES of matrices or any other data type. While almost anything that can be done with GSET could also be done using VECTORS of the desired data types, using the SERIES form allows subscripting to match up with that used by the data itself. It also allows you to use lag notation.
Parameters
|
series |
The series of arrays to create or set with this instruction. |
|
start, end |
range of entries to set. If you have not set a SMPL, this defaults to the standard workspace. |
|
function(T) |
function of the entry number T giving the value for entry T of series. This should evaluate to the type of the elements of the series. There should be at least one blank on either side of the =. The function can actually include multiple expressions, separated by commas. The series will be set to the value returned by the final expression in the list. |
Options
SMPL=standard SMPL option [unused].
Omits observations where the SMPL series or expression is zero from the series of arrays.
STARTUP=expression evaluated at period "start"
You can use the STARTUP option to provide an expression which is computed just once, before the regular formula is computed. This allows you to do any time-consuming calculations that don’t depend upon time. It can be an expression of any type.
[PANEL]/NOPANEL
When working with panel data, NOPANEL disables the special panel data treatment of expressions which cross individual boundaries.
Examples
dec series[symm] rr
gset rr %regstart() %regend() = %cvtocorr(hh)
gset rr %regend()+1 %regend()+nfore = (1-alpha-beta)*rbar+(alpha+beta)*rr{1}
RR is a series of correlation matrices, which are always SYMMETRIC. This uses one formula for the period from %REGSTART() to %REGEND() and another for the period after that.
dec series[vect] hdraws
gset hdraws bstart bend = %zeros(ndraws,1)
This defines HDRAWS as a SERIES[VECTORS] and initializes the entries between BSTART and BEND as dimension NDRAWS vectors. (%ZEROS is the easiest way to do that).
dec series[vect] rvstd rvstdc
dec series[vect] hv uuv
gset rvstd gstart gend = %solve(%chol(h(t)),rv(t))
gset rvstdc gstart gend = rv(t)./%xdiag(h(t))
gset hv gstart gend = %xdiag(h(t))
gset uuv gstart gend = rv(t).*rv(t)
This generates several SERIES[VECTORS] of diagnostics for multivariate GARCH models.
Copyright © 2026 Thomas A. Doan