Learn R Programming

telescope (version 0.2-1)

sampleK_alpha: Sample K conditional on \(\alpha\) where \(e0 = \alpha/K\).

Description

This sampling step only relies on the current partition and is independent of the current component-specific parameters, see Frühwirth-Schnatter et al (2021).

Usage

sampleK_alpha(Kp_j, Kmax, Nk_j, alpha, log_pK)

Value

A number indicating the new value of \(K\).

Arguments

Kp_j

A number; indicating the current value of \(K_+\).

Kmax

A number; indicating the maximum value of \(K\) for which the conditional posterior is evaluated.

Nk_j

A numeric vector; indicating the group sizes in the partition, i.e., the current number of observations in the filled components.

alpha

A number; indicating the value of the parameter \(\alpha\).

log_pK

A function; evaluating the log prior of \(K\).