estimate_clusters {SANple} | R Documentation |
Estimate observational and distributional clusters
Description
Given the MCMC output, estimate the observational and distributional partitions using salso::salso()
.
Usage
estimate_clusters(object, burnin = 0, ncores = 0)
Arguments
object |
object of class |
burnin |
the length of the burn-in to be discarded before estimating the clusters (default is 2/3 of the iterations). |
ncores |
the number of CPU cores to use, i.e., the number of simultaneous runs at any given time. A value of zero indicates to use all cores on the system. |
Value
Object of class SANclusters
. The object contains:
est_oc
estimated partition at the observational level. It is an object of class salso.estimate
.
est_dc
estimated partition at the distributional level. It is an object of class salso.estimate
.
clus_means
cluster-specific sample means of the estimated partition.
clus_vars
cluster-specific sample variances of the estimated partition.
See Also
salso::salso()
, print.SANmcmc
, plot.SANmcmc
, print.SANclusters
Examples
set.seed(123)
y <- c(rnorm(40,0,0.3), rnorm(20,5,0.3))
g <- c(rep(1,30), rep(2, 30))
out <- sample_fiSAN(nrep = 500, burn = 200,
y = y, group = g,
nclus_start = 2,
maxK = 20, maxL = 20,
beta = 1)
estimate_clusters(out)