plot_acf: Autocorrelation plot of Gibbs samples

View source: R/plot.R

plot_acfR Documentation

Autocorrelation plot of Gibbs samples

Description

This function plots the autocorrelation of the Gibbs samples. The plots include the total Gibbs sample size TSS and the effective sample size ESS, see the details.

Usage

plot_acf(gibbs_samples, par_labels)

Arguments

gibbs_samples

A matrix of Gibbs samples.

par_labels

A character vector with labels for the Gibbs samples, of length equal to the number of columns of gibbs_samples.

Details

The effective sample size is the value

TSS / √{1 + 2∑_{k≥q 1} ρ_k}

, where ρ_k is the auto correlation between the chain offset by k positions. The auto correlations are estimated via spec.ar.

Value

No return value. Draws a plot to the current device.

Examples

gibbs_samples <- matrix(arima.sim(list(order=c(1,0,0), ar = 0.5), n = 100))
RprobitB:::plot_acf(gibbs_samples, par_labels = "simulated AR(1) process")


RprobitB documentation built on Nov. 10, 2022, 5:12 p.m.