Skip to contents

Computes a value based on a linear growth curve reaching a plateau for time.

Usage

fn_linear_sat(t, t1 = 45, t2 = 80, k = 0.9)

Arguments

t

Numeric. The time value.

t1

Numeric. The lower threshold time. Default is 45.

t2

Numeric. The upper threshold time. Default is 80.

k

Numeric. The maximum value of the function. Default is 0.9. Assumed to be known.

Value

A numeric value based on the threshold model. If t is less than t1, the function returns 0. If t is between t1 and t2 (inclusive), the function returns a value between 0 and k in a linear trend. If t is greater than t2, the function returns k.

Details

$$ f(t; t_1, t_2, k) = \begin{cases} 0 & \text{if } t < t_1 \\ \dfrac{k}{t_2 - t_1} \cdot (t - t_1) & \text{if } t_1 \leq t \leq t_2 \\ k & \text{if } t > t_2 \end{cases} $$

Examples

library(flexFitR)
plot_fn(
  fn = "fn_linear_sat",
  params = c(t1 = 34.9, t2 = 61.8, k = 100),
  interval = c(0, 108),
  n_points = 2000,
  auc_label_size = 3
)