| auto_corr | R Documentation |
This function obtains the autocorrelation of the MCMC samples in an JointAI
object via coda::autocorr.diag(). autocorr_plot() visualizes the results
using ggplot2.
auto_corr(object, lags = 0:30, by_chain = TRUE, outcome = 1L,
start = NULL, end = NULL, thin = NULL)
auto_corr_plot(object, lags = 0:30, by_chain = TRUE, outcome = 1L,
start = NULL, end = NULL, thin = NULL)
object |
an object of class JointAI |
lags |
a numeric vector indicating the lags to consider |
by_chain |
logical; should the autocorrelation be computed for each chain separately? |
outcome |
integer; index of the outcome model for which the autocorrelation should be plotted |
start |
the first iteration of interest
(see |
end |
the last iteration of interest
(see |
thin |
thinning interval (integer; see |
a matrix or a list of matrix objects if by_chain = TRUE, or
a ggplot() object for autocorr_plot().
fit <- lm_imp(y ~ C1 + C2 + B2, data = wideDF, n.iter = 200)
auto_corr(fit)
auto_corr_plot(fit)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.