Skip to contents

TDMM: Bayesian Time-Dynamic Models with Optional Mixed Effects models Gaussian, Bernoulli, and Poisson outcomes using coefficient functions that vary smoothly over time. Repeated observations use a subject-specific random intercept by default; random_intercept = FALSE supports independent observations. The reference index documents fitting, priors, computational controls, plotting, diagnostics, and data checks. The Getting Started guide gives the introductory workflow.

For repeated observations, the model includes a subject-specific random intercept:

g{E[Yi(t)∣bi]}=β0(t)+∑kXik(t)βk(t)+bi. g\{E[Y_i(t) \mid b_i]\} = \beta_0(t) + \sum_k X_{ik}(t)\beta_k(t) + b_i.

For independent observations, random_intercept = FALSE omits that term:

g{E[Yi(t)]}=β0(t)+∑kXik(t)βk(t). g\{E[Y_i(t)]\} = \beta_0(t) + \sum_k X_{ik}(t)\beta_k(t).

Here gg is the identity, logit, or log link for Gaussian, Bernoulli, or Poisson outcomes, respectively. In independent-observation settings, time may be age, time since an event, time relative to an event, or another meaningful time scale. The curves describe how associations vary across that time scale in the population; they do not by themselves describe within-subject longitudinal change.

Cubic B-splines (degree 3, order 4), n_basis = 8 by default, and a second-order coefficient-difference penalty are used for both specifications. n_basis directly specifies the number of basis functions. The nknots argument remains available for existing calls; use n_basis when specifying the basis dimension. Family-specific priors can be inspected with tdmm.priors().

The historical v0.1.0 source and documentation remain available through the v0.1.0 Git tag.