lnm_sampler | R Documentation |
This samples from the posterior predictive of a fitted logistic-normal multinomial model.
lnm_sampler(fit, newdata = NULL, indices = NULL, ...)
fit |
The fitted LNM model from which to draw posterior predictive samples. |
newdata |
A data.frame containing new inputs from which to sample responses. If NULL, defaults to the data used to estimate fit. |
indices |
The coordinates of the response from which to draw samples. |
... |
Additional parameters passed to sample. |
y_star A data.frame of samples y associated wtih the new inputs.
m <- lnm_model()
mat <- data.frame(matrix(rpois(250, 10), 25, 10))
colnames(mat) <- paste0("y", 1:6)
fit <- estimator(m)(y1 + y2 + y3 + y4 ~ y5 + y6, mat)
lnm_sampler(fit, depth = 10)
lnm_sampler(fit, depth = 100)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.