dmm.benchmark.JConjugateModel: To get MCMC computation times

Description Usage Arguments Details Value

View source: R/dmm_benchmark.R

Description

This function is the same as dmm.cluster except instead of returning the states it returns the time it took to do preprocessing computations, the MCMC computation, and the postprocessing computations. Currently avaible for testing purposes.

Usage

1
2
3
4
## S3 method for class 'JConjugateModel'
dmm.benchmark(model, Xdata, alpha = 1,
  m_prior = 3, m_post = 3, iters = 5000, burnin = 200,
  shuffled = TRUE)

Arguments

model

An object returned by dmm.model().

Xdata

A 1D array of length N (univariate case) or 2D array of size N-by-d (mulitvariate case), where d is the dimensionailty of the data and N is the number of observations.

alpha

A float. The concentration parameter. Default is 1.0.

m_prior

An integer. Optionally paramter only used in non-conjugate case. Default is 3.

m_post

An integer. Optionally paramter only used in non-conjugate case. Default is 3.

iters

An integer. Number of iterations. Default is 5000.

burnin

An integer. Amount of burn-in. Default is 200.

shuffled

A logical. Whether or not to shuffle the data. Default is true.

Details

Performs iters iterations of Algorithm 2 (in conjugate case) or Algorithm 8 (in non-conjugate case) from Neal(2000) to generate possible clusters for the data in Xdata, using the model in model, with concentration parameter alpha. In the 1D case, Xdata is assumed to be a 1D array of floats. In the 2D case, Xdata is assumed to be a dxN array of floats, where the data is d-dimensional and N is the number of datapoints. Returns a dataframe of the time it took to do preprocessing computations, the MCMC computation, and the postprocessing computations.

Value

A dataframe of the time in seconds it took to do preprocessing computations, the MCMC computation, and the postprocessing computations.


nsdumont/jDirichletMixtureModels documentation built on May 23, 2019, 2:51 p.m.