hdp_addconparam: Add concentration parameters to a hdpState object

Description Usage Arguments Value See Also Examples

View source: R/hdp_addconparam.R

Description

Add concentration parameters to a hdpState object by specifying the shape and rate parameters of the gamma prior/s. DPs using these new concentration parameters can be added with hdp_adddp. Data is assigned via hdp_setdata. When initialised, the DP nodes are 'heldout' (not available for posterior sampling) and will need to be activated (see dp_activate). Finally, the posterior sampling process (a Gibbs sampler) is run via hdp_posterior.

Usage

1
hdp_addconparam(hdp, alphaa, alphab)

Arguments

hdp

A hdpState object

alphaa

Shape hyperparameters for the gamma priors over the DP concentration parameters.

alphab

Rate hyperparameters for the gamma priors over the DP concentration parameters.

Value

A hdpState object updated with the new concentration parameters. See hdpState-class

See Also

hdp_init, hdp_adddp, hdp_setdata, dp_activate, hdp_posterior

Examples

1
2
hdp_example <- hdp_init(c(0, 1, 1), c(1, 2, 2), rep(1, 6), rep(2, 2), rep(0.5, 2))
hdp_example <- hdp_addconparam(hdp_example, rep(1, 2), rep(1, 2))

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