postalphak: Full conditional for alphak

View source: R/postalphak.R

postalphakR Documentation

Full conditional for alphak

Description

Full conditional for alphak

Usage

postalphak(M, Y, sigma2, K, Tl, cluster, clusteri)

Arguments

M

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

Y

A matrix M x N with the data sequences

sigma2

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

K

A vector containing the number of change points for each cluster (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)

cluster

A vector containing the cluster assignments for 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 sampled values from the full conditional of alphak for a given cluster 'clusteri'

Note

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

See Also

[gibbs_alg()]

Examples

data(data)
postalphak(M = 50, Y = data, sigma2 = 0.05, K = c(0, 0), Tl = c(50, 50),
 cluster = c(1,1,2,1,2), clusteri = 1)


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