Learn R Programming

ctsem (version 2.1.0)

plot.ctStanFit: plot.ctStanFit

Description

Plots for ctStanFit objects

Usage

"plot"(x, types = "all", wait = TRUE, ...)

Arguments

x
Fit object from ctStanFit.
types
Vector of character strings defining which plots to create. 'all' plots all possible types, including: 'regression', 'kalman', 'priorcheck', 'trace', 'density','intervals'.
wait
Logical. Pause between plots?
...
Arguments to pass through to the specific plot functions. Bewar of clashes may occur if types='all'. For details see the specific functions generating each type of plot.

Value

Nothing. Generates plots.

Details

This function is just a wrapper calling the necessary functions for plotting - it may be simpler in many cases to access those directly. They are: ctStanDiscretePars,ctStanKalman, ctStanPlotPost,stan_trace, stan_dens,stan_plot rstan offers many plotting possibilities not available here, to use that functionality one must simply call the relevant rstan function, listed here: rstan-plotting-functions. Use x$stanfit as the stan fit object (where x is the name of your ctStanFit object). Because a ctStanFit object has many parameters, the additional argument pars=ctStanParnames(x,'hmean') is recommended. 'hmean' denotes hyper (population) means, but see ctStanParnames for other options.

Examples

Run this code
plot(ctstantestfit,types=c('regression','kalman','priorcheck'))

## Not run: 
# ### complete example
# plot(ctstantestfit)
# 
# #### example plot using rstan functions
# rstan::stan_trace(ctstantestfit$stanfit, 
# pars=ctStanParnames(ctstantestfit,'hmean_'))
# ## End(Not run)

Run the code above in your browser using DataLab