hdp_quick_init: Initialise a simple, default HDP structure

Description Usage Arguments Value See Also Examples

View source: R/hdp_quick_init.R

Description

Initialise a hdpState object with a basic default structure of one top parent DP node with no associated data, and one child DP node per row of data. Every DP node shares the same concentration parameter, and will automatically be 'activated' (made available for posterior samplig). The base distribution is a uniform Dirichlet with psuedocount 1 in each data category. Can immediately run hdp_posterior to collect posterior samples. To define a custom HDP structure, see hdp_init and hdp_prior_init.

Usage

1
hdp_quick_init(data, initcc = 2, alphaa = 1, alphab = 1)

Arguments

data

A data.frame or matrix of counts with one row for every sample and one column for every data category.

initcc

Number of initial data clusters (every data item is randomly assigned to a cluster to start with).

alphaa

Shape hyperparameter for the gamma prior over the concentration parameter.

alphab

Rate hyperparameter for the gamma prior over the concentration parameter.

Value

A hdpState object with a basic default structure. See hdpState-class

See Also

hdp_init, hdp_posterior, hdp_prior_init

Examples

1
2
my_quick_hdp <- hdp_quick_init(example_data_hdp)
my_quick_hdp_chain <- hdp_posterior(my_quick_hdp, 100, 50, 10, 5)

nicolaroberts/hdp documentation built on May 23, 2019, 5:09 p.m.