qn0_mk | R Documentation |
Mixing probability for creating new cluster per bin
qn0_mk(w, m0, bs, as, M, km, lambda, mk, Yn, kstar)
w |
A scalar representing the minimum number of points in each interval between two change points |
m0 |
A scalar for the number of positions available to define change-points positions |
bs |
The hyperparameter value for the scale parameter in the inverse-gamma prior for the variance component |
as |
The hyperparameter value for the shape parameter in the inverse-gamma prior for the variance component |
M |
A scalar representing the number of points available for each data sequence |
km |
A scalar for the number of changes points in a cluster |
lambda |
A scalar defining the parameter for the Truncate Poisson distribution that controls the number of change points (or its initial values) |
mk |
A matrix with all possible values to distribute between change points |
Yn |
A vector with a data sequence |
kstar |
A scalar with the number maximum of change points in all clusters |
A numerical value representing the mixing value term used to compute the probability that the given data sequence should be a singleton cluster for a given bin size.
This function is called within [qn0()]. It should not be called alone.
[qn0()], [gibbs_alg()]
data(data)
M <- 50; k <- 0; w <- 10;
m0 <- M - 1 -(k+1)*w
for(k in 0:2){
mk <- RcppAlgos::permuteGeneral(0:m0, k + 1,
constraintFun = "sum",
comparisonFun = "==", limitConstraints = m0,
repetition = TRUE)}
out <- qn0_mk(w = 10, m0 = m0, bs = 1000, as = 2, M = 50, km = 1,
lambda = 2, mk = mk[1,], Yn = data[,1], kstar = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.