Пример #1
0
def update_zeta_j_wrapper(args):
    # parse arguments
    curr_zeta_j, n_j, Y_js, lY_js, alpha, beta, xi, tau, sigma_unity = args
    prop_zeta_j = np.empty(curr_zeta_j.shape)
    # prepare placeholders for xi, tau (with same indexing as zeta)
    xxi = np.ones(curr_zeta_j.shape)
    xta = np.ones(curr_zeta_j.shape)
    xxi[~sigma_unity] = xi
    xta[~sigma_unity] = tau
    # iterate through zeta sampling
    for i in range(curr_zeta_j.shape[0]):
        if sigma_unity[i]:
            prop_zeta_j[i] = sample_alpha_1_mh_summary(
                curr_zeta_j[i],
                n_j,
                Y_js[i],
                lY_js[i],
                alpha[i],
                beta[i],
            )
        else:
            prop_zeta_j[i] = sample_alpha_k_mh_summary(
                curr_zeta_j[i],
                n_j,
                Y_js[i],
                lY_js[i],
                alpha[i],
                beta[i],
                xxi[i],
                xta[i],
            )
    return prop_zeta_j
Пример #2
0
def update_zeta_j_wrapper(args):
    # parse arguments
    curr_zeta_j, n_j, Y_js, lY_js, alpha, beta, xi, tau = args
    prop_zeta_j = np.empty(curr_zeta_j.shape)
    prop_zeta_j[0] = sample_alpha_1_mh_summary(
        curr_zeta_j[0], n_j, Y_js[0], lY_js[0], alpha[0], beta[0]
        )
    for i in range(1, curr_zeta_j.shape[0]):
        prop_zeta_j[i] = sample_alpha_k_mh_summary(
            curr_zeta_j[i], n_j, Y_js[i], lY_js[i], 
            alpha[i], beta[i], xi[i-1], tau[i-1],
            )
    return prop_zeta_j
Пример #3
0
def update_zeta_wrapper(args):
    # parse arguments
    curr_zeta, n, Ys, lYs, alpha, beta, xi, tau = args
    prop_zeta = np.empty(curr_zeta.shape)
    prop_zeta[0] = sample_alpha_1_mh_summary(
        curr_zeta[0], n, Ys[0], lYs[0], alpha, beta
        )
    for i in range(1, curr_zeta.shape[0]):
        prop_zeta[i] = sample_alpha_k_mh_summary(
            curr_zeta[i], n, Ys[i], lYs[i], 
            alpha, beta, xi, tau,
            )
    return prop_zeta
Пример #4
0
def sample_gamma_shape_wrapper(args):
    return sample_alpha_k_mh_summary(*args)
Пример #5
0
def sample_xi_wrapper(args):
    return sample_alpha_k_mh_summary(*args)