convex-base-0.2.0.0: Base classes and types for working with cardano-api transactions
Safe HaskellSafe-Inferred
LanguageHaskell2010

Convex.Measures

Description

Measure that we need for calculating prices

Synopsis

Measures

Mean

data Mean Source #

Arithmetic mean

Constructors

Mean 

Fields

Instances

Instances details
FromJSON Mean Source # 
Instance details

Defined in Convex.Measures

ToJSON Mean Source # 
Instance details

Defined in Convex.Measures

Monoid Mean Source # 
Instance details

Defined in Convex.Measures

Methods

memptyMean Source #

mappendMeanMeanMean Source #

mconcat ∷ [Mean] → Mean Source #

Semigroup Mean Source # 
Instance details

Defined in Convex.Measures

Methods

(<>)MeanMeanMean Source #

sconcatNonEmpty MeanMean Source #

stimesIntegral b ⇒ b → MeanMean Source #

Generic Mean Source # 
Instance details

Defined in Convex.Measures

Associated Types

type Rep MeanTypeType Source #

Methods

fromMeanRep Mean x Source #

toRep Mean x → Mean Source #

Show Mean Source # 
Instance details

Defined in Convex.Measures

Methods

showsPrecIntMeanShowS Source #

showMeanString Source #

showList ∷ [Mean] → ShowS Source #

Eq Mean Source # 
Instance details

Defined in Convex.Measures

Methods

(==)MeanMeanBool Source #

(/=)MeanMeanBool Source #

Ord Mean Source # 
Instance details

Defined in Convex.Measures

Methods

compareMeanMeanOrdering Source #

(<)MeanMeanBool Source #

(<=)MeanMeanBool Source #

(>)MeanMeanBool Source #

(>=)MeanMeanBool Source #

maxMeanMeanMean Source #

minMeanMeanMean Source #

type Rep Mean Source # 
Instance details

Defined in Convex.Measures

type Rep Mean = D1 ('MetaData "Mean" "Convex.Measures" "convex-base-0.2.0.0-inplace" 'False) (C1 ('MetaCons "Mean" 'PrefixI 'True) (S1 ('MetaSel ('Just "mCount") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Natural) :*: S1 ('MetaSel ('Just "mSum") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Integer)))

getMeanMeanMaybe Double Source #

Get the mean if at least one value has been observed

countOneIntegerMean Source #

Count one observation

countManyNaturalIntegerMean Source #

Count many observations of the same value (ie. count the value with a higher weight)

Exponential weighted mean

data ExponentialWeightedMean Source #

Constructors

ExponentialWeightedMean 

Fields

Instances

Instances details
FromJSON ExponentialWeightedMean Source # 
Instance details

Defined in Convex.Measures

ToJSON ExponentialWeightedMean Source # 
Instance details

Defined in Convex.Measures

Generic ExponentialWeightedMean Source # 
Instance details

Defined in Convex.Measures

Associated Types

type Rep ExponentialWeightedMeanTypeType Source #

Show ExponentialWeightedMean Source # 
Instance details

Defined in Convex.Measures

Eq ExponentialWeightedMean Source # 
Instance details

Defined in Convex.Measures

Ord ExponentialWeightedMean Source # 
Instance details

Defined in Convex.Measures

type Rep ExponentialWeightedMean Source # 
Instance details

Defined in Convex.Measures

type Rep ExponentialWeightedMean = D1 ('MetaData "ExponentialWeightedMean" "Convex.Measures" "convex-base-0.2.0.0-inplace" 'False) (C1 ('MetaCons "ExponentialWeightedMean" 'PrefixI 'True) (S1 ('MetaSel ('Just "ewmCount") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Double) :*: S1 ('MetaSel ('Just "ewmSum") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Double)))

countExponentialWeightedMeanDoubleExponentialWeightedMeanMeanExponentialWeightedMean Source #

Add an observation of the Mean to the exp. weighted mean, discounting the past observations by a factor. A good factor is 0.9 or 0.95

getExponentialWeightedMeanExponentialWeightedMeanMaybe Double Source #

Get the exp. weighted mean if at least one value has been observed

Variance

data Variance Source #

Constructors

Variance 

Fields

Instances

Instances details
FromJSON Variance Source # 
Instance details

Defined in Convex.Measures

ToJSON Variance Source # 
Instance details

Defined in Convex.Measures

Generic Variance Source # 
Instance details

Defined in Convex.Measures

Associated Types

type Rep VarianceTypeType Source #

Show Variance Source # 
Instance details

Defined in Convex.Measures

Eq Variance Source # 
Instance details

Defined in Convex.Measures

Ord Variance Source # 
Instance details

Defined in Convex.Measures

type Rep Variance Source # 
Instance details

Defined in Convex.Measures

type Rep Variance = D1 ('MetaData "Variance" "Convex.Measures" "convex-base-0.2.0.0-inplace" 'False) (C1 ('MetaCons "Variance" 'PrefixI 'True) (S1 ('MetaSel ('Just "vMean") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Mean) :*: (S1 ('MetaSel ('Just "vN") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Natural) :*: S1 ('MetaSel ('Just "vM2") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Double))))