Object Reference : Object View and Procedure Reference : Var
  
 
switchvar
Estimate a switching VAR specification.
Syntax:
var_name.switchvar(options) lag_pairs endog_list [@ exog_list] [ @prv list_of_probability_regressors ]
You must specify the order of the VAR (using one or more pairs of lag intervals), and then provide a list of series or groups to be used as endogenous variables. You may include exogenous variables such as trends and seasonal dummies in the VAR by including an “@-sign” followed by a list of series or groups. A constant is automatically added to the list of exogenous variables; to estimate a specification without a constant, you should use the option “noconst”.
Options
General options
 
msm
Switching mean specification (default is switching intercept).
exognv
Exogenous variables are non-regime specific (default is for exogenous variables to vary).
endogvary
Lagged endogenous variables are regime specific (default is for the endogenous variables to be non-varying).
noconst
Do not include a constant in exogenous regressors list.
fprobmat=arg
Name of fixed transition probability matrix allows for fixing specific elements of the time-invariant transition matrix. Leave NAs in elements of the matrix to estimate. The element of the matrix corresponds to .
initprob=arg (default=“ergodic”)
Method for determining initial Markov regime probabilities: ergodic solution (“ergodic”), estimated parameter (“est”), equal probabilities (“uniform”), user-specified probabilities (“user”).
If “initprob=user” is specified, you will need to specify the “userinit=” option.
userinit=arg
Name of vector containing user-specified initial Markov probabilities. The vector should have rows equal to the number of states; we expand this to the size of the initial lag state vector where necessary for AR specifications.
For use in specifications containing both the “type=markov” and “initprob=user” options.
startnum=arg (default=0 or 25)
Number of random starting values tried. The default is 0 for user-supplied coefficients (option “s”) and 25 in all other cases.
startiter=arg (default=10)
Number of iterations taken after each random start before comparing objective to determine final starting value.
searchnum=arg (default=0)
Number of post-estimation perturbed starting values tried.
searchsds=arg (default=1)
Number of standard deviations to use in perturbed starts (if “searchnum=”) is specified.
seed=positive_integer from 0 to 2,147,483,647
Seed the random number generator.
If not specified, EViews will seed random number generator with a single integer draw from the default global random number generator.
rnd=arg (default=“kn” or method previously set using rndseed).
Type of random number generator: improved Knuth generator (“kn”), improved Mersenne Twister (“mt”), Knuth’s (1997) lagged Fibonacci generator used in EViews 4 (“kn4”) L’Ecuyer’s (1999) combined multiple recursive generator (“le”), Matsumoto and Nishimura’s (1998) Mersenne Twister used in EViews 4 (“mt4”).
In addition to the specification options, there are options for estimation and covariance calculation.
Additional Options
 
optmethod = arg
Optimization method: “bfgs” (BFGS); “newton” (Newton-Raphson), “opg” or “bhhh” (OPG or BHHH), “legacy” (EViews legacy).
BFGS is the default method.
optstep = arg
 
Step method: “marquardt” (Marquardt); “dogleg” (Dogleg); “linesearch” (Line search).
Marquardt is the default method.
m=integer
Set maximum number of iterations.
c=scalar
Set convergence criterion. The criterion is based upon the maximum of the percentage changes in the scaled coefficients. The criterion will be set to the nearest value between 1e-24 and 0.2.
cov=arg
Covariance method: “ordinary” (default method based on inverse of the estimated information matrix), “huber” or “white” (Huber-White sandwich method).
covinfo = arg
Information matrix method: “opg” (OPG); “hessian” (observed Hessian).
(Applicable when non-legacy “optmethod=”.)
nodf
Do not degree-of-freedom correct the coefficient covariance estimate.
coef=arg
Specify the name of the coefficient vector (if specified by list); the default behavior is to use the “C” coefficient vector.
s
Use the current coefficient values in “C” as starting values (see also param).
s=number
Specify a number between zero and one to determine starting values as a fraction of EViews default values (out of range values are set to “s=1”).
showopts / ‑showopts
[Do / do not] display the starting coefficient values and estimation options in the estimation output.
prompt
Force the dialog to appear from within a program.
p
Print results.
Examples
var01.switchvar(type=markov) 1 3 m1 gdp
declares and estimates a MSI(2)-VAR(3) with two endogenous variables (M1 and GDP) and a switching constant.
var01.switchvar(type=markov, msm) 1 3 m1 gdp
estimates the MSM(2)-VAR(3) variant of the same specification..
var01.switchvar(type=markov, msm, endogvary, seed=1551063419) 1 3 m1 gdp
estimates a MSMA(2)-VAR(3) specification.
Cross-references
See “Switching VAR” for details.
See also Var::ls and Var::ec for estimation of ordinary VARs and error correction models.