time-series-0.1.0.0: Time series analysis.

Portabilityportable
Stabilityexperimental
Safe HaskellNone

TimeSeries.Correlation

Description

Functions for correlation analysis.

Synopsis

Documentation

direct :: Window -> Window -> DoubleSource

Direct computation of correlation of two windows X and Y. Resulting value r is:

See: http://en.wikipedia.org/wiki/Pearson_product-moment_correlation_coefficient#Definition

Where: X̄ is mean of X, Xi is i-th element of X.

sketch_naiveSource

Arguments

:: [Window]

Random vectors, length of list is d (the sketch size). Length of Window is sw (sliding window size).

-> Int

Size of sliding window.

-> Window

First sliding window.

-> Window

Second sliding window.

-> Double 

Naive correlation from sketch distance, using:

sketch distance is computated without incremental update.

sketchSource

Arguments

:: Window

Sketch of sliding window X

-> Window

Sketch of sliding window Y

-> Double 

Sketch distance based correlation.

sketch_distanceSource

Arguments

:: Int

Sketch size d.

-> [Double]

First vector.

-> [Double]

Second vector.

-> Double 

Sketch distance.

norm :: Floating a => [a] -> aSource

Vector norm:

 norm as = sqrt $ sum [a^2|a <- as]

mean :: Fractional a => [a] -> aSource

len :: Num b => [a] -> bSource

dotp :: Num a => [a] -> [a] -> aSource

chunks :: Int -> [a] -> [[a]]Source

square :: Fractional a => a -> aSource