Learn R Programming

FVDDPpkg (version 0.1.2)

initialize: Initialize Fleming-Viot dependent Dirichlet Processes by setting hyperparameters

Description

Initialize Fleming-Viot dependent Dirichlet Processes by setting hyperparameters

Usage

initialize(theta, sampling.f, density.f, atomic)

Value

A list containing the input (renamed as theta, P0.sample, P0.density, and is.atomic) and three empty slots that will contain the information once the FVDDP is updated with data. In particular, they are:

  • y.star: a vector of unique values

  • M: a matrix of multiplicities, represented as row vectors

  • w: a vector of weights associated to each row of the matrix of multiplicities. Such list repesents a n object of the fvddp class.

Arguments

theta

The intensity of the centering measure, in the sense of Bayesian Nonparametrics.

sampling.f

A function to sample from the centering. Its unique argument must be the amount of values to be drawn.

density.f

A function to compute the value of the density function or mass function of the centering. It has to be consistent with sampling.f.

atomic

A boolean value stating whether the centering is atomic or not.

References

PapaspiliopoulosRuggiero2014FVDDPpkgPapaspiliopoulosRuggieroSpanò2016FVDDPpkg

Examples

Run this code
#initiization with an atomic measure (Pois(3))
initialize(theta = 1, sampling.f = function(x) rpois(x, 3),
           density.f = function(x) dpois(x, 3), atomic = TRUE)

#initialization with a non-atomic measure (N(-1, 3))
initialize(theta = 3, sampling.f = function(x) rnorm(x, -1, 3),
           density.f = function(x) dnorm(x, -1, 3), atomic = FALSE)

Run the code above in your browser using DataLab