Skip to contents

The gamma completely random measure has Levy intensity nu(du, dx) = alpha P0(dx) u^-1 exp(-u / tau) du, so its Laplace exponent is psi(lam) = alpha log(1 + lam tau) and its expected total mass is alpha tau. Normalizing by the total mass gives DP(alpha, P0); because normalizing divides out the scale, the resulting law does not depend on tau at all.

Usage

Ngppr(y, alpha = 1, tau = 1)

Arguments

y

Observed values; n and the number of distinct values are read off them.

alpha

Concentration parameter, positive.

tau

Scale of the gamma CRM, positive.

Value

List with estimate, e_k, e_k_digamma, var_k, k_observed, total_mass, psi1, alpha, tau, n.

Details

Formula: \(E[K_n] = sum_i alpha / (alpha + i - 1) = alpha (digamma(alpha + n) - digamma(alpha))\) and Var[K_n] = sum_i alpha (i - 1) / (alpha + i - 1)^2. Both expressions for the mean are computed, so each checks the other.

References

Lijoi, A. & Prunster, I. (2010). Models beyond the Dirichlet process. In Bayesian Nonparametrics, 80-136. Cambridge University Press. Ferguson, T. S. (1973). A Bayesian analysis of some nonparametric problems. Annals of Statistics, 1(2), 209-230.

Examples

V <- c(1, 2, 3, 4, 5, 6, 7, 8)
Ngppr(V)
#> $estimate
#> [1] 2.717857
#> 
#> $e_k
#> [1] 2.717857
#> 
#> $e_k_digamma
#> [1] 2.717857
#> 
#> $var_k
#> [1] 1.190435
#> 
#> $k_observed
#> [1] 8
#> 
#> $total_mass
#> [1] 1
#> 
#> $psi1
#> [1] 0.6931472
#> 
#> $alpha
#> [1] 1
#> 
#> $tau
#> [1] 1
#> 
#> $n
#> [1] 8
#> 
#> $method
#> [1] "Normalized gamma process (Dirichlet process) prior"
#> 
#> attr(,"class")
#> [1] "morie_rich_result" "list"