update_lambda: Update equation for lambda

View source: R/update_lambda.R

update_lambdaR Documentation

Update equation for lambda

Description

Update equation for lambda

Usage

update_lambda(a = 4, b = 2, kstar, lambda, cluster, al, bl, K, N)

Arguments

a

The hyperparameter value for the shape parameter in the gamma prior for alpha0

b

The hyperparameter value for the scale parameter in the gamma prior for alpha0

kstar

A scalar with the number maximum of change points in all clusters

lambda

A scalar defining the parameter for the Truncate Poisson distribution that controls the number of change points (or its initial values)

cluster

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

al

The hyperparameter value for the shape parameter in the gamma prior for lambda

bl

The hyperparameter value for the scale parameter in the gamma prior for lambda

K

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

N

A scalar representing the number of data sequences

Value

A numerical value corresponding to a sample from the posterior of the parameter lambda

Note

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

See Also

[gibbs_alg()]

Examples

update_lambda(a = 4, b = 2, kstar = 2, lambda = 2, cluster = c(1,1,2,1,2),
 al = 2, bl = 1000, K = c(2,2), N = 5)


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