code: def state_likelihood(self, beta, alpha):
          
          _, _, _, Q = self._ss_matrices(beta)
          residuals_1 = alpha[0][1:alpha[0].shape[0]]-alpha[0][0:alpha[0].shape[0]-1]
          residuals_2 = alpha[1][1:alpha[1].shape[0]]-alpha[1][0:alpha[1].shape[0]-1]
          return np.sum(ss.norm.logpdf(residuals_1,loc=0,scale=np.power(Q[0][0],0.5))) + np.sum(ss.norm.logpdf(residuals_2,loc=0,scale=np.power(Q[1][1],0.5)))
docs: Returns likelihood of the states given the variance latent variables
  
          Parameters
          ----------
          beta : np.array
              Contains untransformed starting values for latent variables
  
          alpha : np.array
              State matrix
          
          Returns
          ----------
          State likelihood