Skip to contents

The backend='julia' counterpart of plot.ctStanFit. 'regression' plots model implied regression coefficients against the time interval via ctDiscretePars, 'kalman' plots expectations via ctPredict, 'priorcheck' plots each population parameter's prior against its posterior via ctPlotPosterior, and 'trace' plots how the fit reached its estimate via ctTracePlot: the optimiser's trace, or each chain's draws for a sampled fit. Stan's own density and interval plots of a sampled fit ('density', 'intervals') have no julia counterpart; 'priorcheck' shows the posterior densities.

Usage

# S3 method for class 'ctJuliaFit'
plot(x, types = "all", wait = TRUE, ...)

Arguments

x

Fit object from ctFit(..., backend='julia').

types

Vector of plot types: 'all', 'regression', 'kalman', 'priorcheck', 'trace'. 'all' leaves out 'regression' for a discrete time model, 'priorcheck' for a fit with no posterior draws, and 'trace' for a fit with nothing to trace.

wait

Logical. Pause between plots?

...

Passed through to ctDiscretePars and ctPredict. Beware clashes when types='all'.

Value

Nothing. Generates plots.

Examples

# \donttest{
# Needs a working julia backend, so the example is inert where Julia is
# absent -- including on CRAN, whose check machines have none.
if (isTRUE(ctJuliaStatus()$available)) {
  data <- ctstantestdat
  model <- ctModel(type = 'ct', manifestNames = 'Y1', latentNames = 'eta1',
    LAMBDA = matrix(1))
  model$pars$indvarying <- FALSE
  fit <- ctFit(data, model, backend = 'julia', cores = 1)
  plot(fit, wait = FALSE)
  # Julia keeps running between calls, holding what it has compiled;
  # this ends it.
  ctJuliaKill("session")
}
# }