BNPdensity (version 2019.9.11)

expected_number_of_components_stable: Computes the expected number of components for a stable process.

Description

Computes the expected number of components for a stable process.

Usage

expected_number_of_components_stable(n, Gama, ntrunc = NULL)

Arguments

n

Number of data points

Gama

Numeric constant. 0 <= Gama <=1.

ntrunc

Level of truncation when computing the expectation. Defaults to n. If greater than n, it is fixed to n.

Value

A real value of type mpfr1 which approximates the expected number of components

In spite of the high precision arithmetic packages used for in function, it can be numerically unstable for small values of Gama. This is because evaluating a sum with alternated signs, in the generalized factorial coefficients, is tricky. Reference: P. De Blasi, S. Favaro, A. Lijoi, R. H. Mena, I. Pr<U+00FC>nster, and M. Ruggiero, <U+201C>Are gibbs-type priors the most natural generalization of the Dirichlet process?,<U+201D> IEEE Trans. Pattern Anal. Mach. Intell., vol. 37, no. 2, pp. 212<U+2013>229, 2015.

Examples

Run this code
# NOT RUN {
expected_number_of_components_stable(100, 0.8)
# }

Run the code above in your browser using DataCamp Workspace