AM_find_gamma_NegBin: Given that the prior on M is a Negative Binomial, find the \(\gamma\) hyperparameter of the weights
prior to match \(E(K)=K*\), where \(K*\) is user-specified
Description
Once the prior on the number of mixture components M is assumed to be a Negative Binomial with
parameter r>0 and 0<p<1, with mean is 1+ r*p/(1-p), this function adopts a bisection method
to find the value of gamma such that the induced distribution on the number of clusters is centered around a
user specifed value \(K^{*}\), i.e. the function uses a bisection method to solve for \(\gamma\) argiento2019infinityAntMAN.
The user can provide a lower \(\gamma_{l}\) and an upper \(\gamma_{u}\) bound for the possible values of \(\gamma\). The default values
are \(\gamma_l= 10^{-3}\) and \(\gamma_{u}=10\). A defaault value for the tolerance is \(\epsilon=0.1\). Moreover, after a
maximum number of iteration (default is 31), the function stops warning that convergence has not bee reached.