class_docstr: Dynamic factor model
  
  Parameters
  ----------
  endog : array_like
      The observed time-series process :math:`y`
  exog : array_like, optional
      Array of exogenous regressors for the observation equation, shaped
      nobs x k_exog.
  k_factors : int
      The number of unobserved factors.
  factor_order : int
      The order of the vector autoregression followed by the factors.
  error_cov_type : {'scalar', 'diagonal', 'unstructured'}, optional
      The structure of the covariance matrix of the observation error term,
      where "unstructured" puts no restrictions on the matrix, "diagonal"
      requires it to be any diagonal matrix (uncorrelated errors), and
      "scalar" requires it to be a scalar times the identity matrix. Default
      is "diagonal".
  error_order : int, optional
      The order of the vector autoregression followed by the observation
      error component. Default is None, corresponding to white noise errors.
  error_var : bool, optional
      Whether or not to model the errors jointly via a vector autoregression,
      rather than as individual autoregressions. Has no effect unless
      `error_order` is set. Default is False.
  enforce_stationarity : bool, optional
      Whether or not to transform the AR parameters to enforce stationarity
      in the autoregressive component of the model. Default is True.
  **kwargs
      Keyword arguments may be used to provide default values for state space
      matrices or for Kalman filtering options. See `Representation`, and
      `KalmanFilter` for more details.
  
  Attributes
  ----------
  exog : array_like, optional
      Array of exogenous regressors for the observation equation, shaped
      nobs x k_exog.
  k_factors : int
      The number of unobserved factors.
  factor_order : int
      The order of the vector autoregression followed by the factors.
  error_cov_type : {'diagonal', 'unstructured'}
      The structure of the covariance matrix of the error term, where
      "unstructured" puts no restrictions on the matrix and "diagonal"
      requires it to be a diagonal matrix (uncorrelated errors).
  error_order : int
      The order of the vector autoregression followed by the observation
      error component.
  error_var : bool
      Whether or not to model the errors jointly via a vector autoregression,
      rather than as individual autoregressions. Has no effect unless
      `error_order` is set.
  enforce_stationarity : bool, optional
      Whether or not to transform the AR parameters to enforce stationarity
      in the autoregressive component of the model. Default is True.
  
  Notes
  -----
  The dynamic factor model considered here is in the so-called static form,
  and is specified:
  
  .. math::
  
      y_t & = \Lambda f_t + B x_t + u_t \\
      f_t & = A_1 f_{t-1} + \dots + A_p f_{t-p} + \eta_t \\
      u_t & = C_1 u_{t-1} + \dots + C_q u_{t-q} + \varepsilon_t
  
  where there are `k_endog` observed series and `k_factors` unobserved
  factors. Thus :math:`y_t` is a `k_endog` x 1 vector and :math:`f_t` is a
  `k_factors` x 1 vector.
  
  :math:`x_t` are optional exogenous vectors, shaped `k_exog` x 1.
  
  :math:`\eta_t` and :math:`\varepsilon_t` are white noise error terms. In
  order to identify the factors, :math:`Var(\eta_t) = I`. Denote
  :math:`Var(\varepsilon_t) \equiv \Sigma`.
  
  Options related to the unobserved factors:
  
  - `k_factors`: this is the dimension of the vector :math:`f_t`, above.
    To exclude factors completely, set `k_factors = 0`.
  - `factor_order`: this is the number of lags to include in the factor
    evolution equation, and corresponds to :math:`p`, above. To have static
    factors, set `factor_order = 0`.
  
  Options related to the observation error term :math:`u_t`:
  
  - `error_order`: the number of lags to include in the error evolution
    equation; corresponds to :math:`q`, above. To have white noise errors,
    set `error_order = 0` (this is the default).
  - `error_cov_type`: this controls the form of the covariance matrix
    :math:`\Sigma`. If it is "dscalar", then :math:`\Sigma = \sigma^2 I`. If
    it is "diagonal", then
    :math:`\Sigma = \text{diag}(\sigma_1^2, \dots, \sigma_n^2)`. If it is
    "unstructured", then :math:`\Sigma` is any valid variance / covariance
    matrix (i.e. symmetric and positive definite).
  - `error_var`: this controls whether or not the errors evolve jointly
    according to a VAR(q), or individually according to separate AR(q)
    processes. In terms of the formulation above, if `error_var = False`,
    then the matrices :math:C_i` are diagonal, otherwise they are general
    VAR matrices.
  
  References
  ----------
  .. [*] Lütkepohl, Helmut. 2007.
     New Introduction to Multiple Time Series Analysis.
     Berlin: Springer.
class_docstr_tok: ["Dynamic","factor","model","Parameters","--","--","--","--","--","endog",":","array_like","The","observed","time-series","process",":","math",":","`","y","`","exog",":","array_like",",","optional","Array","of","exogenous","regressors","for","the","observation","equation",",","shaped","nobs","x","k_exog",".","k_factors",":","int","The","number","of","unobserved","factors",".","factor_order",":","int","The","order","of","the","vector","autoregression","followed","by","the","factors",".","error_cov_type",":","{","'scalar","'",",","'diagonal","'",",","'unstructured","'","}",",","optional","The","structure","of","the","covariance","matrix","of","the","observation","error","term",",","where","``","unstructured","''","puts","no","restrictions","on","the","matrix",",","``","diagonal","''","requires","it","to","be","any","diagonal","matrix","(","uncorrelated","errors",")",",","and","``","scalar","''","requires","it","to","be","a","scalar","times","the","identity","matrix",".","Default","is","``","diagonal","''",".","error_order",":","int",",","optional","The","order","of","the","vector","autoregression","followed","by","the","observation","error","component",".","Default","is","None",",","corresponding","to","white","noise","errors",".","error_var",":","bool",",","optional","Whether","or","not","to","model","the","errors","jointly","via","a","vector","autoregression",",","rather","than","as","individual","autoregressions",".","Has","no","effect","unless","`","error_order","`","is","set",".","Default","is","False",".","enforce_stationarity",":","bool",",","optional","Whether","or","not","to","transform","the","AR","parameters","to","enforce","stationarity","in","the","autoregressive","component","of","the","model",".","Default","is","True",".","*","*","kwargs","Keyword","arguments","may","be","used","to","provide","default","values","for","state","space","matrices","or","for","Kalman","filtering","options",".","See","`","Representation","`",",","and","`","KalmanFilter","`","for","more","details",".","Attributes","--","--","--","--","--","exog",":","array_like",",","optional","Array","of","exogenous","regressors","for","the","observation","equation",",","shaped","nobs","x","k_exog",".","k_factors",":","int","The","number","of","unobserved","factors",".","factor_order",":","int","The","order","of","the","vector","autoregression","followed","by","the","factors",".","error_cov_type",":","{","'diagonal","'",",","'unstructured","'","}","The","structure","of","the","covariance","matrix","of","the","error","term",",","where","``","unstructured","''","puts","no","restrictions","on","the","matrix","and","``","diagonal","''","requires","it","to","be","a","diagonal","matrix","(","uncorrelated","errors",")",".","error_order",":","int","The","order","of","the","vector","autoregression","followed","by","the","observation","error","component",".","error_var",":","bool","Whether","or","not","to","model","the","errors","jointly","via","a","vector","autoregression",",","rather","than","as","individual","autoregressions",".","Has","no","effect","unless","`","error_order","`","is","set",".","enforce_stationarity",":","bool",",","optional","Whether","or","not","to","transform","the","AR","parameters","to","enforce","stationarity","in","the","autoregressive","component","of","the","model",".","Default","is","True",".","Notes","--","--","-","The","dynamic","factor","model","considered","here","is","in","the","so-called","static","form",",","and","is","specified",":","..","math",":",":","y_t","&","=","\\Lambda","f_t","+","B","x_t","+","u_t","\\\\","f_t","&","=","A_1","f_","{","t-1","}","+","\\dots","+","A_p","f_","{","t-p","}","+","\\eta_t","\\\\","u_t","&","=","C_1","u_","{","t-1","}","+","\\dots","+","C_q","u_","{","t-q","}","+","\\varepsilon_t","where","there","are","`","k_endog","`","observed","series","and","`","k_factors","`","unobserved","factors",".","Thus",":","math",":","`","y_t","`","is","a","`","k_endog","`","x","1","vector","and",":","math",":","`","f_t","`","is","a","`","k_factors","`","x","1","vector",".",":","math",":","`","x_t","`","are","optional","exogenous","vectors",",","shaped","`","k_exog","`","x","1.",":","math",":","`","\\eta_t","`","and",":","math",":","`","\\varepsilon_t","`","are","white","noise","error","terms",".","In","order","to","identify","the","factors",",",":","math",":","`","Var","(","\\eta_t",")","=","I","`",".","Denote",":","math",":","`","Var","(","\\varepsilon_t",")","\\equiv","\\Sigma","`",".","Options","related","to","the","unobserved","factors",":","-","`","k_factors","`",":","this","is","the","dimension","of","the","vector",":","math",":","`","f_t","`",",","above",".","To","exclude","factors","completely",",","set","`","k_factors","=","0","`",".","-","`","factor_order","`",":","this","is","the","number","of","lags","to","include","in","the","factor","evolution","equation",",","and","corresponds","to",":","math",":","`","p","`",",","above",".","To","have","static","factors",",","set","`","factor_order","=","0","`",".","Options","related","to","the","observation","error","term",":","math",":","`","u_t","`",":","-","`","error_order","`",":","the","number","of","lags","to","include","in","the","error","evolution","equation",";","corresponds","to",":","math",":","`","q","`",",","above",".","To","have","white","noise","errors",",","set","`","error_order","=","0","`","(","this","is","the","default",")",".","-","`","error_cov_type","`",":","this","controls","the","form","of","the","covariance","matrix",":","math",":","`","\\Sigma","`",".","If","it","is","``","dscalar","''",",","then",":","math",":","`","\\Sigma","=","\\sigma^2","I","`",".","If","it","is","``","diagonal","''",",","then",":","math",":","`","\\Sigma","=","\\text","{","diag","}","(","\\sigma_1^2",",","\\dots",",","\\sigma_n^2",")","`",".","If","it","is","``","unstructured","''",",","then",":","math",":","`","\\Sigma","`","is","any","valid","variance","\/","covariance","matrix","(","i.e",".","symmetric","and","positive","definite",")",".","-","`","error_var","`",":","this","controls","whether","or","not","the","errors","evolve","jointly","according","to","a","VAR","(","q",")",",","or","individually","according","to","separate","AR","(","q",")","processes",".","In","terms","of","the","formulation","above",",","if","`","error_var","=","False","`",",","then","the","matrices",":","math",":","C_i","`","are","diagonal",",","otherwise","they","are","general","VAR","matrices",".","References","--","--","--","--","--","..","[","*","]","L\u00fctkepohl",",","Helmut",".","2007",".","New","Introduction","to","Multiple","Time","Series","Analysis",".","Berlin",":","Springer","."]
code: def _initialize_loadings(self):
      # Initialize the parameters
      self.parameters["factor_loadings"] = self.k_endog * self.k_factors
  
      # Setup fixed components of state space matrices
      if self.error_order > 0:
          start = self._factor_order
          end = self._factor_order + self.k_endog
          self.ssm["design", :, start:end] = np.eye(self.k_endog)
  
      # Setup indices of state space matrices
      self._idx_loadings = np.s_["design", :, : self.k_factors]
  
imports: import numpy
  from .mlemodel import MLEModel, MLEResults, MLEResultsWrapper
  from .tools import is_invertible, prepare_exog, constrain_stationary_univariate, unconstrain_stationary_univariate, constrain_stationary_multivariate, unconstrain_stationary_multivariate
  from statsmodels.multivariate.pca import PCA
  from statsmodels.regression.linear_model import OLS
  from statsmodels.tsa.vector_ar.var_model import VAR
  from statsmodels.tsa.arima.model import ARIMA
  from statsmodels.tools.tools import Bunch
  from statsmodels.tools.data import _is_using_pandas
  from statsmodels.tsa.tsatools import lagmat
  from statsmodels.tools.decorators import cache_readonly
  import statsmodels.base.wrapper
  from statsmodels.compat.pandas import Appender
label_desc: Use image node_id 2 for calling the DynamicFactor obj's underlying member method code with example usage: obj._initialize_loadings() without return types