Stata 15 help for dfactor

[TS] dfactor -- Dynamic-factor models


dfactor obs_eq [fac_eq] [if] [in] [, options]

obs_eq specifies the equation for the observed dependent variables, and it has the form

(depvars = [exog_d] [, sopts])

fac_eq specifies the equation for the unobserved factors, and it has the form

(facvars = [exog_f] [, sopts])

depvars are the observed dependent variables. exog_d are the exogenous variables that enter into the equations for the observed dependent variables. (All factors are automatically entered into the equations for the observed dependent variables.) facvars are the names for the unobserved factors in the model. You may specify the names of existing variables in facvars, but dfactor treats them only as names and takes no notice that they are also variables. exog_f are the exogenous variables that enter into the equations for the factors.

options Description ------------------------------------------------------------------------- Model 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 from(matname) specify initial values for the maximization process; seldom used

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

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

sopts Description ------------------------------------------------------------------------- Model noconstant suppress constant term from the equation; allowed only in obs_eq ar(numlist) autoregressive terms arstructure(arstructure) structure of autoregressive coefficient matrices covstructure(covstructure) covariance structure -------------------------------------------------------------------------

arstructure Description ------------------------------------------------------------------------- diagonal diagonal matrix; the default ltriangular lower triangular matrix general general matrix -------------------------------------------------------------------------

covstructure Description ------------------------------------------------------------------------- identity identity matrix dscalar diagonal scalar matrix diagonal diagonal matrix unstructured symmetric, positive-definite matrix -------------------------------------------------------------------------

method Description ------------------------------------------------------------------------- hybrid use the stationary Kalman filter and the De Jong diffuse Kalman filter; the default dejong use the stationary De Jong method and the De Jong diffuse Kalman filter -------------------------------------------------------------------------

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


Statistics > Multivariate time series > Dynamic-factor models


dfactor estimates the parameters of dynamic-factor models by maximum likelihood. Dynamic-factor models are flexible models for multivariate time series in which unobserved factors have a vector autoregressive structure, exogenous covariates are permitted in both the equations for the latent factors and the equations for observable dependent variables, and the disturbances in the equations for the dependent variables may be autocorrelated.


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

constraints(constraints) apply linear constraints. Some specifications require linear constraints for parameter identification.

noconstant suppresses the constant term.

ar(numlist) specifies the vector autoregressive lag structure in the equation. By default, no lags are included in either the observable or the factor equations.

arstructure(diagonal|ltriangular|general) specifies the structure of the matrices in the vector autoregressive lag structure.

arstructure(diagonal) specifies the matrices to be diagonal -- separate parameters for each lag, but no cross-equation autocorrelations. arstructure(diagonal) is the default for both the observable and the factor equations.

arstructure(ltriangular) specifies the matrices to be lower triangular -- parameterizes a recursive, or Wold causal, structure.

arstructure(general) specifies the matrices to be general matrices -- separate parameters for each possible autocorrelation and cross-correlation.

covstructure(identity|dscalar|diagonal|unstructured) specifies the covariance structure of the errors.

covstructure(identity) specifies a covariance matrix equal to an identity matrix, and it is the default for the errors in the factor equations.

covstructure(dscalar) specifies a covariance matrix equal to sigma^2 times an identity matrix.

covstructure(diagonal) specifies a diagonal covariance matrix, and it is the default for the errors in the observable variables.

covstructure(unstructured) specifies a symmetric, positive-definite covariance matrix with parameters for all variances and covariances.

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

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

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

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

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

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

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 dfactor 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). This option is seldom used.

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

method(method) specifies how to compute the log likelihood. dfactor writes the model in state-space form and uses sspace to estimate the parameters. method() offers two methods for dealing with some of the technical aspects of the state-space likelihood. This option is seldom used.

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

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

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

coeflegend; see [R] estimation options.


Setup . webuse dfex

Fit a dynamic-factor model in which first differences of ipman, income, hours, and unemp depend on an unobserved factor that follows an AR(2) process . dfactor (D.(ipman income hours unemp) = , noconstant) (f = , ar(1/2))

Same as above, but allowing the errors in the four observables' equations to be autocorrelated . dfactor (D.(ipman income hours unemp) = , noconstant ar(1)) (f = , ar(1/2))

Fit a dynamic-factor model with an unstructured error covariance matrix, constraining the error covariance for the unemp and income equations to zero . constraint 1 [cov(De.unemp,De.income)]_cons = 0 . dfactor (D.(ipman income unemp) = LD.(ipman income), noconstant covstructure(unstructured)), constraints(1)

Stored results

dfactor 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_eq_model) number of equations in overall model test e(k_dv) number of dependent variables e(k_obser) number of observation equations e(k_factor) number of factors specified e(o_ar_max) number of AR terms for the disturbances e(f_ar_max) number of AR terms for the factors 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) dfactor 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(covariates) list of covariates e(factor_deps) names of unobserved factors in model e(tvar) variable denoting time within groups e(eqnames) names of equations e(model) type of dynamic-factor model specified e(title) title in estimation output e(tmins) formatted minimum time e(tmaxs) formatted maximum time e(o_ar) list of AR terms for disturbances e(f_ar) list of AR terms for factors e(observ_cov) structure of observation-error covariance matrix e(factor_cov) structure of factor-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(s) 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) coefficient vector e(Cns) constraints matrix e(ilog) iteration log (up to 20 iterations) e(gradient) gradient vector e(V) variance-covariance matrix of the estimators e(V_modelbased) model-based variance

Functions e(sample) marks estimation sample


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