qnj: Mixing probability for getting assigned to an existing...

View source: R/qnj.R

qnjR Documentation

Mixing probability for getting assigned to an existing cluster

Description

Mixing probability for getting assigned to an existing cluster

Usage

qnj(N, M, as, bs, Yn, alpha, cluster, Tl, K)

Arguments

N

A scalar representing the number of data sequences

M

A scalar representing the number of points available for each data sequence

as

The hyperparameter value for the shape parameter in the inverse-gamma prior for the variance component

bs

The hyperparameter value for the scale parameter in the inverse-gamma prior for the variance component

Yn

A vector or matrix with data sequences for a cluster

alpha

A list containing a vector for each cluster determining the constant level values for each interval between change points in each cluster (or its initial values)

cluster

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

Tl

A list containing a vector for each cluster determining the change-point positions in each cluster (or its initial values)

K

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

Value

A vector of same size as the vector 'cluster' corresponding to the mixing term value used to compute the probability that the given data sequence 'Yn' should be part of each existing cluster

Note

This function is called within the Gibbs sampler. It should not be called alone.

See Also

[gibbs_alg()]

Examples

qnj(N = 5, M = 50, as = 2, bs = 1000, Yn = data[,1], alpha = c(10, 10),
 cluster = c(1,1,2,1,2), Tl = c(50,50), K = c(0,0))


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