View source: R/class_generic.R
BNPdens | R Documentation |
A constructor for the BNPdens
class. The class BNPdens
is a named list containing
the output generated by a specified Bayesian nonparametric mixture model implemented by means of
a specified MCMC strategy, as in PYdensity
, DDPdensity
, and PYregression
.
BNPdens( density = NULL, data = NULL, grideval = NULL, grid_x = NULL, grid_y = NULL, clust = NULL, mean = NULL, beta = NULL, sigma2 = NULL, probs = NULL, niter = NULL, nburn = NULL, tot_time = NULL, univariate = TRUE, regression = FALSE, dep = FALSE, group_log = NULL, group = NULL, wvals = NULL )
density |
a matrix containing the values taken by the density at the grid points; |
data |
a dataset; |
grideval |
a set of values where to evaluate the density; |
grid_x |
regression grid, independent variable; |
grid_y |
regression grid, dependent variable; |
clust |
a ( |
mean |
values for the location parameters; |
beta |
coefficients for regression model (only for |
sigma2 |
values of the scale parameters; |
probs |
values for the mixture weights; |
niter |
number of MCMC iterations; |
nburn |
number of MCMC iterations to discard as burn-in; |
tot_time |
total execution time; |
univariate |
logical, |
regression |
logical, |
dep |
logical, |
group_log |
group allocation for each iteration (only for |
group |
vector, allocation of observations to strata (only for |
wvals |
values of the processes weights (only for |
data_toy <- c(rnorm(100, -3, 1), rnorm(100, 3, 1)) grid <- seq(-7, 7, length.out = 50) est_model <- PYdensity(y = data_toy, mcmc = list(niter = 100, nburn = 10, nupd = 100), output = list(grid = grid)) str(est_model) class(est_model)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.