Description Usage Arguments Value See Also Examples
Assign data to 'heldout' (state is 0) DP nodes in a hdpState object.
'Heldout' DPs are not available for posterior sampling,
and will need to be activated (see dp_activate
). The posterior
sampling process (a Gibbs sampler) is run via hdp_posterior
.
1 | hdp_setdata(hdp, dpindex, data)
|
hdp |
A hdpState object |
dpindex |
Indices of the DPs to assign data to (in same order as rows of |
data |
A |
A hdpState object updated with the new data. See hdpState-class
hdp_init
, hdp_adddp
,
dp_activate
, hdp_posterior
1 2 3 4 5 6 | example_data_hdp
my_hdp <- hdp_init(ppindex=0, cpindex=1, hh=rep(1, 6), alphaa=rep(1, 3), alphab=rep(2, 3))
my_hdp <- hdp_adddp(my_hdp, 2, 1, 2)
my_hdp <- hdp_adddp(my_hdp, 10, c(rep(2, 5), rep(3, 5)), 3)
my_hdp <- hdp_setdata(my_hdp, 4:13, example_data_hdp)
dp(my_hdp)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.