Stata 15 help for sspace

[TS] sspace -- State-space models

Syntax

Covariance-form syntax

sspace state_ceq [state_ceq ... state_ceq] obs_ceq [obs_ceq ... obs_ceq] [if] [in] [, options]

where each state_ceq is of the form

(statevar [lagged_statevars] [indepvars], state [noerror noconstant])

and each obs_ceq is of the form

(depvar [statevars] [indepvars] [, noerror noconstant])

Error-form syntax

sspace state_efeq [state_efeq ... state_efeq] obs_efeq [obs_efeq ... obs_efeq] [if] [in] [, options]

where each state_efeq is of the form

(statevar [lagged_statevars] [indepvars] [state_errors], state [noconstant])

and each obs_efeq is of the form

(depvar [statevars] [indepvars] [obs_errors] [, noconstant])

statevar is the name of an unobserved state, not a variable. If there happens to be a variable of the same name, the variable is ignored and plays no role in the estimation.

lagged_statevars is a list of lagged statevars. Only first lags are allowed.

state_errors is a list of state-equation errors that enter a state equation. Each state error has the form e.statevar, where statevar is the name of a state in the model.

obs_errors is a list of observation-equation errors that enter an equation for an observed variable. Each error has the form e.depvar, where depvar is an observed dependent variable in the model.

equation-level options Description ------------------------------------------------------------------------- Model state specifies that the equation is a state equation noerror specifies that there is no error term in the equation noconstant suppresses the constant term from the equation -------------------------------------------------------------------------

options Description ------------------------------------------------------------------------- Model covstate(covform) specifies the covariance structure for the errors in the state variables covobserved(covform) specifies the covariance structure for the errors in the observed dependent variables constraints(constraints) apply specified linear constraints

SE/Robust vce(vcetype) vcetype may be oim or robust

Reporting level(#) set confidence level; default is level(95) nocnsreport do not display constraints display_options control columns and column formats, row spacing, display of omitted variables and base and empty cells, and factor-variable labeling

Maximization maximize_options control the maximization process; seldom used

Advanced method(method) specify the method for calculating the log likelihood; seldom used

coeflegend display legend instead of statistics -------------------------------------------------------------------------

covform Description ------------------------------------------------------------------------- identity identity matrix; the default for error-form syntax dscalar diagonal scalar matrix diagonal diagonal matrix; the default for covariance-form syntax unstructured symmetric, positive-definite matrix; not allowed with error-form syntax -------------------------------------------------------------------------

method Description ------------------------------------------------------------------------- hybrid use the stationary Kalman filter and the De Jong diffuse Kalman filter; the default dejong use the stationary De Jong Kalman filter and the De Jong diffuse Kalman filter kdiffuse use the stationary Kalman filter and the nonstationary large-kappa diffuse Kalman filter; seldom used -------------------------------------------------------------------------

You must tsset your data before using sspace; see [TS] tsset. indepvars may contain factor variables; see fvvarlist. indepvars and depvar may contain time-series operators; see tsvarlist. by, rolling, and statsby are allowed; see prefix. coeflegend does not appear in the dialog box. See [TS] sspace postestimation for features available after estimation.

Menu

Statistics > Multivariate time series > State-space models

Description

sspace estimates the parameters of linear state-space models by maximum likelihood. Linear state-space models are very flexible and many linear time-series models can be written as linear state-space models.

sspace uses two forms of the Kalman filter to recursively obtain conditional means and variances of both the unobserved states and the measured dependent variables that are used to compute the likelihood.

The covariance-form syntax and the error-form syntax of sspace reflect the two different forms in which researchers specify state-space models. Choose the syntax that is easier for you; the two forms are isomorphic.

Options

Equation-level options

+-------+ ----+ Model +------------------------------------------------------------

state specifies that the equation is a state equation.

noerror specifies that there is no error term in the equation. noerror may not be specified in the error-form syntax.

noconstant suppresses the constant term from the equation.

Options

+-------+ ----+ Model +------------------------------------------------------------

covstate(covform) specifies the covariance structure for the state errors.

covstate(identity) specifies a covariance matrix equal to an identity matrix, and it is the default for the error-form syntax.

covstate(dscalar) specifies a covariance matrix equal to sigma_{state}^2 times an identity matrix.

covstate(diagonal) specifies a diagonal covariance matrix, and it is the default for the covariance-form syntax.

covstate(unstructured) specifies a symmetric, positive-definite covariance matrix with parameters for all variances and covariances. covstate(unstructured) may not be specified with the error-form syntax.

covobserved(covform) specifies the covariance structure for the observation errors.

covobserved(identity) specifies a covariance matrix equal to an identity matrix, and it is the default for the error-form syntax.

covobserved(dscalar) specifies a covariance matrix equal to sigma_{observed}^2 times an identity matrix.

covobserved(diagonal) specifies a diagonal covariance matrix, and it is the default for the covariance-form syntax.

covobserved(unstructured) specifies a symmetric, positive-definite covariance matrix with parameters for all variances and covariances. covobserved(unstructured) may not be specified with the error-form syntax.

constraints(constraints); see [R] estimation options.

+-----------+ ----+ SE/Robust +--------------------------------------------------------

vce(vcetype) specifies the estimator for the variance-covariance matrix of the estimator.

vce(oim), the default, causes sspace to use the observed information matrix estimator.

vce(robust) causes sspace to use the Huber/White/sandwich estimator.

+-----------+ ----+ Reporting +--------------------------------------------------------

level(#), nocnsreport; see [R] estimation options.

display_options: noci, nopvalues, noomitted, vsquish, noemptycells, baselevels, allbaselevels, nofvlabel, fvwrap(#), fvwrapon(style), cformat(%fmt), pformat(%fmt), and sformat(%fmt); see [R] estimation options.

+--------------+ ----+ Maximization +-----------------------------------------------------

maximize_options: difficult, technique(algorithm_spec), iterate(#), [no]log, trace, gradient, showstep, hessian, showtolerance, tolerance(#), ltolerance(#), nrtolerance(#), and from(matname); see [R] maximize for all options except from(), and see below for information on from(). These options are seldom used.

from(matname) specifies initial values for the maximization process. from(b0) causes sspace to begin the maximization algorithm with the values in b0. b0 must be a row vector; the number of columns must equal the number of parameters in the model; and the values in b0 must be in the same order as the parameters in e(b).

+----------+ ----+ Advanced +---------------------------------------------------------

method(method) specifies how to compute the log likelihood. This option is seldom used.

method(hybrid), the default, uses the Kalman filter with model-based initial values for the states when the model is stationary and uses the De Jong (1988, 1991) diffuse Kalman filter when the model is nonstationary.

method(dejong) uses the Kalman filter with the De Jong (1988) method for estimating the initial values for the states when the model is stationary and uses the De Jong (1988, 1991) diffuse Kalman filter when the model is nonstationary.

method(kdiffuse) is a seldom used method that uses the Kalman filter with model-based initial values for the states when the model is stationary and uses the large-kappa diffuse Kalman filter when the model is nonstationary.

The following option is available with sspace but is not shown in the dialog box:

coeflegend; see [R] estimation options.

Examples

Setup . webuse manufac . constraint 1 [D.lncaputil]u = 1

Fit an AR(1) model to changes in lncaputil . sspace (u L.u, state noconstant) (D.lncaputil u, noerror), constraints(1)

Setup . constraint 2 [u1]L.u2 = 1 . constraint 3 [u1]e.u1 = 1 . constraint 4 [D.lncaputil]u1 = 1

Fit an ARMA(1,1) model to changes in lncaputil . sspace (u1 L.u1 L.u2 e.u1, state noconstant) (u2 e.u1, state noconstant) (D.lncaputil u1, noconstant), constraints(2/4) covstate(diagonal)

Stored results

sspace stores the following in e():

Scalars e(N) number of observations e(k) number of parameters e(k_aux) number of auxiliary parameters e(k_eq) number of equations in e(b) e(k_dv) number of dependent variables e(k_obser) number of observation equations e(k_state) number of state equations e(k_obser_err) number of observation-error terms e(k_state_err) number of state-error terms e(df_m) model degrees of freedom e(ll) log likelihood e(chi2) chi-squared e(p) p-value for model test e(tmin) minimum time in sample e(tmax) maximum time in sample e(stationary) 1 if the estimated parameters indicate a stationary model, 0 otherwise e(rank) rank of VCE e(ic) number of iterations e(rc) return code e(converged) 1 if converged, 0 otherwise

Macros e(cmd) sspace e(cmdline) command as typed e(depvar) unoperated names of dependent variables in observation equations e(obser_deps) names of dependent variables in observation equations e(state_deps) names of dependent variables in state equations e(covariates) list of covariates e(tvar) variable denoting time within groups e(eqnames) names of equations e(title) title in estimation output e(tmins) formatted minimum time e(tmaxs) formatted maximum time e(R_structure) structure of observed-variable-error covariance matrix e(Q_structure) structure of state-error covariance matrix e(chi2type) Wald; type of model chi-squared test e(vce) vcetype specified in vce() e(vcetype) title used to label Std. Err. e(opt) type of optimization e(method) likelihood method e(initial_values) type of initial values e(technique) maximization technique e(tech_steps) iterations taken in maximization technique e(datasignature) the checksum e(datasignaturevars) variables used in calculation of checksum e(properties) b V e(estat_cmd) program used to implement estat e(predict) program used to implement predict e(marginsnotok) predictions disallowed by margins e(asbalanced) factor variables fvset as asbalanced e(asobserved) factor variables fvset as asobserved

Matrices e(b) parameter vector e(Cns) constraints matrix e(ilog) iteration log (up to 20 iterations) e(gradient) gradient vector e(gamma) mapping from parameter vector to state-space matrices e(A) estimated A matrix e(B) estimated B matrix e(C) estimated C matrix e(D) estimated D matrix e(F) estimated F matrix e(G) estimated G matrix e(chol_R) Cholesky factor of estimated R matrix e(chol_Q) Cholesky factor of estimated Q matrix e(chol_Sz0) Cholesky factor of initial state covariance matrix e(z0) initial state vector augmented with a matrix identifying nonstationary components e(d) additional term in diffuse initial state vector, if nonstationary model e(T) inner part of quadratic form for initial state covariance in a partially nonstationary model e(M) outer part of quadratic form for initial state covariance in a partially nonstationary model e(V) variance-covariance matrix of the estimators e(V_modelbased) model-based variance

Functions e(sample) marks estimation sample

References

De Jong, P. 1988. The likelihood for a state space model. Biometrika 75: 165-169.

------. 1991. The diffuse Kalman filter. Annals of Statistics 19: 1073-1083.


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index