Computes the univariate potential scale reduction factor (PSRF) for assessing MCMC convergence across multiple chains.

PSRF(runs, burnin)

Arguments

runs

A list of numeric matrices, each representing an independent MCMC chain with dimensions samples × parameters.

burnin

Integer giving the number of initial samples to discard.

Value

PSRF() returns a numeric vector giving the PSRF for each parameter.

Details

The PSRF compares between-chain and within-chain variances to assess whether chains have mixed adequately. Values near 1 indicate convergence. This implementation follows Equation 4 of Vats & Knudson (2021), Statistical Science, doi:10.1214/20-STS812 .

See also

ESS() for assessing effective sample sizes.