If you wish to estimate a structural model without overidentifying constraints that is identified statistically,
specify your W matrix is structural_pars
to be such that it contains the same sign constraints in a single row
(e.g. a row of ones) and leave the other elements as NA
. In this way, the genetic algorithm works the best.
The ordering and signs of the columns of the W matrix can be changed afterwards with the functions
reorder_W_columns
and swap_W_signs
.
Because of complexity and high multimodality of the log-likelihood function, it's not certain that the estimation
algorithms will end up in the global maximum point. It's expected that most of the estimation rounds will end up in
some local maximum or saddle point instead. Therefore, a (sometimes large) number of estimation rounds is required
for reliable results. Because of the nature of the model, the estimation may fail especially in the cases where the
number of mixture components is chosen too large. With two regimes and couple hundred observations in a two-dimensional
time series, 50 rounds is usually enough. Several hundred estimation rounds often suffices for reliably fitting two-regimes
models to 3 or 4 dimensional time series. With more than two regimes and more than couple hundred
observations, thousands of estimation rounds (or more) are often required to obtain reliable results.
The estimation process is computationally heavy and it might take considerably long time for large models with
large number of observations. If the iteration limit maxit
in the variable metric algorithm is reached,
one can continue the estimation by iterating more with the function iterate_more
. Alternatively, one may
use the found estimates as starting values for the genetic algorithm and and employ another round of estimation
(see ?GAfit
how to set up an initial population with the dot parameters).
If the estimation algorithm fails to create an initial population for the genetic algorithm,
it usually helps to scale the individual series so that the AR coefficients (of a VAR model) will be
relative small, preferably less than one. Even if one is able to create an initial population, it should
be preferred to scale the series so that most of the AR coefficients will not be very large, as the
estimation algorithm works better with relatively small AR coefficients. If needed, another package can be used
to fit linear VARs to the series to see which scaling of the series results in relatively small AR coefficients.
The code of the genetic algorithm is mostly based on the description by Dorsey and Mayer (1995) but it
includes some extra features that were found useful for this particular estimation problem. For instance,
the genetic algorithm uses a slightly modified version of the individually adaptive crossover and mutation
rates described by Patnaik and Srinivas (1994) and employs (50%) fitness inheritance discussed
by Smith, Dike and Stegmann (1995).
The gradient based variable metric algorithm used in the second phase is implemented with function optim
from the package stats
.
Note that the structural models are even more difficult to estimate than the reduced form models due to
the different parametrization of the covariance matrices, so larger number of estimation rounds should be considered.
Also, be aware that if the lambda parameters are constrained in any other way than by restricting some of them to be
identical, the parameter "lambda_scale" of the genetic algorithm (see ?GAfit
) needs to be carefully adjusted accordingly.
Finally, the function fails to calculate approximate standard errors and the parameter estimates are near the border
of the parameter space, it might help to use smaller numerical tolerance for the stationarity and positive
definiteness conditions. The numerical tolerance of an existing model can be changed with the function
update_numtols
.