SciBaseTypes-0.1.0.0: Base types and classes for statistics, sciences and humanities

Safe HaskellNone
LanguageHaskell2010

Statistics.Odds

Description

Provides newtypes for odds, log-odds, and discretized versions.

TODO This is currently quite ad-hoc and needs better formalization. In particular in terms of wrapping and usage of Num and Semiring.

Synopsis

Documentation

newtype Odds Source #

Odds.

Constructors

Odds 

Fields

Instances
Eq Odds Source # 
Instance details

Defined in Statistics.Odds

Methods

(==) :: Odds -> Odds -> Bool #

(/=) :: Odds -> Odds -> Bool #

Num Odds Source # 
Instance details

Defined in Statistics.Odds

Methods

(+) :: Odds -> Odds -> Odds #

(-) :: Odds -> Odds -> Odds #

(*) :: Odds -> Odds -> Odds #

negate :: Odds -> Odds #

abs :: Odds -> Odds #

signum :: Odds -> Odds #

fromInteger :: Integer -> Odds #

Ord Odds Source # 
Instance details

Defined in Statistics.Odds

Methods

compare :: Odds -> Odds -> Ordering #

(<) :: Odds -> Odds -> Bool #

(<=) :: Odds -> Odds -> Bool #

(>) :: Odds -> Odds -> Bool #

(>=) :: Odds -> Odds -> Bool #

max :: Odds -> Odds -> Odds #

min :: Odds -> Odds -> Odds #

Read Odds Source # 
Instance details

Defined in Statistics.Odds

Show Odds Source # 
Instance details

Defined in Statistics.Odds

Methods

showsPrec :: Int -> Odds -> ShowS #

show :: Odds -> String #

showList :: [Odds] -> ShowS #

Generic Odds Source # 
Instance details

Defined in Statistics.Odds

Associated Types

type Rep Odds :: Type -> Type #

Methods

from :: Odds -> Rep Odds x #

to :: Rep Odds x -> Odds #

Semiring Odds Source # 
Instance details

Defined in Statistics.Odds

Methods

plus :: Odds -> Odds -> Odds #

zero :: Odds #

times :: Odds -> Odds -> Odds #

one :: Odds #

type Rep Odds Source # 
Instance details

Defined in Statistics.Odds

type Rep Odds = D1 (MetaData "Odds" "Statistics.Odds" "SciBaseTypes-0.1.0.0-8v1Wd4dQxf86ztFKnvLSrc" True) (C1 (MetaCons "Odds" PrefixI True) (S1 (MetaSel (Just "getOdds") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Double)))

newtype DiscLogOdds (t :: k) Source #

Encodes log-odds that have been rounded or clamped to integral numbers. One advantage this provides is more efficient "maximum/minimum" calculations compared to using Doubles.

Note that these are "explicit" log-odds. Each numeric operation uses the underlying operation on Int. If you want automatic handling, choose Log Odds.

Constructors

DiscLogOdds 
Instances
Vector Vector (DiscLogOdds t) Source # 
Instance details

Defined in Statistics.Odds

MVector MVector (DiscLogOdds t) Source # 
Instance details

Defined in Statistics.Odds

Eq (DiscLogOdds t) Source # 
Instance details

Defined in Statistics.Odds

Num (Discretized t) => Num (DiscLogOdds t) Source # 
Instance details

Defined in Statistics.Odds

Ord (DiscLogOdds t) Source # 
Instance details

Defined in Statistics.Odds

Read (DiscLogOdds t) Source # 
Instance details

Defined in Statistics.Odds

Show (DiscLogOdds t) Source # 
Instance details

Defined in Statistics.Odds

Generic (DiscLogOdds t) Source # 
Instance details

Defined in Statistics.Odds

Associated Types

type Rep (DiscLogOdds t) :: Type -> Type #

Methods

from :: DiscLogOdds t -> Rep (DiscLogOdds t) x #

to :: Rep (DiscLogOdds t) x -> DiscLogOdds t #

Hashable (DiscLogOdds t) Source # 
Instance details

Defined in Statistics.Odds

Methods

hashWithSalt :: Int -> DiscLogOdds t -> Int #

hash :: DiscLogOdds t -> Int #

ToJSON (DiscLogOdds t) Source # 
Instance details

Defined in Statistics.Odds

FromJSON (DiscLogOdds t) Source # 
Instance details

Defined in Statistics.Odds

Binary (DiscLogOdds t) Source # 
Instance details

Defined in Statistics.Odds

Methods

put :: DiscLogOdds t -> Put #

get :: Get (DiscLogOdds t) #

putList :: [DiscLogOdds t] -> Put #

Serialize (DiscLogOdds t) Source # 
Instance details

Defined in Statistics.Odds

Methods

put :: Putter (DiscLogOdds t) #

get :: Get (DiscLogOdds t) #

NFData (Discretized t) => NFData (DiscLogOdds t) Source # 
Instance details

Defined in Statistics.Odds

Methods

rnf :: DiscLogOdds t -> () #

Unbox (DiscLogOdds t) Source # 
Instance details

Defined in Statistics.Odds

Semiring (Discretized t) => Semiring (DiscLogOdds t) Source # 
Instance details

Defined in Statistics.Odds

NumericLimits (Discretized t) => NumericLimits (DiscLogOdds t) Source # 
Instance details

Defined in Statistics.Odds

newtype MVector s (DiscLogOdds t) Source # 
Instance details

Defined in Statistics.Odds

type Rep (DiscLogOdds t) Source # 
Instance details

Defined in Statistics.Odds

type Rep (DiscLogOdds t) = D1 (MetaData "DiscLogOdds" "Statistics.Odds" "SciBaseTypes-0.1.0.0-8v1Wd4dQxf86ztFKnvLSrc" True) (C1 (MetaCons "DiscLogOdds" PrefixI True) (S1 (MetaSel (Just "getDiscLogOdds") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Discretized t))))
newtype Vector (DiscLogOdds t) Source # 
Instance details

Defined in Statistics.Odds