lineage.HMM.E_step ================== .. py:module:: lineage.HMM.E_step Functions --------- .. autoapisummary:: lineage.HMM.E_step.get_MSD lineage.HMM.E_step.get_beta_and_NF lineage.HMM.E_step.get_gamma Module Contents --------------- .. py:function:: get_MSD(tree, pi, T) Marginal State Distribution (MSD) matrix by upward recursion. This is the probability that a hidden state variable :math:`z_n` is of state k, that is, each value in the N by K MSD array for each lineage is the probability :math:`P(z_n = k)`, for all :math:`z_n` in the hidden state tree and for all k in the total number of discrete states. Each MSD array is an N by K array (an entry for each cell and an entry for each state), and each lineage has its own MSD array. Every element in MSD matrix is essentially sum over all transitions from any state to state j (from parent to daughter): :math:`P(z_u = k) = \sum_j(Transition(j -> k) * P(parent_{cell_u}) = j)` :param tree: CSR array representing the lineage tree adjacency :param pi: Initial probabilities vector :param T: State transitions matrix :return: The marginal state distribution .. py:function:: get_beta_and_NF(leaves_idx, tree, T, MSD, EL) Normalizing factor (NF) matrix and base case at the leaves. Each element in this N by 1 matrix is the normalizing factor for each beta value calculation for each node. This normalizing factor is essentially the marginal observation distribution for a node. :param leaves_idx: array of indices corresponding to leaf cells :param tree: CSR array representing the lineage tree adjacency :param T: Transition probability matrix :param MSD: The marginal state distribution P(z_n = k) :param EL: The emissions likelihood :return: normalizing factor. The marginal observation distribution P(x_n = x) :return: beta values. The conditional probability of states, given observations of the sub-tree rooted in cell_n .. py:function:: get_gamma(tree, T, MSD, beta) Get the gammas using downward recursion from the root nodes. The conditional probability of states, given observation of the whole tree P(z_n = k | X_bar = x_bar) x_bar is the observations for the whole tree. :param tree: CSR array representing the lineage tree adjacency :param T: State transitions matrix :param MSD: The marginal state distribution P(z_n = k) :param beta: beta values. The conditional probability of states, given observations of the sub-tree rooted in cell_n