class_docstr: "Cholesky Factor Algorithm" (CFA) simulation smoother
  
  Parameters
  ----------
  model : Representation
      The state space model.
  
  Notes
  -----
  This class allows simulation smoothing by the "Cholesky Factor Algorithm"
  (CFA) described in [1]_ and [2]_, which essentially takes advantage of the
  existence of an efficient sparse Cholesky factor algorithm for banded
  matrices that are held in a sparse matrix format.
  
  In particular, this simulation smoother computes the joint posterior mean
  and covariance matrix for the unobserved state vector all at once, rather
  than using the recursive computations of the Kalman filter and smoother. It
  then uses these posterior moments to sample directly from this joint
  posterior. For some models, it can be more computationally efficient than
  the simulation smoother based on the Kalman filter and smoother.
  
  **Important caveat**:
  
  However, this simulation smoother cannot be used with all state space
  models, including several of the most popular. In particular, the CFA
  algorithm cannot support degenerate distributions (i.e. positive
  semi-definite covariance matrices) for the initial state (which is the
  prior for the first state) or the observation or state innovations.
  
  One practical problem with this algorithm is that an autoregressive term
  with order higher than one is typically put into state space form by
  augmenting the states using identities. As identities, these augmenting
  terms will not be subject to random innovations, and so the state
  innovation will be degenerate. It is possible to take these higher order
  terms directly into account when constructing the posterior covariance
  matrix, but this has not yet been implemented.
  
  Similarly, some state space forms of SARIMA and VARMA models make
  the observation equation an identity, which is not compatible with the CFA
  simulation smoothing approach.
  
  This simulation smoother has so-far found most of its use with dynamic
  factor and stochastic volatility models, which satisfy the restrictions
  described above.
  
  **Not-yet-implemented**:
  
  There are several features that are not yet available with this simulation
  smoother:
  
  - It does not yet allow diffuse initialization of the state vector.
  - It produces simulated states only for exactly the observations in the
    model (i.e. it cannot produce simulations for a subset of the model
    observations or for observations outside the model).
  
  
  References
  ----------
  .. [1] McCausland, William J., Shirley Miller, and Denis Pelletier.
         "Simulation smoothing for state-space models: A computational
         efficiency analysis."
         Computational Statistics & Data Analysis 55, no. 1 (2011): 199-212.
  .. [2] Chan, Joshua CC, and Ivan Jeliazkov.
         "Efficient simulation and integrated likelihood estimation in
         state space models."
         International Journal of Mathematical Modelling and Numerical
         Optimisation 1, no. 1-2 (2009): 101-120.
docstr: Posterior covariance of the states conditional on the data
  
  Notes
  -----
  **Warning**: the matrix computed when accessing this property can be
  extremely large: it is shaped `(nobs * k_states, nobs * k_states)`. In
  most cases, it is better to use the `posterior_cov_inv_chol_sparse`
  property if possible, which holds in sparse diagonal banded storage
  the Cholesky factor of the inverse of the posterior covariance matrix.
  
  .. math::
  
      Var[\alpha \mid Y^n ]
  
  This posterior covariance matrix is *not* identical to the
  `smoothed_state_cov` attribute produced by the Kalman smoother, because
  it additionally contains all cross-covariance terms. Instead,
  `smoothed_state_cov` contains the `(k_states, k_states)` block
  diagonal entries of this posterior covariance matrix.
docstr_tok: ["Posterior","covariance","of","the","states","conditional","on","the","data","Notes","--","--","-","*","*","Warning","*","*",":","the","matrix","computed","when","accessing","this","property","can","be","extremely","large",":","it","is","shaped","`","(","nobs","*","k_states",",","nobs","*","k_states",")","`",".","In","most","cases",",","it","is","better","to","use","the","`","posterior_cov_inv_chol_sparse","`","property","if","possible",",","which","holds","in","sparse","diagonal","banded","storage","the","Cholesky","factor","of","the","inverse","of","the","posterior","covariance","matrix",".","..","math",":",":","Var","[","\\alpha","\\mid","Y^n","]","This","posterior","covariance","matrix","is","*","not","*","identical","to","the","`","smoothed_state_cov","`","attribute","produced","by","the","Kalman","smoother",",","because","it","additionally","contains","all","cross-covariance","terms",".","Instead",",","`","smoothed_state_cov","`","contains","the","`","(","k_states",",","k_states",")","`","block","diagonal","entries","of","this","posterior","covariance","matrix","."]
code: def posterior_cov(self):
      r"""
      Posterior covariance of the states conditional on the data
  
      Notes
      -----
      **Warning**: the matrix computed when accessing this property can be
      extremely large: it is shaped `(nobs * k_states, nobs * k_states)`. In
      most cases, it is better to use the `posterior_cov_inv_chol_sparse`
      property if possible, which holds in sparse diagonal banded storage
      the Cholesky factor of the inverse of the posterior covariance matrix.
  
      .. math::
  
          Var[\alpha \mid Y^n ]
  
      This posterior covariance matrix is *not* identical to the
      `smoothed_state_cov` attribute produced by the Kalman smoother, because
      it additionally contains all cross-covariance terms. Instead,
      `smoothed_state_cov` contains the `(k_states, k_states)` block
      diagonal entries of this posterior covariance matrix.
      """
      if self._posterior_cov is None:
          from scipy.linalg import cho_solve_banded
  
          inv_chol = self.posterior_cov_inv_chol_sparse
          self._posterior_cov = cho_solve_banded(
              (inv_chol, True), np.eye(inv_chol.shape[1])
          )
      return self._posterior_cov
  
file_path: statsmodels/statsmodels/tsa/statespace/cfa_simulation_smoother.py
imports: import numpy
  from .None import tools
label_desc: Use image node_id 5 for calling the CFASimulationSmoother obj's underlying member method code with example usage: obj.posterior_cov() and returns: self