| temporal_tvc | R Documentation |
Specify a time-varying coefficient (TVC): one or more fixed-effect
coefficients are allowed to evolve over time, with the evolution governed by
a temporal prior (rw1, rw2, ar1 or gp).
rw1, rw2 and ar1 read the time index as a position on a grid, so
consecutive instants are one step apart whatever the data says. gp is the
continuous-time structure: the coefficient is a Gaussian process over the
distinct time VALUES, which is what irregular spacing needs. It is distinct
from temporal_gp(), a GP over time entering the linear predictor additively
(eta_i += f(t_i)); here the GP IS a coefficient (eta_i += x_i w(t_i)).
temporal_tvc(
time_var,
terms = 1,
structure = c("rw1", "rw2", "ar1", "gp"),
cov = c("exponential", "matern", "gaussian", "periodic"),
nu = 1.5,
period = NULL,
group_var = NULL,
shared = NULL,
sigma_prior_U = 1,
sigma_prior_alpha = 0.01,
scale_coords = TRUE
)
## S3 method for class 'tulpa_tvc'
print(x, ...)
time_var |
Single character string naming the time variable in the data.
|
terms |
Which coefficients vary over time. A formula, an integer vector
of design-matrix column indices, or a character vector of term names.
Default |
structure |
Temporal prior governing how the coefficients evolve. One of
|
cov, nu, period |
Covariance kernel for |
group_var |
Optional character string naming a grouping variable for group-specific time-varying coefficients. |
shared |
Whether the effect is shared across processes in a
multi-process model. |
sigma_prior_U, sigma_prior_alpha |
Penalized-complexity prior on each
varying coefficient's marginal standard deviation, calibrated so that
|
scale_coords |
Logical, |
x |
A |
... |
Ignored. |
A tulpa_tvc object.
temporal_rw1(), temporal_rw2(), temporal_ar1() for the
underlying temporal priors; temporal_gp() for a GP over time that is not
a varying coefficient.
# Intercept that drifts as a first-order random walk over year
temporal_tvc("year", structure = "rw1")
# A slope evolving as a continuous-time GP over irregularly-spaced visits
temporal_tvc("day", terms = ~ x - 1, structure = "gp", cov = "matern")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.