def split_group(hyper, local): c, slope, sigma, trans = split_hyper_linear(hyper) M1 = local[n_fixm:n_fixm+n_varm] sig_like_M0 = np.zeros_like(M0) for i in range(n_pop): sig_like_M0 += sigma[i] * indicate(M0,trans,i) sig_like_M1 = np.zeros_like(M1) for i in range(n_pop): sig_like_M1 += sigma[i] * indicate(M1,trans,i) return sig_like_M0, sig_like_M1
def split_group(hyper, local): c, slope, sigma, trans = split_hyper_linear(hyper, n_pop) M1 = local + 0. sig_like_M0 = np.zeros_like(M0) for i in range(n_pop): sig_like_M0 += sigma[i] * indicate(M0,trans,i, n_pop) sig_like_M1 = np.zeros_like(M1) for i in range(n_pop): sig_like_M1 += sigma[i] * indicate(M1,trans,i, n_pop) return sig_like_M0, sig_like_M1
def split_group_complex(hyper, local): #sig_const_M0, sig_const_M1 = split_group(hyper, local) c, slope, sigma, trans = split_hyper_linear(hyper) M1 = local[n_fixm:n_fixm+n_varm] sig_M0 = np.zeros_like(M0) for i in range(n_pop): sig_M0 += sigma[i] * indicate(M0,trans,i) sig_M1 = np.zeros_like(M1) for i in range(n_pop): sig_M1 += sigma[i] * indicate(M1,trans,i) # fix the intrinsic scatter in the 2nd(0,1,2) group(degenerate group) # from constant to a straight line that smoothly goes from sigma_const_giant to sigma_const_degen sig_M0 = sig_M0 + (sigma[1]-sigma[2]) * (trans[2] - M0) / (trans[1] - trans[2]) * indicate(M0, trans, 2) sig_M1 = sig_M1 + (sigma[1]-sigma[2]) * (trans[2] - M1) / (trans[1] - trans[2]) * indicate(M1, trans, 2) return sig_M0, sig_M1
def split_group(hyper, local): c, power, sigma, trans = split_hyper(hyper) M1 = local[n_fixm:n_fixm+n_varm] sig_like_M0 = np.zeros_like(M0) for i in range(n_pop): ''' note the change here ''' ind = indicate(M0, trans, i) mu = c[i] * M0**power[i] sig_like_M0 += mu * sigma[i] * ind sig_like_M1 = np.zeros_like(M1) for i in range(n_pop): ''' same as above ''' ind = indicate(M1, trans, i) mu = c[i] * M1**power[i] sig_like_M1 += mu * sigma[i] * ind return sig_like_M0, sig_like_M1