R-package for interpretable nonparametric modeling of longitudinal data using additive Gaussian processes. Contains functionality for inferring covariate effects and assessing covariate relevances. Various models can be specified using a convenient formula syntax.

Overview image

Getting started

See Overview, Tutorials and Documentation.


  • The package should work on all major operating systems. We dont have pre-compiled binaries distributed yet, so currently lgpr needs to be installed from source.
  • To compile the Stan code included in the package on Windows or Mac, you need to have your toolchain setup properly.
    • On Windows, install Rtools as explained here. You also need to complete the Configuration step, as described in the above link.
    • On Mac, see toolchain configuration here
    • R 3.4 or later is required, R 4.0.2 or later is recommended




install.packages('devtools') # if you don't have devtools already
devtools::install_github('jtimonen/lgpr', dependencies = TRUE)
  • Note: In some cases, the exact version 2.0.0 of rstantools is required due to problems with some recently updated versions of StanHeaders or rstantools (see this thread). You can remove possible incompatible version of rstantools and install version 2.0.0 by
devtools::install_version("rstantools", version = "2.0.0", repos = "http://cran.us.r-project.org")

Real data and reproducing the experiments

For code to reproduce the experiments of our manuscript see https://github.com/jtimonen/lgpr-usage. Preprocessed longitudinal proteomics data is also provided there.