Learn R Programming

BayesCPclust (version 0.1.0)

qnj: 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)

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

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)

See Also

[gibbs_alg()]

Examples

Run this code
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))

Run the code above in your browser using DataLab