postmk: Marginal probability of m1,m2,m3,...,mk+1

View source: R/postmk.R

postmkR Documentation

Marginal probability of m1,m2,m3,...,mk+1

Description

Marginal probability of m1,m2,m3,...,mk+1

Usage

postmk(w, M, Y, K, cluster, sigma2, clusteri)

Arguments

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

Y

A matrix M x N with the data sequences

K

A vector containing the number of change points for each cluster (or its initial values)

cluster

A vector containing the cluster assignments for the data sequences (or its initial values)

sigma2

A vector with the variances of the data sequences (or its initial values)

clusteri

A scalar with the index of a cluster

Value

A numerical vector of size k + 1 with the sampled number of observations (or bin size, mk) between each change point for a given cluster

Note

This function is called within the Gibbs sampler, but it can also be called separately.

Examples

data(data)
postmk(w = 10, M = 50, Y = data, K = c(1, 1), cluster = c(2,1,1,1,1), sigma2 = apply(data, 2, var),
clusteri = 1)


BayesCPclust documentation built on April 4, 2025, 5:19 a.m.