possigma2n: Full conditional function for sigma2

View source: R/possigma2n.R

possigma2nR Documentation

Full conditional function for sigma2

Description

Full conditional function for sigma2

Usage

possigma2n(as, bs, M, Yn, k, Tln, alphan)

Arguments

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

M

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

Yn

A vector or matrix with data sequences for a cluster

k

A scalar for the number of changes points in a cluster

Tln

A vector with the change-point positions for a cluster

alphan

A vector with the constant level values for each interval between change points for a cluster

Value

A numerical value corresponding to a sampled value from the full conditional of the variance component

Note

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

See Also

[gibbs_alg()]

Examples

data(data)
possigma2n(as = 2, bs = 1000, M = 50, Yn = data[,1], k = 0, Tln = 50, alphan = 15)


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