TARGET DELTA EQUATION for univariate  with mixture normals
and
myzero1mix: bisection method to solve for delta1 for mixture normal,
mydelta1bisemix: bisection method to solve delta 1 for mix normal and univariate
correct myzero1 to myzero1mix
temperooryly export those functions
1. change deltabi.f to fit single intercept shift for univariate /bivariate case (single normal)
2. add for mixture normal for univariate case
3. add R wrap function using HMC sampling method.
finished BiBayesMix first version; for test
correct n,
using MH whole vector version, without tuning, but mixing too bad. not moving at all.
try separate update next version
1. correct LLBiMix (important)
2. add loglikeo before updating theta
3. new transition prob for omega1c, omega2c
add tuning, inflate by 1.5 and deflate by 0.75 for every 100
1. set K from prior
2. set tuneinit = 0.1
3. (important) update beta2spc from fixed value to check MCMC, and from priors
4. add plot of beta2sp and betay in plot function
1. (important) correct update G1, G2 in mydelta2...
2. restore beta2sp ~ rnorm( beta2pm, beta2pv)
1. (important) change prior mupv = 0.1 from 1; to make it spike at 0
2. (important) correct domega for general K
3. (important) correct gamma prior for sigma (scale instead of rate)
4. add mu, sigma, omega save and plot
1. add multinomial random draw
1. normalized prob in rcat function
2. updateg function in fortran
3. replace NA with 0 in R function to pass to fortran
4. use updateg1g2 fortran function in R, decrease 1/3 the time
0. (important) BiBayes.R single normal Bayesian approach
1. sigmaa/b instead of a,b
2. alpha1/2 instead of c,d
3. beta1, beta2(sp), sigma1 change to 1 dimension
4. sigma21sp and betaysp fixed at 0
5. add corresponding summary, output and plot
6. modified deltabi.f also. which may affect QRMissingBi.R (freq approach)
1. make tuneinit into prior
2. (important) update the whole parameter vector together
(parametrization)
1. mupm, mupv into prior
2. add tune parameters into prior (including dl as tuneomega)
3. start mu at 0
1. [important] first correct QRMissingBi.R for single beta1 , etc
2. beta1 -> 1 dim, sigma1 -> 1 dim, beta2sp = 0;
   sigma21 -> 1 dim; betaysp = 0, sigma21sp = 0
3. dim(param) = 2q+5 instead of 3q + 5;
   order change to (gamma1(q), gamma2(q), beta1(1), sigma1(1), betay,
   sigma2, logit(p))
4. change correspdonding ll2, residuals function
fix mu1 = mu2 = 0; only scaled mixture of normals
1. (important) add QRMissingBiMixMle.R for mixture of scaled normal method by MLE
2. re-define ll2Mix