BNPdensity (version 2023.3.8)

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)

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ünster, and M. Ruggiero, “Are gibbs-type priors the most natural generalization of the Dirichlet process?,” IEEE Trans. Pattern Anal. Mach. Intell., vol. 37, no. 2, pp. 212–229, 2015.

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.

Examples

Run this code

expected_number_of_components_stable(100, 0.8)

Run the code above in your browser using DataLab