Learn R Programming

DFA (version 0.1.0)

euclidean: euclidean

Description

Applies the euclidean method for detection of crossover points to time series.

Usage

euclidean(x,y,npoint)

Arguments

x

x-axis time series (must be a vector).

y

y-axis time series (must be a vector).

npoint

Number of crossover points.

Value

position

Position of the crossover point.

References

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

Examples

Run this code
# NOT RUN {
library(DFA)
data("data5")
data("data6")
x<-log10(data6)
y<-log10(data5)
npoint=2

euclidean(x,y,npoint)

#Example with different number of crossover
#points and other dataset.
library(DFA)
part1 <- seq(1,20)
part2 <- seq(20,1)
y = c(part1,part2)
x<-seq(1,40)
plot(x,y)
euclidean(x,y,npoint=1)

# }

Run the code above in your browser using DataLab