Skip to content
Rows21Public

About

Official Implementation of Bayesian Threshold-Aligned Joint Disease Progression Model (B-TAJ)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

A Bayesian Threshold-Aligned Joint Disease Progression Model (B-TAJ DPM) for Alzheimer’s Disease

arXiv PDF

Official R implementation of B-TAJ DPM, from the following paper:

A Bayesian Threshold-Aligned Joint Disease Progression Model (B-TAJ DPM) for Alzheimer’s Disease.
Rong Wu, Duygu Tosun, Isabella Hausle, Margo Heston, and Aaron Wolfe Scheffler,
University of California San Francisco
for the Alzheimer’s Disease Neuroimaging Initiative

Requirements

  • R 4.6.1 (R 4.5.3 or later may work, but the current workflow was checked with R 4.6.1)
  • Rtools for Windows, including make and g++, because NIMBLE compiles C++ code
  • Pandoc 2.8 or later to render an R Markdown file to HTML or PDF

Install the main R packages with:

install.packages(c(
  "nimble", "matrixStats", "ggplot2", "splines2", "tidyr",
  "dplyr", "mgcv", "MASS", "knitr", "rmarkdown"
))

Both commands should return an executable path.

Repository layout

Tutorial simulation

The tutorial loads the simulation components from model/ and uses simu() to:

  1. generate longitudinal amyloid and tau observations;
  2. fit the simulated data with the B-TAJ model;
  3. retain posterior draws for trajectories, covariates, variance parameters, correlation, and subject-level random effects.

Open B-TAJ DPM Tutorial.Rmd in RStudio or run:

setwd("E:/Github/B-TAJ")
knitr::knit("B-TAJ DPM Tutorial.Rmd")

Training posterior

The Rmd first runs:

res <- simu(
  varying_coef_code_sim,
  varying_coef_code,
  n_subjects = 1000,
  niter = 2000,
  nburnin = 1000
)

This is the training fit. Its posterior samples are kept fixed and are used as the fitted population-level model.

New data prediction

The Rmd then creates a new simulation with:

data_1 <- generate_d1(n_subjects = 2, ...)
simudata <- generate_vc(varying_coef_code_sim, data_1, ...)

This N=2 dataset is not refit as a new population model. Instead, its observed amyloid and tau data are passed to posterior_predictions_code. The fixed training posterior supplies the population trajectory and variance parameters, while the new data update the subject-specific alpha random effects.

The Rmd then reports posterior threshold-age predictions. Amyloid predictions are produced for both new subjects; tau predictions are produced only for subjects included in tau_amy_link and therefore having tau observations.

The Rmd may take several minutes because it compiles NIMBLE models and runs MCMC twice: once for the N=1000 training simulation and once for the N=2 posterior prediction.

Citation

If you use this implementation, cite:

License

This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.

CC BY-NC 4.0

© 2025 Rong Wu.

About

Official Implementation of Bayesian Threshold-Aligned Joint Disease Progression Model (B-TAJ)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages