Learn R Programming

ctsem (version 2.8.2)

ctStanPostPredict: Compares model implied density and values to observed, for a ctStanFit object.

Description

Compares model implied density and values to observed, for a ctStanFit object.

Usage

ctStanPostPredict(fit, legend = TRUE, diffsize = 1, jitter = 0.02,
  wait = TRUE, probs = c(0.025, 0.5, 0.975), shading = TRUE,
  datarows = "all", ...)

Arguments

fit

ctStanFit object.

legend

Logical, whether to plot a legend.

diffsize

Integer > 0. Number of discrete time lags to use for data viz.

jitter

Positive numeric between 0 and 1, if TRUE, jitters empirical data by specified proportion of std dev.

wait

Logical, if TRUE, waits for input before plotting next plot.

probs

Vector of length 3 containing quantiles to plot -- should be rising numeric values between 0 and 1.

shading

Logical -- show smoothed shading over generated data points? Otherwise, plot shaded polygon based on quantile estimate. Shading is better for non-linearities.

datarows

integer vector specifying rows of data to plot. Otherwise 'all' uses all data.

...

extra arguments to pass to plot function.

Value

If plot=FALSE, an array containing quantiles of generated data. If plot=TRUE, nothing, only plots.

Details

This function relies on the data generated during each iteration of fitting to approximate the model implied distributions -- thus, when limited iterations are available, the approximation will be worse.

Examples

Run this code
# NOT RUN {
ctStanPostPredict(ctstantestfit,wait=FALSE, shading=FALSE, datarows=1:25,diffsize=2)
# }

Run the code above in your browser using DataLab