trapezoid_auc {YEAB}R Documentation

Area under the curve (AUC)

Description

Calculate the area under the curve (AUC) using the trapezoid method.

Usage

trapezoid_auc(x, y)

Arguments

x

A numeric vector of x values

y

A numeric vector of y values

Value

A numeric value of the area under the curve

Examples

x_values <- c(0, 1, 2, 3, 4) # Delay times
y_values <- c(1, 0.8, 0.6, 0.4, 0.2) # Discounted values
auc_result <- trapezoid_auc(x_values, y_values)
print(paste("Area Under Curve: ", auc_result))

[Package YEAB version 1.0.6 Index]