## ----include = FALSE----------------------------------------------------------
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

## ----setup--------------------------------------------------------------------
library(tempodisco)

## -----------------------------------------------------------------------------
data("adj_amt_sim") # Load simulated choice data from an adjusting amounts procedure
head(adj_amt_sim)
data("td_bc_single_ptpt") # Load choice data from a non-adjusting-amounts experiment
head(td_bc_single_ptpt)

## -----------------------------------------------------------------------------
indiff_data <- adj_amt_indiffs(adj_amt_sim)
head(indiff_data)

## -----------------------------------------------------------------------------
indiff_mod <- td_bcnm(td_bc_single_ptpt, discount_function = 'model-free')
plot(indiff_mod, verbose = F)

## -----------------------------------------------------------------------------
print(nonsys(indiff_data)) # Fails criterion 1 (monotonicity)
print(nonsys(indiff_mod))

## -----------------------------------------------------------------------------
AUC(indiff_data)
AUC(indiff_mod)

## -----------------------------------------------------------------------------
hyperbolic_mod <- td_ipm(indiff_data, discount_function = 'hyperbolic')
plot(hyperbolic_mod)
coef(hyperbolic_mod)

## -----------------------------------------------------------------------------
hyperbolic_mod <- td_bcnm(td_bc_single_ptpt, discount_function = 'hyperbolic')
plot(hyperbolic_mod, verbose = F)
coef(hyperbolic_mod)

