
Last chance! 50% off unlimited learning
Sale ends in
Applies the Area Under the Curve to time series.
AUC(x,data)
x-axis time series (must be a vector)
A data.frame of time series
Position of the DFA curve with higher Area Under the Curve.
Area Under the Curve by trapezoidal rule.
Compute the Area Under the Curve to a data.frame.
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
# 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