| plot.vcmm_fit | R Documentation |
Three panels, each requestable via which:
Varying-coefficient curves
\hat\beta_k(t) with pointwise Wald confidence bands.
Residual diagnostics: residuals vs fitted, residuals vs
t. Requires data since a vcmm fit does not
carry the raw training data.
Random-effects diagnostics: Normal Q-Q for
re_cov = "diag", or a heatmap of the
G \times q_{\mathrm{left}} random-effects matrix together
with a heatmap of the estimated \Sigma_{\mathrm{left}} for
"kronecker" / "separable".
## S3 method for class 'vcmm_fit'
plot(
x,
which = 1:3,
data = NULL,
t_grid = NULL,
n_grid = 200L,
conf_level = 0.95,
ask = (length(which) > 1L) && interactive(),
...
)
x |
A |
which |
Integer vector subset of |
data |
Optional list with components |
t_grid |
Numeric. Grid of |
n_grid |
Integer. Number of grid points if |
conf_level |
Numeric in (0, 1). Confidence level for panel-1 bands. Default 0.95. |
ask |
Logical. Passed to |
... |
Further arguments passed to base graphics calls. |
Uses base R graphics, no ggplot2 dependency. Each requested
panel is drawn on its own figure (or set of subfigures via
par(mfrow)); call par(mfrow = c(2, 2)) or similar
before plot() to combine panels in one figure.
Invisibly NULL. Called for side effects (plots).
Jalili, L. and Lin, L.-H. (2025). Scalable and Communication-Efficient Varying Coefficient Mixed-Effects Models.
varying_coef, ranef.vcmm_fit,
predict.vcmm_fit.
set.seed(1)
n <- 500
t <- runif(n); x <- runif(n); Z <- matrix(rnorm(n * 3), n, 3)
a <- rnorm(3, sd = 0.5)
y <- 2 + sin(2 * pi * t) * x + as.vector(Z %*% a) + rnorm(n, sd = 0.5)
fit <- vcmm(y, X = x, Z = Z, t = t,
control = vcmm_control(sigma_eps = 0.5, sigma_alpha = 0.5))
plot(fit) # all three panels
plot(fit, which = 1) # only varying coefs
plot(fit, which = 2, data = list(y = y, X = x, Z = Z, t = t))
plot(fit, which = 3) # ranef diagnostics
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.