Skip to contents

trainingmodels provides mathematical models of training load and training response used in sport science. The package is experimental: its interface may still change.

Version 0.0.4 contains:

The Banister model is simulated, not fitted: estimating its parameters from data is planned for version 0.1.0. Acute:chronic workload ratios and EWMA-based loads are in the ACWR package, not here.

Example

The week of Foster (1998, Table 1):

library(trainingmodels)
load <- srpe_load(c(5, 7, 2, 6, 7, 2, 7), c(180, 120, 20, 90, 75, 20, 120))
week <- data.frame(date = as.Date("2026-01-04") + 0:6, load = load)
x <- as_daily_load(week, date = "date", load = "load")
monotony_strain(x)

On the seventh day the weekly load is 3725, the monotony 1.45 and the strain 5397.

The example of Morton et al. (1990): load 100 every day for 60 days, then rest.

x <- as_daily_load(
  data.frame(date = as.Date("2026-01-01") + 0:119,
             load = c(rep(100, 60), rep(0, 60))),
  date = "date", load = "load"
)
sim <- simulate_banister(x, k1 = 1, tau1 = 45, k2 = 2, tau2 = 15,
                         same_day_load = "include")
which.min(sim$predicted)
session_response(k1 = 1, tau1 = 45, k2 = 2, tau2 = 15)

Predicted performance is lowest on day 16; one session lowers performance for about 16 days and raises it most after about 40 days.

Teaching app

The app “Response to a single session” shows the curve, time_to_recover and time_to_peak of session_response() as the parameters of the Banister model are changed with sliders. It runs in the browser, without installing R, at https://jorgedelro.github.io/trainingmodels/app/. The first load downloads R and the package and may take some time. It is a proof of concept and is in English.

It can also be run locally; this needs the shiny package:

# install.packages("shiny")
trainingmodels::run_app()

Design decisions are recorded in DECISIONS.md, formulas and their verification in MODELS.md, and the use of AI assistance is disclosed in AI_USAGE.md.

Installation

The development version can be installed with:

# install.packages("pak")
pak::pak("JorgeDelro/trainingmodels")

or, as a binary package, from R-universe:

install.packages("trainingmodels",
                 repos = c("https://jorgedelro.r-universe.dev",
                           "https://cloud.r-project.org"))

Contributing

See CONTRIBUTING.md.

Code of Conduct

Please note that the trainingmodels project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.