allocate memory for fac1, fac2
allocate memory for mu_i, ni