iddn.solver

Wrapper functions for calling the BCD algorithms used in iDDN

Functions

run_resi(g1_data, g2_data, node, dep_cur, lambda1, ...)

The wrapper that calls the iDDN residual update algorithm

run_corr(corr_matrix_1, corr_matrix_2, node, dep_cur, ...)

The wrapper that calls the iDDN correlation matrix update algorithm

Module Contents

iddn.solver.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.

Parameters:
  • g1_data (array_like, shape N1 by P) – The iddn_data from condition 1

  • g2_data (array_like, shape N2 by P) – The iddn_data from condition 2

  • node (int) – Index of the current node that serve as the response variable.

  • dep_cur – The neighbors that points to current node

  • lambda1 (array_like) – DDN parameter lambda1.

  • lambda2 (array_like) – DDN parameter lambda2.

  • beta1_in (array_like, length P) – Initial beta for condition 1. If initialization is not needed, use an array of all zeros.

  • beta2_in (array_like, length P) – Initial beta for condition 2. If initialization is not needed, use an array of all zeros.

  • threshold (float) – Convergence threshold.

Returns:

  • beta1 (ndarray, length P) – Estimated beta for node in condition 1.

  • beta2 (ndarray, length P) – Estimated beta for node in condition 2.

iddn.solver.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

Parameters:
  • corr_matrix_1 (ndarray) – Input correlation matrix for condition 1.

  • corr_matrix_2 (ndarray) – Input correlation matrix for condition 2.

  • node (int) – Index of the current node that serve as the response variable.

  • dep_cur (array_like) – The neighbors that points to current node

  • lambda1 (float) – DDN parameter lambda1.

  • lambda2 (float) – DDN parameter lambda2.

  • beta1_in (array_like, length P) – Initial beta for condition 1. If initialization is not needed, use an array of all zeros.

  • beta2_in (array_like, length P) – Initial beta for condition 2. If initialization is not needed, use an array of all zeros.

  • threshold (float) – Convergence threshold.

Returns:

  • beta1 (ndarray, length P) – Estimated beta for node in condition 1.

  • beta2 (ndarray, length P) – Estimated beta for node in condition 2.