Properties

$referenceSuffixTree

$referenceSuffixTree : \Sax\SuffixTree\SuffixTree

Tree representing all suffixes of the reference "sax word"

Type

\Sax\SuffixTree\SuffixTree

$analysisSuffixTree

$analysisSuffixTree : \Sax\SuffixTree\SuffixTree

Trees representing all suffixes of the analysis sax words

Type

\Sax\SuffixTree\SuffixTree

$referenceTimeSeries

$referenceTimeSeries : array

Time series used as reference. Must contain keys 'count' and 'time'

Type

array

$analysisTimeSeries

$analysisTimeSeries : array

Array of time series under analysis.

Contains on each entry arrays representing time series. These must contain keys 'count' and 'time'

Type

array

$saxReferenceString

$saxReferenceString : string

Normalized and discretized reference time series represented by a string over the alphabet $alphabet.

Type

string

$saxAnalysisStrings

$saxAnalysisStrings : array

Array of ormalized and discretized analysis time series represented by a string over the alphabet $alphabet.

Type

array

$referenceStatistics

$referenceStatistics : array

Statistics of the reference time series, such as min, max, mean, standard deviation, sum, number of entries

Type

array

$analysisStatistics

$analysisStatistics : array

Array of statistical values of the analysis time series, such as min, max, mean, standard deviation, sum, number of entries

Type

array

$alphabet

$alphabet : array

The alphabet used to generate the "sax words"

Type

array

$alphabetSize

$alphabetSize : integer

Size of characters used to generate the "sax words"

Type

integer

$breakpoints

$breakpoints : array

Breakpoints needed to discretize a time series to a sax word

Type

array

Methods

__construct()

__construct(array  $pReferenceTimeSeries, array  $pAnalysisTimeSeries, integer  $pAlphabetSize = 5) 

[__construct description]

Parameters

array $pReferenceTimeSeries

Time series used as reference. Must contain

                                 keys 'count' and 'time' on each entry.
                                 Count represents the number of occurences
                                 of an attribute at 'time'
array $pAnalysisTimeSeries

Array of time series to analyse. Each time series

                                 must contain the keys 'count' and 'time' on each entry.
                                 Count represents the number of occurences of an
                                 attribute at 'time'
integer $pAlphabetSize

Size of the alphabet used for discretization process.

                                 Must be greater than 2 and smaller than 11

preprocess()

preprocess(string  $pSaxReferenceString, array  $pSaxAnalysisStrings) : array

Creates the suffix trees for the given reference string and the strings under analysis. Annotates the occurences of each substring in the corresponding node of the tree.

Parameters

string $pSaxReferenceString

Discretized reference string (i.e. sax word)

array $pSaxAnalysisStrings

Array of discretized string representing

                                the time series under analysis

Returns

array —

Returns an array containing the analysis

                                trees annotated with their surprise values

tarzan()

tarzan(integer  $pFeatureWindowLength, integer  $pScanningWindowLength) : array

Calculates surprise values of the analysis time series in respect to the reference time series. If a surprise value exceeds the given threshold, the pair ( index, surprise value ) is added to the result array.

Parameters

integer $pFeatureWindowLength

Feature window length

                                   used in discretization process for
                                   dimensionality reduction
integer $pScanningWindowLength

Length of substrings to scan the

                                   analysis series for surprise values

Returns

array —

Array containing the found surprise values.

                                   Key is the analysis series sax word, values
                                   representing surprise pairs of ( index, surprise value )

computeStatistics()

computeStatistics(array  $pTimeSeries) : array

Calculates the minimum, maximum, standard deviation, mean, sum and the size of the given time series. It must contain the key 'count' for each entry.

Parameters

array $pTimeSeries

Time series to calculate the described attributes

Returns

array —

An array containing the attributes described above

normalizeTimeSeries()

normalizeTimeSeries(array  $pTimeSeries, float  $pMean, float  $pStdDev, boolean  $isReference) : array

Normalizes a given time series to N(0,1) with a given mean and standard deviation.

isReference indicates whether the time series is only a one dimensional timeseries representing the reference timeseries or a two dimensional array representing an array of analysis time series.

Parameters

array $pTimeSeries

Timeseries to normalize

float $pMean

Mean to use for normalization

float $pStdDev

Standard deviation to use for normalization

boolean $isReference

True, if $pTimeSeries represents the reference timeseries

Returns

array —

The normalized timeseries

discretizeTimeSeries()

discretizeTimeSeries(array  $pTimeSeries, integer  $pFeatureWindowLength = 1) : string

Discretizes a given time series to a "sax word", i.e. a sequence of characters indicating the amplitude of the time series.

Parameters

array $pTimeSeries

Time series to discretize

integer $pFeatureWindowLength

Amount of datapoints which will used as a single

                                 datapoint (by computing the mean), default is one

Returns

string —

The sax word

annotateSurpriseValues()

annotateSurpriseValues(\Sax\SuffixTree\SuffixTree  $pReferenceTree, \Sax\SuffixTree\SuffixTree  $pAnalysisTree) 

Annotates surprise values at each node of the analysis tree in context of the reference tree

Parameters

\Sax\SuffixTree\SuffixTree $pReferenceTree

Suffix tree of the reference time series

\Sax\SuffixTree\SuffixTree $pAnalysisTree

Suffix tree of the time series under analysis

annotateNode()

annotateNode(\Sax\SuffixTree\SuffixTree  $pReferenceTree, \Sax\SuffixTree\SuffixTree  $pAnalysisTree, \Sax\SuffixTree\Node  $pNode, string  $representedString) 

Annotates the analysis tree with surprise values in respect to the reference tree in a recursive manner.

Parameters

\Sax\SuffixTree\SuffixTree $pReferenceTree

Tree to use substring occurences as reference

\Sax\SuffixTree\SuffixTree $pAnalysisTree

Tree on which to calculate surprise values

\Sax\SuffixTree\Node $pNode

Current active node ( on the beginnig: the root node )

string $representedString

Substring of the whole string represented by the

                                  analysis tree. Starting at the root, ending
                                  on the active node.

initBreakpoints()

initBreakpoints() 

Initialise breakpoints

initAlphabet()

initAlphabet() 

Initialise alphabet