pp_check.walker_fit: Posterior predictive check for walker object

View source: R/pp_check.R

pp_check.walker_fitR Documentation

Posterior predictive check for walker object

Description

Plots sample quantiles from posterior predictive sample.

Usage

## S3 method for class 'walker_fit'
pp_check(object, ...)

Arguments

object

An output from walker.

...

Further parameters to ppc_ribbon.

Details

For other types of posterior predictive checks for example with bayesplot, you can extract the variable yrep from the output, see examples.#'

Examples

## Not run: 
# Extracting the yrep variable for general use:
# extract yrep
y_rep <- extract(object$stanfit, pars = "y_rep", permuted = TRUE)$y_rep

# For non-gaussian model:
weights <- extract(object$stanfit, pars = "weights", permuted = TRUE)$weights
y_rep <- y_rep[sample(1:nrow(y_rep), 
  size = nrow(y_rep), replace = TRUE, prob = weights), , drop = FALSE]

## End(Not run)


walker documentation built on Sept. 11, 2023, 5:10 p.m.