def mc_mom()

in mc/mc.py [0:0]


def mc_mom(n_jd_P, y_sum_jd_P, n_ji_V, y_sum_ji_V=None):
    """"Misclassification correction via mothod of moments.

    See paper:
       Selén, Jan. “Adjusting for Errors in Classification and Measurement in
       the Analysis of Partly and Purely Categorical Data.” Journal of the
       American Statistical Association, vol. 81, no. 393, 1986, pp. 75–81.
       JSTOR, www.jstor.org/stable/2287969. Accessed 10 Aug. 2020.

    We use m for the number of subgroups.

    Args:
        n_jd_P: a (m,) array of counts in the primary by misclassified groups.
        y_sum_jd_P: a (m,) array of sum(y) in the primary dataset by
            misclassified groups.
        n_ji_V: a (m, m) array of counts in the validation data with rows
            for for misclassified and columns for true groups.
        y_sum_ji_V: a (m, m)array of sum(y) in the validation data with rows
            for for misclassified and columns for true groups. If None, the
            `validation` and `with_y_V` estimates will be NaN.
    Returns:
        pd.DataFrame with the following estimates of the per group mean:
            naive: the naive estimates using the misclassified groups.
            validation: estimates using just the validation data.
            no_y_V: estiamtes with both datasets but without using the `y` value
                in the validation data.
            with_y_V: estimates using all data, including the y value in the
                validation data.