Learn R Programming

TSMining (version 1.0)

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

Description

This function calculates the distance between two SAX representations

Usage

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

Run this code
#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)

Run the code above in your browser using DataLab