AM_find_gamma_NegBin: Once the prior on the numbuer of mixture $M$ is assumed to be...

Description Usage Arguments Value Examples

Description

Once the prior on the numbuer of mixture $M$ is assumed to be a Negative Binomial Negative Binomial with parameter r>0 and 0<p<1, with mean is 1+ r*p/(1-p), this function adopt a bisection method to find the value of gamma such that the induced distribution on the number of clusers is centered around a user specifed value K^*, i.e. the function use a bisection method to solve Eq.~eq:findgamma of WE NEED TO CITE ANTMAN PAPER. The user can provide a lower γ_{l} and an upper γ_{u} bound for the possible values of $gamma$. The default values are γ_l= 10^{-3} and γ_{u}=10. A defaault value for the tolerance is ε=0.1. Moreover, after a maximum number of iteration (default is 31), the function stops warning that convergence has not bee reached.

Usage

1
2
AM_find_gamma_NegBin(n, r, p, Kstar = 6, gam_min = 0.001,
  gam_max = 10000, tolerance = 0.1)

Arguments

n

The sample size

r

The dispersion parameter r of Negative Binomial

p

The probability of failure parameter p of Negative Binomial

Kstar

The mean number of cluster the user want to specify

gam_min

The lower bound of the interval in which gamma should be lie

gam_max

The upper bound of the interval in which gamma should lie

tolerance

tolerance of the method

Value

A value of gamma such that E(K)=K^*

Examples

1
2
3
4
5
6
n <- 82
r <- 1
p <- 0.8571
gam_nb= AM_find_gamma_NegBin(n,r,p,Kstar=6, gam_min=0.001,gam_max=10000, tolerance=0.1)
prior_K_nb= AM_prior_K_NegBin(n,gam_nb, r, p)
prior_K_nb%*%1:n

AntMAN documentation built on Oct. 30, 2019, 11:24 a.m.