aivika-transformers-2.1: Transformers for the Aivika simulation library

CopyrightCopyright (c) 2009-2014, David Sorokin <david.sorokin@gmail.com>
LicenseBSD3
MaintainerDavid Sorokin <david.sorokin@gmail.com>
Stabilityexperimental
Safe HaskellSafe-Inferred
LanguageHaskell2010

Simulation.Aivika.Trans.Statistics

Contents

Description

Tested with: GHC 7.8.3

Represents statistics.

Synopsis

Simple Statistics

data SamplingStats a :: * -> *

Describes when the statistics consists of only samples not bound to the simulation time.

Constructors

SamplingStats 

Fields

samplingStatsCount :: !Int

The total number of samples.

samplingStatsMin :: !a

The minimum value among the samples.

samplingStatsMax :: !a

The maximum value among the samples.

samplingStatsMean :: !Double

The average value.

samplingStatsMean2 :: !Double

The average square value.

class Num a => SamplingData a where

Specifies data type from which values we can gather the statistics.

Methods

emptySamplingStats :: SamplingStats a

An empty statistics that has no samples.

addSamplingStats :: a -> SamplingStats a -> SamplingStats a

Add a new sample to the statistics.

combineSamplingStats :: SamplingStats a -> SamplingStats a -> SamplingStats a

Combine two statistics.

combineSamplingStatsEither :: SamplingData a => Either a (SamplingStats a) -> SamplingStats a -> SamplingStats a

If allows combining statistics more efficiently if we know that the first argument can be a scalar.

samplingStatsVariance :: SamplingStats a -> Double

Return the variance.

samplingStatsDeviation :: SamplingStats a -> Double

Return the deviation.

samplingStatsSummary :: Show a => SamplingStats a -> Int -> ShowS

Show the summary of the statistics using the specified indent.

returnSamplingStats :: SamplingData a => a -> SamplingStats a

Return the statistics by a single sample.

listSamplingStats :: SamplingData a => [a] -> SamplingStats a

Create the statistics by the specified list of data.

fromIntSamplingStats :: SamplingStats Int -> SamplingStats Double

Convert the statistics from integer to double values.

Timing Statistics

data TimingStats a :: * -> *

This is the timing statistics where data are bound to the time.

Constructors

TimingStats 

Fields

timingStatsCount :: !Int

Return the number of samples.

timingStatsMin :: !a

Return the minimum value.

timingStatsMax :: !a

Return the maximum value.

timingStatsLast :: !a

Return the last value.

timingStatsMinTime :: !Double

Return the time at which the minimum is attained.

timingStatsMaxTime :: !Double

Return the time at which the maximum is attained.

timingStatsStartTime :: !Double

Return the start time of sampling.

timingStatsLastTime :: !Double

Return the last time of sampling.

timingStatsSum :: !Double

Return the sum of values.

timingStatsSum2 :: !Double

Return the sum of square values.

class Num a => TimingData a where

Defines the data type from which values we can gather the timing statistics.

Methods

emptyTimingStats :: TimingStats a

An empty statistics that has no samples.

addTimingStats :: Double -> a -> TimingStats a -> TimingStats a

Add a sample with the specified time to the statistics.

timingStatsMean :: TimingStats a -> Double

Return the average value.

timingStatsMean2 :: TimingStats a -> Double

Return the average square value.

timingStatsVariance :: TimingStats a -> Double

Return the variance.

timingStatsDeviation :: TimingData a => TimingStats a -> Double

Return the deviation.

timingStatsSummary :: (Show a, TimingData a) => TimingStats a -> Int -> ShowS

Show the summary of the statistics using the specified indent.

returnTimingStats :: TimingData a => Double -> a -> TimingStats a

Return the statistics by single timing data.

fromIntTimingStats :: TimingStats Int -> TimingStats Double

Convert the statistics from integer to double values.