bayesmove (version 0.1.0)

traceplot: View trace-plots of output from Bayesian segmentation model

Description

Visualize trace-plots of the number of breakpoints estimated by the model as well as the log marginal likelihood (LML) for each animal ID.

Usage

traceplot(data, ngibbs, type)

Arguments

data

A data frame containing values at each iteration of the MCMC chain where each row holds data for a specific animal ID.

ngibbs

numeric. The total number of iterations of the MCMC chain.

type

character. The type of data that are being plotted from the Bayesian segmentation model results. Takes either 'nbrks' for the number of breakpoints or 'LML' for the log marginal likelihood.

Value

Trace-plots for the number of breakpoints or the log marginal likelihood are displayed for each of the animal IDs that were analyzed by the segmentation model.

Examples

Run this code
# NOT RUN {
#simulate data
ngibbs<- 1000
y<- (-1000 * 501:1500)/(-500 + 501:1500) + rnorm(ngibbs, 0, 0.1)
dat<- matrix(c(1, y), 1, 1001)
dat<- data.frame(dat)
names(dat)[1]<- "id"

#run function
traceplot(data = dat, ngibbs = ngibbs, type = "LML")

# }

Run the code above in your browser using DataLab