iddn.solver =========== .. py:module:: iddn.solver .. autoapi-nested-parse:: Wrapper functions for calling the BCD algorithms used in iDDN Functions --------- .. autoapisummary:: iddn.solver.run_resi iddn.solver.run_corr Module Contents --------------- .. py:function:: run_resi(g1_data, g2_data, node, dep_cur, lambda1, lambda2, beta1_in, beta2_in, threshold) The wrapper that calls the iDDN residual update algorithm Denote P be the number features. N1 be the sample size for condition 1, and N2 for condition 2. :param g1_data: The iddn_data from condition 1 :type g1_data: array_like, shape N1 by P :param g2_data: The iddn_data from condition 2 :type g2_data: array_like, shape N2 by P :param node: Index of the current node that serve as the response variable. :type node: int :param dep_cur: The neighbors that points to current node :type dep_cur: (P) array_like :param lambda1: DDN parameter lambda1. :type lambda1: array_like :param lambda2: DDN parameter lambda2. :type lambda2: array_like :param beta1_in: Initial beta for condition 1. If initialization is not needed, use an array of all zeros. :type beta1_in: array_like, length P :param beta2_in: Initial beta for condition 2. If initialization is not needed, use an array of all zeros. :type beta2_in: array_like, length P :param threshold: Convergence threshold. :type threshold: float :returns: * **beta1** (*ndarray, length P*) -- Estimated beta for `node` in condition 1. * **beta2** (*ndarray, length P*) -- Estimated beta for `node` in condition 2. .. py:function:: run_corr(corr_matrix_1, corr_matrix_2, node, dep_cur, lambda1, lambda2, beta1_in, beta2_in, threshold) The wrapper that calls the iDDN correlation matrix update algorithm :param corr_matrix_1: Input correlation matrix for condition 1. :type corr_matrix_1: ndarray :param corr_matrix_2: Input correlation matrix for condition 2. :type corr_matrix_2: ndarray :param node: Index of the current node that serve as the response variable. :type node: int :param dep_cur: The neighbors that points to current node :type dep_cur: array_like :param lambda1: DDN parameter lambda1. :type lambda1: float :param lambda2: DDN parameter lambda2. :type lambda2: float :param beta1_in: Initial beta for condition 1. If initialization is not needed, use an array of all zeros. :type beta1_in: array_like, length P :param beta2_in: Initial beta for condition 2. If initialization is not needed, use an array of all zeros. :type beta2_in: array_like, length P :param threshold: Convergence threshold. :type threshold: float :returns: * **beta1** (*ndarray, length P*) -- Estimated beta for `node` in condition 1. * **beta2** (*ndarray, length P*) -- Estimated beta for `node` in condition 2.