Func.dist: A function to calculate the distance between two SAX...

Description Usage Arguments Value Examples

View source: R/TSMining.R

Description

This function calculates the distance between two SAX representations

Usage

1
Func.dist(x, y, mat, n)

Arguments

x

is a SAX representations.

y

is a SAX representations. It should have the same length as x.

mat

is the distance matrix created by Func.matrix

n

is the length of the original time series before the SAX transformation

Value

The function returns a numeric value, which is the distance between two SAX representations

Examples

1
2
3
4
#Assuming the original time series has a length of 20, n=20
#Assuming the time series is transformed into SAX representations using w=4 and a=4
#Assuming one is a,b,c,d and the other is d,b,c,d
Func.dist(x=c("a","b","c","d"), y=c("d","b","c","d"), mat=Func.matrix(a=4), n=20)

Example output

[1] 2.996331

TSMining documentation built on May 2, 2019, 3:54 p.m.