initiate_univ: Initiate the values for MCMC (UNIVARIATE)

Description Usage Arguments Value Examples

Description

...

Usage

1
initiate_univ(y, k, init.method = c("Kmeans", "uniform"))

Arguments

y

data, as a vector

k

Number of groups in model

init.method

Method for choosing initial annotations, "Kmeans" fits a k component Kmeans to the data, while "uniform" spreads k groups evenly across the range of the data.

Value

List of values needed to start MCMC. The first element is a tibble containing mu0, sig0, and p0. The second, a vector of integers containing the allocations init.Z.

Examples

1
2
3
4
 y <- rnorm(10,1, 10)
 initiate_univ(y, k=2, init.method="uniform")
 initiate_univ(y, k=5, init.method="uniform")
 initiate_univ(y, k=5, init.method="Kmeans")

zoevanhavre/ZDev documentation built on May 4, 2019, 11:24 p.m.