Learn R Programming

FVDDPpkg (version 0.1.2)

prune: Reduce the size of Fleming-Viot Dependent Dirichlet Processes

Description

Reduce the size of Fleming-Viot Dependent Dirichlet Processes

Usage

prune(fvddp, eps)

Value

An fvddp list of smaller size of the input. Precisely, the components whose weight goes below the treshold eps will be removed: the vector w and the matrix M will have a lower amount of rows; if the latter will include all-zero columns, they will be removed.

Arguments

fvddp

An object of class fvddp, generated via initialize().

eps

The value behold which the weights are removed, with their components of the mixture. eps has to be in the interval (0,1).

References

AscolaniLijoiRuggiero2023FVDDPpkg

Examples

Run this code
#create a large process
FVDDP = initialize(3, function(x) rexp(x, 4),
                   function(x) dexp(x, 4), FALSE)
FVDDP = update(FVDDP, c(rep(rexp(1, 3), 7), rep(rexp(1, 5), 5), rexp(1, 7), 3))
FVDDP = propagate(FVDDP, 1)
prune(fvddp = FVDDP, eps = 1e-4)

Run the code above in your browser using DataLab