RATS 11.1
RATS 11.1

Standard Options /

START and ONLYIF Options

Home Page

← Previous Next →

The START option

The START option is available on the non-linear estimation instructions DLM, GARCH, MAXIMIZE, NLLS, and NLSYSTEM, as well as the data transformation instructions SET, CSET, GSET and SSTATS. This evaluates an expression once per function evaluation, before the main function being estimated is evaluated. The START expression is not re-evaluated at each time period, so it is appropriate only for portions of an estimation that are time-invariant. This can be used to handle pre-sample values or time-consuming calculations that are time-invariant. It's particularly helpful in  state-space models or Markov switching models that often require calculation of initial conditions before starting a recursion through the actual data.

 

For instance, the geometric distributed lag

\begin{equation} y_t = \beta _0 + \beta _1 \left\{ {\sum\limits_{s = 0}^\infty {\lambda ^s X_{t - s} } } \right\} \end{equation}

has an (uncomputable) infinite sum. However, we can write the part in braces (call it \(Z_t\)) as:

\begin{equation} Z_t = X_t + \lambda {\kern 1pt} {\kern 1pt} Z_{t - 1} \end{equation}

Then the uncomputable part can be reduced to the single value:

\begin{equation} Z_0 = \sum\limits_{s = 0}^\infty {\lambda ^s X_{ - s} } \end{equation}

We can add this as a freely estimated parameter in the model:

 

declare real zt

nonlin beta0 beta1 z0 lambda

frml  geomdlag = (zt=x+lambda*zt)),beta0 + beta1 * zt

 

where we need to add the option START=(ZT=Z0) on the instruction which estimates the model. This will cause ZT to be initialized to the current value of Z0 at the start of every function evaluation.

 

START is particularly useful for the DLM instruction, which estimates state-space models. Most inputs to DLM aren’t time-varying, but some may depend upon parameters that we need to estimate, and some can be quite large and complicated.

 

If you need to do several calculations in your START option, you need to enclose them in the “empty function” %(...), for instance

START=%(ZT=Z0,BETA1=EXP(LBETA))

 

The %(...) is just to group the calculations together into a single option, since the comma alone is used to separate options.

 

The ONLYIF option

The START option is evaluated before anything else on a function evaluation. In some cases, most of the work in the estimation is handled by this. ONLYIF is very similar to REJECT, except the test works the opposite way, and ONLYIF applies before START, while REJECT is applied after it. ONLYIF can be used to avoid doing the START calculation for values for which that would be illegal (or just poorly-behaved). For instance, if the START calculation would fail for values of RHO bigger than one, you would want the combination ONLYIF=(RHO<=1.0),START=start calculation. If START computes a value P which might be outside a legal range of [0,1], you would want to use START=start calculation,REJECT=(P<0.OR.P>1).


Copyright © 2026 Thomas A. Doan