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/a66b24095c10ebb8bcfdcf7eb892b316 to your computer and use it in GitHub Desktop.
Save sachinsdate/a66b24095c10ebb8bcfdcf7eb892b316 to your computer and use it in GitHub Desktop.
def compute_regime_specific_poisson_means(self):
self.mu_matrix = []
for j in range(self.k_regimes):
#Fetch the regression coefficients vector corresponding to the jth regime
beta_j = self.beta_matrix[j]
#Compute the Poisson mean mu as a dot product of X and Beta
mu_j = np.exp(self.exog.dot(beta_j))
if len(self.mu_matrix) == 0:
self.mu_matrix = mu_j
else:
self.mu_matrix = np.vstack((self.mu_matrix,mu_j))
self.mu_matrix = self.mu_matrix.transpose()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment