Unlimited learning, half price | 50% off

Last chance! 50% off unlimited learning

Sale ends in


DFA (version 0.1.0)

AUC: AUC

Description

Applies the Area Under the Curve to time series.

Usage

AUC(x,data)

Arguments

x

x-axis time series (must be a vector)

data

A data.frame of time series

Value

position

Position of the DFA curve with higher Area Under the Curve.

Area

Area Under the Curve by trapezoidal rule.

Details

Compute the Area Under the Curve to a data.frame.

References

https://www.khanacademy.org/math/ap-calculus-ab/ab-integration-new/ab-6-2/a/understanding-the-trapezoid-rule

https://en.wikipedia.org/wiki/Trapezoidal_rule

Examples

Run this code
# NOT RUN {
library(DFA)

eq = function(x){x^{2}}
eq2 = function(x){x^{2}-300}
eq3 = function(x){x^{2}+300}

x <- seq(1,100,1)
data <- data.frame(eq(1:100),eq2(1:100),eq3(1:100))

AUC(x,data)

# }
# NOT RUN {
# Example with polynomials with different slopes.
library(DFA)
curve = function(x){-x^{2}}
curve2 = function(x){-x^{2}+2*x - 400}
curve3 = function(x){-x^{2}-4*x-800}

x <- seq(1,80,1)
data <- data.frame(curve(1:80),curve2(1:80),curve3(1:80))

AUC(x,data)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab