habbix-0.1.0.0: Multi-Axis library/executable and misc. zabbix tools

Copyright(C) 2014 Samuli Thomasson
LicenseMIT (see the file LICENSE)
MaintainerSamuli Thomasson <samuli.thomasson@paivola.fi>
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Forecast

Contents

Description

Regression utilities.

Synopsis

Documentation

type Predict = StateT (Vector Epoch, Vector Double) IO

A simple stateful abstraction

simpleLinearRegression :: (Eq n, Fractional n, Storable n) => Vector n -> Vector n -> Maybe (n, n, n)

`simpleLinearRegression xs ys` gives (a, b, r2) for the line y = a * x + b.

drawFuture

Arguments

:: Double

a

-> Double

b

-> Maybe (Epoch, Double)

draw starting at (time, value)

-> Vector Epoch

clocks

-> Vector Double 
y - y0 = a * (x - x0)
     ==> y = a * x + (y0 - a * x0) = a * x + b'

Filters

data Filter

Constructors

Filter 

Fields

aggregate :: FilterAggregate
 
interval :: Epoch

seconds; a day an hour...

intervalStarts :: Epoch
 

data FilterAggregate

Constructors

Max 
Min 
Avg 

apply :: (Real b, Fractional b) => FilterAggregate -> Vector (a, b) -> (a, b)

splittedAt :: Epoch -> Epoch -> Vector Epoch -> Vector (Int, Epoch)

Fold left; accumulate the current index (and timestamp) when day changes.

Utility

vectorAvg :: (Real a, Fractional a) => Vector a -> a

vectorMedian :: Vector a -> a