Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sachinsdate/71a9cc413488ef02d04bd346a32fc32a to your computer and use it in GitHub Desktop.
Save sachinsdate/71a9cc413488ef02d04bd346a32fc32a to your computer and use it in GitHub Desktop.
def reconstitute_parameter_matrices(self, params):
self.q_matrix = params[-(self.k_regimes**2):]
self.q_matrix = self.q_matrix.reshape([self.k_regimes, self.k_regimes])
self.beta_matrix = params[:-(self.k_regimes**2)]
self.beta_matrix = self.beta_matrix.reshape([self.k_regimes, self.exog.shape[1]])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment