tempodisco

tempodisco: an R package for temporal discounting - Published in JOSS (2025)

https://github.com/kinleyid/tempodisco

Science Score: 98.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 20 DOI reference(s) in README and JOSS metadata
  • Academic publication links
    Links to: joss.theoj.org
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
    Published in Journal of Open Source Software

Scientific Fields

Psychology Social Sciences - 40% confidence
Engineering Computer Science - 40% confidence
Last synced: 4 months ago · JSON representation ·

Repository

An R package for temporal discounting

Basic Info
Statistics
  • Stars: 2
  • Watchers: 1
  • Forks: 1
  • Open Issues: 6
  • Releases: 2
Created almost 2 years ago · Last pushed 8 months ago
Metadata Files
Readme License Citation

README.Rmd

---
output: github_document
---



```{r, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)
```

# tempodisco



[![DOI](https://joss.theoj.org/papers/10.21105/joss.07472/status.svg)](https://doi.org/10.21105/joss.07472) [![R-CMD-check](https://github.com/kinleyid/tempodisco/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/kinleyid/tempodisco/actions/workflows/R-CMD-check.yaml) [![codecov](https://codecov.io/github/kinleyid/tempodisco/graph/badge.svg?token=CCQXS3SNGB)](https://app.codecov.io/github/kinleyid/tempodisco)



[`tempodisco`](https://kinleyid.github.io/tempodisco/index.html) is an R package for behavioural researchers working with delay discounting data (also known as temporal discounting intertemporal choice data). It implements common tasks such as scoring responses (e.g. computing indifference points from an adjusting amounts procedure, computing the "area under the curve", or computing $k$ values as in the Monetary Choice Questionnaire; [Frye et al., 2016](https://doi.org/10.3791/53584); [Myerson et al., 2001](https://doi.org/10.1901/jeab.2001.76-235); [Kirby et al., 1999](https://doi.org/10.1037//0096-3445.128.1.78)), identifying poor-quality data (e.g. failed attention checks and non-systematic responding; [Johnson & Bickel, 2008](https://doi.org/10.1037/1064-1297.16.3.264)), modelling choice data using multiple discount functions (e.g. hyperbolic, exponential, etc.---see below; [Franck et al., 2015](https://doi.org/10.1002/jeab.128)), and modelling reaction times using drift diffusion models ([Peters & D'Esposito, 2020](https://doi.org/10.1371/journal.pcbi.1007615)).

## Installation

You can install `tempodisco` from GitHub with:

``` r
# install.packages("devtools")
devtools::install_github("kinleyid/tempodisco")
```

## Getting started

See the [documentation](https://kinleyid.github.io/tempodisco/), particularly the "[Getting started](https://kinleyid.github.io/tempodisco/articles/tempodisco.html)" page, for example usage.

## Overview

A good practice in delay discounting research is to not assume that the same discount function describes every individual ([Franck et al., 2015](https://doi.org/10.1002/jeab.128)). `tempodisco` implements the following discount functions and can automatically select the best one for a given individual according to the Bayesian information criterion ([Schwartz, 1978](https://doi.org/10.1214/aos/1176344136)):

```{r child="man/fragments/predefined-discount-functions.Rmd"}
```

These discount functions can be fit to indifference point data (see [`td_ipm`](https://kinleyid.github.io/tempodisco/reference/td_ipm.html)), choice-level data (see [`td_bcnm`](https://kinleyid.github.io/tempodisco/reference/td_bcnm.html)), or data including both choices and reaction times (see [`td_ddm`](https://kinleyid.github.io/tempodisco/reference/td_ddm.html)).

After fitting a model, we can check to see how well it matches the data using the [`plot()`](https://kinleyid.github.io/tempodisco/reference/plot.td_um.html) function:

```{r}
library(tempodisco)
data("td_bc_single_ptpt")
mod <- td_bcnm(td_bc_single_ptpt, discount_function = c('hyperbolic', 'exponential'))
plot(mod, p_lines = c(0.1, 0.9), log = 'x', verbose = F)
```

Note that the discount curve contains an inflection point because the x-axis is on a log scale. See the "[Visualizing models](https://kinleyid.github.io/tempodisco/articles/visualizing-models.html)" page of the documentation for more examples.

## Further reading

The "Examples" tab on [the documentation](https://kinleyid.github.io/tempodisco/) contains a list of tutorials on solving common problems in delay discounting research.

## Reporting issues and requesting features

If you encounter problems with the software or would like to it to have additional functionality, please open a new issue on the GitHub repository. Try to include as much detail as possible, especially how to reproduce any errors/incorrect results. GitHub has instructions on opening an issue [here](https://docs.github.com/en/issues/tracking-your-work-with-issues/using-issues/creating-an-issue).

## Contributing

If you would like to contribute to `tempodisco`, you're more than welcome! Please follow the instructions [here](https://docs.github.com/en/get-started/exploring-projects-on-github/contributing-to-a-project) on how to contribute to a project on GitHub. Feel free to [contact me](https://kinleyid.github.io) if you'd like help with any contributions.

Owner

  • Name: Isaac Kinley
  • Login: kinleyid
  • Kind: user

PhD candidate at McMaster University.

JOSS Publication

tempodisco: an R package for temporal discounting
Published
April 08, 2025
Volume 10, Issue 108, Page 7472
Authors
Isaac Kinley ORCID
Postdoctoral Fellow, Rotman Research Institute, Canada
Editor
Sehrish Kanwal ORCID
Tags
psychology economics behaviour decision making temporal discounting delay discounting intertemporal choice

Citation (CITATION.cff)

cff-version: "1.2.0"
authors:
- family-names: Kinley
  given-names: Isaac
  orcid: "https://orcid.org/0000-0003-2057-9606"
contact:
- family-names: Kinley
  given-names: Isaac
  orcid: "https://orcid.org/0000-0003-2057-9606"
doi: 10.5281/zenodo.15076623
message: If you use this software, please cite our article in the
  Journal of Open Source Software.
preferred-citation:
  authors:
  - family-names: Kinley
    given-names: Isaac
    orcid: "https://orcid.org/0000-0003-2057-9606"
  date-published: 2025-04-08
  doi: 10.21105/joss.07472
  issn: 2475-9066
  issue: 108
  journal: Journal of Open Source Software
  publisher:
    name: Open Journals
  start: 7472
  title: "tempodisco: an R package for temporal discounting"
  type: article
  url: "https://joss.theoj.org/papers/10.21105/joss.07472"
  volume: 10
title: "tempodisco: an R package for temporal discounting"

GitHub Events

Total
  • Create event: 8
  • Release event: 2
  • Issues event: 25
  • Watch event: 2
  • Delete event: 4
  • Issue comment event: 16
  • Push event: 153
  • Pull request event: 12
  • Fork event: 1
Last Year
  • Create event: 8
  • Release event: 2
  • Issues event: 25
  • Watch event: 2
  • Delete event: 4
  • Issue comment event: 16
  • Push event: 153
  • Pull request event: 12
  • Fork event: 1

Committers

Last synced: 5 months ago

All Time
  • Total Commits: 200
  • Total Committers: 2
  • Avg Commits per committer: 100.0
  • Development Distribution Score (DDS): 0.015
Past Year
  • Commits: 169
  • Committers: 2
  • Avg Commits per committer: 84.5
  • Development Distribution Score (DDS): 0.018
Top Committers
Name Email Commits
Isaac Kinley i****y@g****m 197
Steve Martin m****s@p****m 3

Issues and Pull Requests

Last synced: 4 months ago

All Time
  • Total issues: 17
  • Total pull requests: 8
  • Average time to close issues: 7 days
  • Average time to close pull requests: about 10 hours
  • Total issue authors: 3
  • Total pull request authors: 2
  • Average comments per issue: 0.88
  • Average comments per pull request: 0.75
  • Merged pull requests: 6
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 17
  • Pull requests: 8
  • Average time to close issues: 7 days
  • Average time to close pull requests: about 10 hours
  • Issue authors: 3
  • Pull request authors: 2
  • Average comments per issue: 0.88
  • Average comments per pull request: 0.75
  • Merged pull requests: 6
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • kinleyid (9)
  • marberts (8)
  • bkrayfield (1)
Pull Request Authors
  • kinleyid (9)
  • marberts (4)
Top Labels
Issue Labels
enhancement (2) documentation (1)
Pull Request Labels

Dependencies

DESCRIPTION cran