Created
November 26, 2021 11:19
-
-
Save sachinsdate/a66b24095c10ebb8bcfdcf7eb892b316 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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