
dlmtree is an R package that provides constraineddistributed lag models (DLMs) using a regression tree approach withinthe Bayesian additive regression trees (BART) framework, referred to astreed DLMs. The package includes various extensions of treed DLMs,allowing for the incorporation of different scenarios like linear,non-linear associations, mixture exposures, and heterogeneous exposureeffects. The package is built user-friendly with a single function withthree arguments to specify treed DLMs. Functions for summarizing themodel fit and visualization are also provided.
| Model | Type | Family | Mixture | Heterogeneity |
|---|---|---|---|---|
| Treed distributed lag model(TDLM)2 | Linear | Gaussian | X | X |
| Binary | X | X | ||
| Count | X | X | ||
| Treed distributed lag mixture model(TDLMM)2 | Linear | Gaussian | O | X |
| Binary | O | X | ||
| Count | O | X | ||
| Treed distributed non-linear lag model(TDLNM)1, 4 | Non-linear | Gaussian | X | X |
| Binary | X | X | ||
| Monotone | Gaussian | X | X | |
| Binary | X | X | ||
| Heterogeneous distributed lag model(HDLM)3 | Linear | Gaussian | X | O |
| Heterogeneous distributed lag mixturemodel (HDLMM) | Linear | Gaussian | O | O |

Installing package fromGitHub:
# install.packages("devtools")devtools::install_github("danielmork/dlmtree")library(dlmtree)Installing package from CRAN:
install.packages("dlmtree")library(dlmtree)The following paper describes this package, including a high-leveloverview of methods, R syntax and examples.
The majority of methods implemented in this package are described inthe following methods papers as well as some on going work.
Mork, D. and Wilson, A. (2022). “Treed distributed lag nonlinearmodels.”Biostatistics,23(3), 754–771 (DOI:10.1093/biostatistics/kxaa051,arXiv preprint)
Mork, D. and Wilson, A. (2023). “Estimating perinatal criticalwindows of susceptibility to environmental mixtures via structuredBayesian regression tree pairs.”Biometrics,79(1),449-461 (DOI:10.1111/biom.13568,arXivpreprint)
Mork, D., Kioumourtzoglou, M. A., Weisskopf, M., Coull, B. A.,and Wilson, A. (2024). “Heterogeneous Distributed Lag Models to EstimatePersonalized Effects of Maternal Exposures to Air Pollution.”Journal of the American Statistical Association,119(545), 14-26 (DOI:10.1080/01621459.2023.2258595,arXiv preprint)
Mork, D. and Wilson, A. (In press). “Incorporating priorinformation into distributed lag nonlinear models with zero-inflatedmonotone regression trees.”Bayesian Analysis. (DOI: 10.1214/23-BA1412,arXiv preprint)