Tim J. Boonen and Yuhuai Chen (The University of Hong Kong).
The reproducibility package was assembled at December 24, 2025.
The code in this replication material generates all numerical experiments, figures, and tables for the paper "Low-Rank Tensor Autoregressive Models for Mortality Modelling".
Each figure and table is generated separately by its corresponding script file Figure_[xx]_*.R or Table_[xx]_*.R, respectively.
The main contents of the repository are the following:
data/: folder of raw data files and functions for processing themout/: folder of generated plots as pdf files and generated tables as xlsx files.function/: folder of all nested functionsFigure_[xx]_*.R: R scripts for creating the corresponding figuresTable_[xx]_*.R: R scripts for creating the corresponding tables
All file paths are relative to the root of the replication package. Please set your working directory accordingly, or open the .Rproj file using RStudio.
The analysis files Figure_[xx]_*.R and Table_[xx]_*.R can be run individually, in any order.
These analyses were run on R 4.3.3. A comprehensive list of dependencies can be found in the renv.lock file. For a convenient setup in a (local) R session, we recommend using the renv package. The following steps are required once:
# install.packages("renv")
renv::activate()
renv::restore() # install dependencies
renv::status() # check environment
The main estimation routines for the TAR-CP and TAR-Tucker models are implemented in function/utils/TAR_fit.R. The TAR-CP model is estimated via the function fittenRR whereas the TAR-Tucker model is estimated using the function fit_nc.
These data are downloaded from https://www.mortality.org/ and located at data. See Human Mortality Database. (2023, https://www.mortality.org/File/GetDocument/Public/Docs/MethodsProtocolV6.pdf) for more details.
Human Mortality Database. (2023). Methods protocol for the Human Mortality Database (Version 6). Retrieved from https://www.mortality.org/File/GetDocument/Public/Docs/MethodsProtocolV6.pdf