
Print, summarize, and plot stLMM objects
stLMM-methods.RdS3 methods for compact inspection of fitted, recovered, and prediction objects. Summaries report posterior means, standard deviations, and quantiles for active sample blocks only. Plot methods use base graphics and choose conservative defaults to avoid drawing very large posterior or prediction objects by accident.
Usage
# S3 method for class 'stLMM'
print(x, ...)
# S3 method for class 'stLMM'
summary(object, probs = c(0.025, 0.5, 0.975),
burn = 0L, parameters = NULL, ...)
# S3 method for class 'stLMM'
plot(x, type = c("trace", "density"), parameters = NULL,
max_parameters = 12L, burnin = 0L, thin = 1L, ...)
# S3 method for class 'stLMM_chains'
print(x, ...)
# S3 method for class 'stLMM_chains'
summary(object, probs = c(0.025, 0.5, 0.975),
diagnostics = TRUE, include_w = FALSE, burn = 0L,
parameters = NULL, ...)
# S3 method for class 'stLMM_chains'
plot(x, type = c("trace", "density"),
parameters = NULL, max_parameters = 12L, include_w = FALSE,
n_col = NULL, chain_colors = NULL, lwd = 1, burnin = 0L,
thin = 1L, ...)
# S3 method for class 'stLMM_recovery'
print(x, ...)
# S3 method for class 'stLMM_recovery'
summary(object, probs = c(0.025, 0.5, 0.975),
burn = 0L, parameters = NULL, include_w = FALSE, max_w = 20L, ...)
# S3 method for class 'stLMM_recovery_chains'
summary(object,
probs = c(0.025, 0.5, 0.975), diagnostics = TRUE,
include_w = FALSE, burn = 0L, parameters = NULL, ...)
# S3 method for class 'stLMM_recovery'
plot(x, term = NULL, nodes = NULL,
type = c("trace", "density", "fitted"), observed = NULL,
max_nodes = 12L, burnin = 0L, thin = 1L, ...)
# S3 method for class 'stLMM_recovery_chains'
plot(x, type = c("trace", "density"),
parameters = NULL, max_parameters = 12L, include_w = FALSE, ...)
# S3 method for class 'stLMM_prediction'
print(x, ...)
# S3 method for class 'stLMM_prediction'
summary(object, probs = c(0.025, 0.5, 0.975),
include_y = !is.null(object$y_samples), ...)
# S3 method for class 'stLMM_prediction'
plot(x, sample = c("mu", "y"),
type = c("interval", "density", "scatter"), rows = NULL,
observed = NULL, probs = c(0.025, 0.5, 0.975), max_rows = 200L,
burnin = 0L, thin = 1L, ...)
# S3 method for class 'stLMM_prediction_chains'
plot(x, sample = c("mu", "y"),
type = c("interval", "density"), rows = NULL,
probs = c(0.025, 0.5, 0.975), max_rows = 200L,
burnin = 0L, thin = 1L, ...)Arguments
- x, object
An
stLMM,stLMM_recovery, orstLMM_predictionobject, or the corresponding multi-chain object.- probs
Posterior quantiles to report. Prediction interval plots expect three probabilities: lower, center, and upper.
- type
Plot type. For fit objects,
"trace"or"density". For recovery objects,"trace","density", or"fitted". For prediction objects,"interval","density", or"scatter".- parameters
Optional exact parameter names to summarize or plot for an
stLMMfit. For summaries, unlisted parameters are omitted from the returned parameter table or tables.- max_parameters
Maximum number of parameters to plot by default.
- burn
Number of initial posterior draws to discard before computing fit summaries and multi-chain diagnostics. The default
0Luses all retained draws. This affects only the summary call; it does not modify the stored posterior samples.- diagnostics
Logical; for multi-chain summaries, compute coda diagnostics such as potential scale reduction and effective sample size.
- burnin
Number of initial plotted draws to discard. This affects only the plotting call; it does not modify the stored posterior samples.
- thin
Keep every
thin-th plotted draw afterburnin. This affects only the plotting call.- include_w
Logical; include summaries of saved or recovered latent process samples. Defaults to
FALSEbecause these can be large.- n_col
Optional number of columns for multi-chain fit trace or density plot panels. Defaults to a compact base graphics layout.
- chain_colors
Optional vector of colors for multi-chain fit plots. Values are recycled to the number of chains.
- lwd
Line width for multi-chain fit trace or density plots.
- max_w
Maximum number of latent process nodes summarized when
include_w = TRUE.- term
Recovered process term to plot. Defaults to the first recovered term.
- nodes
Latent process nodes to plot.
- max_nodes
Maximum number of recovered nodes to plot by default.
- include_y
Logical; include posterior predictive observation summaries when
y_sampleswere simulated.- sample
Prediction sample matrix to plot:
"mu"or"y".- rows
Prediction rows to plot.
- observed
Observed values for recovery fitted-value scatter plots or prediction scatter plots. Recovery plots use the fitted response by default.
- max_rows
Maximum number of prediction rows plotted by default.
- ...
Additional arguments passed to base plotting functions.