postK_mk | R Documentation |
Marginal probability of K per bin
postK_mk(k, m0, w, M, Yn, sigma2n, cellsn, mk, Cr)
k |
A scalar for the number of changes points in a cluster |
m0 |
A scalar for the number of positions available to define change-points positions |
w |
A scalar representing the minimum number of points in each interval between two change points |
M |
A scalar representing the number of points available for each data sequence |
Yn |
A vector or matrix with data sequences for a cluster |
sigma2n |
A vector with the variance of the data sequences in a cluster |
cellsn |
A vector with the indices of the data sequences in a cluster |
mk |
A matrix with all possible values to distribute between change points |
Cr |
A scalar with the number of data sequences in a cluster |
'postK_mk' returns a numerical value representing the non-normalized probability for a given bin, given k, and a given cluster
This function is called within [postK()]. It should not be called alone.
[postK()], [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 <- postK_mk(k = 0, m0 = m0, w = 10, M = 50, Yn = data[,c(1,2,4)],
sigma2n = rep(0.05, 3), cellsn = c(1,2,4), mk = mk[1,], Cr = 3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.