class_docstr: Inherits time series methods from TSM class.
  
  **** DYNAMIC AUTOREGRESSIVE MODEL ****
  
  Parameters
  ----------
  
  ar : int
      Number of autoregressive lags
  
  data : pd.DataFrame
      Field to specify the data that will be used
class_docstr_tok: ["Inherits","time","series","methods","from","TSM","class",".","*","*","*","*","DYNAMIC","AUTOREGRESSIVE","MODEL","*","*","*","*","Parameters","--","--","--","--","--","ar",":","int","Number","of","autoregressive","lags","data",":","pd.DataFrame","Field","to","specify","the","data","that","will","be","used"]
docstr: Koopman's simulation smoother - simulates from states given
  model parameters and observations
  
  Parameters
  ----------
  
  beta : np.array
      Contains untransformed starting values for latent variables
  
  Returns
  ----------
  - A simulated state evolution
docstr_tok: ["Koopman","'s","simulation","smoother","-","simulates","from","states","given","model","parameters","and","observations","Parameters","--","--","--","--","--","beta",":","np.array","Contains","untransformed","starting","values","for","latent","variables","Returns","--","--","--","--","--","-","A","simulated","state","evolution"]
code: def simulation_smoother(self, beta):
      """Koopman's simulation smoother - simulates from states given
      model parameters and observations
  
      Parameters
      ----------
  
      beta : np.array
          Contains untransformed starting values for latent variables
  
      Returns
      ----------
      - A simulated state evolution
      """
  
      T, Z, R, Q, H = self._ss_matrices(beta)
  
      # Generate e_t+ and n_t+
      rnd_h = np.random.normal(0, np.sqrt(H), self.data.shape[0] + 1)
      q_dist = ss.multivariate_normal([0.0, 0.0], Q)
      rnd_q = q_dist.rvs(self.data.shape[0] + 1)
  
      # Generate a_t+ and y_t+
      a_plus = np.zeros((T.shape[0], self.data.shape[0] + 1))
      a_plus[0, 0] = np.mean(self.data[0:5])
      y_plus = np.zeros(self.data.shape[0])
  
      for t in range(0, self.data.shape[0] + 1):
          if t == 0:
              a_plus[:, t] = np.dot(T, a_plus[:, t]) + rnd_q[t, :]
              y_plus[t] = np.dot(Z, a_plus[:, t]) + rnd_h[t]
          else:
              if t != self.data.shape[0]:
                  a_plus[:, t] = (
                      np.dot(T, a_plus[:, t - 1]) + rnd_q[t, :]
                  )
                  y_plus[t] = np.dot(Z, a_plus[:, t]) + rnd_h[t]
  
      alpha_hat, _ = self.smoothed_state(self.data, beta)
      alpha_hat_plus, _ = self.smoothed_state(y_plus, beta)
      alpha_tilde = alpha_hat - alpha_hat_plus + a_plus
  
      return alpha_tilde
  
imports: import copy
  import sys
  import numpy
  import pandas
  import scipy.stats
  from patsy import dmatrices, dmatrix, demo_data
  from ..None import families
  from ..None import tsm
  from ..None import data_check
  from .kalman import *
label_desc: Use image node_id 13 for calling the DAR obj's underlying member method code with example usage: obj.simulation_smoother(beta) and returns: alpha_tilde