Learn R Programming

pivmet (version 0.3.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".

Examples

Run this code
# NOT RUN {
# Fishery data
# }
# NOT RUN {
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")
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab