Learn R Programming

pivmet (version 0.5.0)

piv_plot: Plotting outputs from pivotal relabelling

Description

Plot and visualize MCMC outputs and posterior relabelled chains/estimates.

Usage

piv_plot(
  y,
  mcmc,
  rel_est,
  par = c("mean", "sd", "weight", "all"),
  type = c("chains", "hist")
)

Arguments

y

Data vector or matrix.

mcmc

The ouptut of the raw MCMC sampling, as provided by piv_MCMC.

rel_est

Pivotal estimates as provided by piv_rel.

par

The parameters for which estimates are displayed. Choose among: "mean", "sd", "weight" and "all".

type

Type of plots required. Choose among: "chains", "hist".

Author

Leonardo Egidi legidi@units.it

Examples

Run this code

# Fishery data
if (FALSE) {
library(bayesmix)
data(fish)
y <- fish[,1]
N <- length(y)
k <- 5
nMC <- 5000
res <- piv_MCMC(y = y, k = k, nMC = nMC)
rel <- piv_rel(mcmc=res, nMC = nMC)
piv_plot(y, res, rel, "chains")
piv_plot(y, res, rel, "estimates")
piv_plot(y, res, rel, "hist")
}

Run the code above in your browser using DataLab