BNPdens2coda.BNPdens {BNPmix}R Documentation

Export to coda interface

Description

The method BNPdens2coda converts a BNPdens object into a coda mcmc object.

Usage

## S3 method for class 'BNPdens'
BNPdens2coda(object, dens = FALSE)

Arguments

object

a BNPdens object;

dens

logical, it can be TRUE only for models estimated with PYdensity. If TRUE, it converts to coda also the estimated density. Default FALSE.

Value

an mcmc object

Examples

data_toy <- cbind(c(rnorm(100, -3, 1), rnorm(100, 3, 1)),
                  c(rnorm(100, -3, 1), rnorm(100, 3, 1)))
grid <- expand.grid(seq(-7, 7, length.out = 50),
                    seq(-7, 7, length.out = 50))
est_model <- PYdensity(y = data_toy, mcmc = list(niter = 200, nburn = 100),
                       output = list(grid = grid))
coda_mcmc <- BNPdens2coda(est_model)
class(coda_mcmc)


[Package BNPmix version 1.0.2 Index]