Copyright | (c) 2009 Bryan O'Sullivan |
---|---|
License | BSD3 |
Maintainer | bos@serpentine.com |
Stability | experimental |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
Statistics.Types
Description
Data types common used in statistics
Synopsis
- data CL a
- confidenceLevel :: Num a => CL a -> a
- significanceLevel :: CL a -> a
- mkCL :: (Ord a, Num a) => a -> CL a
- mkCLE :: (Ord a, Num a) => a -> Maybe (CL a)
- mkCLFromSignificance :: (Ord a, Num a) => a -> CL a
- mkCLFromSignificanceE :: (Ord a, Num a) => a -> Maybe (CL a)
- cl90 :: Fractional a => CL a
- cl95 :: Fractional a => CL a
- cl99 :: Fractional a => CL a
- nSigma :: Double -> PValue Double
- nSigma1 :: Double -> PValue Double
- getNSigma :: PValue Double -> Double
- getNSigma1 :: PValue Double -> Double
- data PValue a
- pValue :: PValue a -> a
- mkPValue :: (Ord a, Num a) => a -> PValue a
- mkPValueE :: (Ord a, Num a) => a -> Maybe (PValue a)
- data Estimate (e :: Type -> Type) a = Estimate {}
- newtype NormalErr a = NormalErr {
- normalError :: a
- data ConfInt a = ConfInt {
- confIntLDX :: !a
- confIntUDX :: !a
- confIntCL :: !(CL Double)
- data UpperLimit a = UpperLimit {
- upperLimit :: !a
- ulConfidenceLevel :: !(CL Double)
- data LowerLimit a = LowerLimit {
- lowerLimit :: !a
- llConfidenceLevel :: !(CL Double)
- estimateNormErr :: a -> a -> Estimate NormalErr a
- (±) :: a -> a -> Estimate NormalErr a
- estimateFromInterval :: Num a => a -> (a, a) -> CL Double -> Estimate ConfInt a
- estimateFromErr :: a -> (a, a) -> CL Double -> Estimate ConfInt a
- confidenceInterval :: Num a => Estimate ConfInt a -> (a, a)
- asymErrors :: Estimate ConfInt a -> (a, a)
- class Scale (e :: Type -> Type) where
- scale :: (Ord a, Num a) => a -> e a -> e a
- type Sample = Vector Double
- type WeightedSample = Vector (Double, Double)
- type Weights = Vector Double
Confidence level
Confidence level. In context of confidence intervals it's
probability of said interval covering true value of measured
value. In context of statistical tests it's 1-α
where α is
significance of test.
Since confidence level are usually close to 1 they are stored as
1-CL
internally. There are two smart constructors for CL
:
mkCL
and mkCLFromSignificance
(and corresponding variant
returning Maybe
). First creates CL
from confidence level and
second from 1 - CL
or significance level.
>>>
cl95
mkCLFromSignificance 0.05
Prior to 0.14 confidence levels were passed to function as plain
Doubles
. Use mkCL
to convert them to CL
.
Instances
Unbox a => Vector Vector (CL a) Source # | |||||
Defined in Statistics.Types Methods basicUnsafeFreeze :: Mutable Vector s (CL a) -> ST s (Vector (CL a)) basicUnsafeThaw :: Vector (CL a) -> ST s (Mutable Vector s (CL a)) basicLength :: Vector (CL a) -> Int basicUnsafeSlice :: Int -> Int -> Vector (CL a) -> Vector (CL a) basicUnsafeIndexM :: Vector (CL a) -> Int -> Box (CL a) basicUnsafeCopy :: Mutable Vector s (CL a) -> Vector (CL a) -> ST s () | |||||
Unbox a => MVector MVector (CL a) Source # | |||||
Defined in Statistics.Types Methods basicLength :: MVector s (CL a) -> Int basicUnsafeSlice :: Int -> Int -> MVector s (CL a) -> MVector s (CL a) basicOverlaps :: MVector s (CL a) -> MVector s (CL a) -> Bool basicUnsafeNew :: Int -> ST s (MVector s (CL a)) basicInitialize :: MVector s (CL a) -> ST s () basicUnsafeReplicate :: Int -> CL a -> ST s (MVector s (CL a)) basicUnsafeRead :: MVector s (CL a) -> Int -> ST s (CL a) basicUnsafeWrite :: MVector s (CL a) -> Int -> CL a -> ST s () basicClear :: MVector s (CL a) -> ST s () basicSet :: MVector s (CL a) -> CL a -> ST s () basicUnsafeCopy :: MVector s (CL a) -> MVector s (CL a) -> ST s () basicUnsafeMove :: MVector s (CL a) -> MVector s (CL a) -> ST s () basicUnsafeGrow :: MVector s (CL a) -> Int -> ST s (MVector s (CL a)) | |||||
(FromJSON a, Num a, Ord a) => FromJSON (CL a) Source # | |||||
Defined in Statistics.Types Methods parseJSON :: Value -> Parser (CL a) parseJSONList :: Value -> Parser [CL a] omittedField :: Maybe (CL a) | |||||
ToJSON a => ToJSON (CL a) Source # | |||||
Defined in Statistics.Types Methods toEncoding :: CL a -> Encoding toJSONList :: [CL a] -> Value toEncodingList :: [CL a] -> Encoding | |||||
Data a => Data (CL a) Source # | |||||
Defined in Statistics.Types Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> CL a -> c (CL a) gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (CL a) dataTypeOf :: CL a -> DataType dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (CL a)) dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (CL a)) gmapT :: (forall b. Data b => b -> b) -> CL a -> CL a gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> CL a -> r gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> CL a -> r gmapQ :: (forall d. Data d => d -> u) -> CL a -> [u] gmapQi :: Int -> (forall d. Data d => d -> u) -> CL a -> u gmapM :: Monad m => (forall d. Data d => d -> m d) -> CL a -> m (CL a) gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> CL a -> m (CL a) gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> CL a -> m (CL a) | |||||
Generic (CL a) Source # | |||||
Defined in Statistics.Types Associated Types
| |||||
(Num a, Ord a, Read a) => Read (CL a) Source # | |||||
Defined in Statistics.Types | |||||
Show a => Show (CL a) Source # | |||||
(Binary a, Num a, Ord a) => Binary (CL a) Source # | |||||
NFData a => NFData (CL a) Source # | |||||
Defined in Statistics.Types | |||||
Eq a => Eq (CL a) Source # | |||||
Ord a => Ord (CL a) Source # |
| ||||
Unbox a => Unbox (CL a) Source # | |||||
Defined in Statistics.Types | |||||
newtype MVector s (CL a) Source # | |||||
Defined in Statistics.Types | |||||
type Rep (CL a) Source # | |||||
Defined in Statistics.Types type Rep (CL a) = D1 ('MetaData "CL" "Statistics.Types" "statistics-0.16.2.1-GC0UmpORwJ8SU4BdSiJEf" 'True) (C1 ('MetaCons "CL" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a))) | |||||
newtype Vector (CL a) Source # | |||||
Defined in Statistics.Types |
Accessors
confidenceLevel :: Num a => CL a -> a Source #
Get confidence level. This function is subject to rounding
errors. If 1 - CL
is needed use significanceLevel
instead
significanceLevel :: CL a -> a Source #
Get significance level.
Constructors
mkCL :: (Ord a, Num a) => a -> CL a Source #
Create confidence level from probability β or probability confidence interval contain true value of estimate. Will throw exception if parameter is out of [0,1] range
>>>
mkCL 0.95 -- same as cl95
mkCLFromSignificance 0.05
mkCLE :: (Ord a, Num a) => a -> Maybe (CL a) Source #
Same as mkCL
but returns Nothing
instead of error if
parameter is out of [0,1] range
>>>
mkCLE 0.95 -- same as cl95
Just (mkCLFromSignificance 0.05)
mkCLFromSignificance :: (Ord a, Num a) => a -> CL a Source #
Create confidence level from probability α or probability that confidence interval does not contain true value of estimate. Will throw exception if parameter is out of [0,1] range
>>>
mkCLFromSignificance 0.05 -- same as cl95
mkCLFromSignificance 0.05
mkCLFromSignificanceE :: (Ord a, Num a) => a -> Maybe (CL a) Source #
Same as mkCLFromSignificance
but returns Nothing
instead of error if
parameter is out of [0,1] range
>>>
mkCLFromSignificanceE 0.05 -- same as cl95
Just (mkCLFromSignificance 0.05)
Constants and conversion to nσ
Normal approximation
nSigma :: Double -> PValue Double Source #
P-value expressed in sigma. This is convention widely used in experimental physics. N sigma confidence level corresponds to probability within N sigma of normal distribution.
Note that this correspondence is for normal distribution. Other distribution will have different dependency. Also experimental distribution usually only approximately normal (especially at extreme tails).
nSigma1 :: Double -> PValue Double Source #
P-value expressed in sigma for one-tail hypothesis. This correspond to
probability of obtaining value less than N·σ
.
getNSigma1 :: PValue Double -> Double Source #
Express confidence level in sigmas for one-tailed hypothesis.
p-value
Newtype wrapper for p-value.
Instances
Unbox a => Vector Vector (PValue a) Source # | |||||
Defined in Statistics.Types Methods basicUnsafeFreeze :: Mutable Vector s (PValue a) -> ST s (Vector (PValue a)) basicUnsafeThaw :: Vector (PValue a) -> ST s (Mutable Vector s (PValue a)) basicLength :: Vector (PValue a) -> Int basicUnsafeSlice :: Int -> Int -> Vector (PValue a) -> Vector (PValue a) basicUnsafeIndexM :: Vector (PValue a) -> Int -> Box (PValue a) basicUnsafeCopy :: Mutable Vector s (PValue a) -> Vector (PValue a) -> ST s () | |||||
Unbox a => MVector MVector (PValue a) Source # | |||||
Defined in Statistics.Types Methods basicLength :: MVector s (PValue a) -> Int basicUnsafeSlice :: Int -> Int -> MVector s (PValue a) -> MVector s (PValue a) basicOverlaps :: MVector s (PValue a) -> MVector s (PValue a) -> Bool basicUnsafeNew :: Int -> ST s (MVector s (PValue a)) basicInitialize :: MVector s (PValue a) -> ST s () basicUnsafeReplicate :: Int -> PValue a -> ST s (MVector s (PValue a)) basicUnsafeRead :: MVector s (PValue a) -> Int -> ST s (PValue a) basicUnsafeWrite :: MVector s (PValue a) -> Int -> PValue a -> ST s () basicClear :: MVector s (PValue a) -> ST s () basicSet :: MVector s (PValue a) -> PValue a -> ST s () basicUnsafeCopy :: MVector s (PValue a) -> MVector s (PValue a) -> ST s () basicUnsafeMove :: MVector s (PValue a) -> MVector s (PValue a) -> ST s () basicUnsafeGrow :: MVector s (PValue a) -> Int -> ST s (MVector s (PValue a)) | |||||
(FromJSON a, Num a, Ord a) => FromJSON (PValue a) Source # | |||||
Defined in Statistics.Types Methods parseJSON :: Value -> Parser (PValue a) parseJSONList :: Value -> Parser [PValue a] omittedField :: Maybe (PValue a) | |||||
ToJSON a => ToJSON (PValue a) Source # | |||||
Defined in Statistics.Types Methods toEncoding :: PValue a -> Encoding toJSONList :: [PValue a] -> Value toEncodingList :: [PValue a] -> Encoding | |||||
Data a => Data (PValue a) Source # | |||||
Defined in Statistics.Types Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> PValue a -> c (PValue a) gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (PValue a) toConstr :: PValue a -> Constr dataTypeOf :: PValue a -> DataType dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (PValue a)) dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (PValue a)) gmapT :: (forall b. Data b => b -> b) -> PValue a -> PValue a gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> PValue a -> r gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> PValue a -> r gmapQ :: (forall d. Data d => d -> u) -> PValue a -> [u] gmapQi :: Int -> (forall d. Data d => d -> u) -> PValue a -> u gmapM :: Monad m => (forall d. Data d => d -> m d) -> PValue a -> m (PValue a) gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> PValue a -> m (PValue a) gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> PValue a -> m (PValue a) | |||||
Generic (PValue a) Source # | |||||
Defined in Statistics.Types Associated Types
| |||||
(Num a, Ord a, Read a) => Read (PValue a) Source # | |||||
Defined in Statistics.Types | |||||
Show a => Show (PValue a) Source # | |||||
(Binary a, Num a, Ord a) => Binary (PValue a) Source # | |||||
NFData a => NFData (PValue a) Source # | |||||
Defined in Statistics.Types | |||||
Eq a => Eq (PValue a) Source # | |||||
Ord a => Ord (PValue a) Source # | |||||
Unbox a => Unbox (PValue a) Source # | |||||
Defined in Statistics.Types | |||||
newtype MVector s (PValue a) Source # | |||||
Defined in Statistics.Types | |||||
type Rep (PValue a) Source # | |||||
Defined in Statistics.Types type Rep (PValue a) = D1 ('MetaData "PValue" "Statistics.Types" "statistics-0.16.2.1-GC0UmpORwJ8SU4BdSiJEf" 'True) (C1 ('MetaCons "PValue" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a))) | |||||
newtype Vector (PValue a) Source # | |||||
Defined in Statistics.Types |
Accessors
Constructors
mkPValue :: (Ord a, Num a) => a -> PValue a Source #
Construct PValue. Throws error if argument is out of [0,1] range.
mkPValueE :: (Ord a, Num a) => a -> Maybe (PValue a) Source #
Construct PValue. Returns Nothing
if argument is out of [0,1] range.
Estimates and upper/lower limits
data Estimate (e :: Type -> Type) a Source #
A point estimate and its confidence interval. It's parametrized by
both error type e
and value type a
. This module provides two
types of error: NormalErr
for normally distributed errors and
ConfInt
for error with normal distribution. See their
documentation for more details.
For example 144 ± 5
(assuming normality) could be expressed as
Estimate { estPoint = 144 , estError = NormalErr 5 }
Or if we want to express 144 + 6 - 4
at CL95 we could write:
Estimate { estPoint = 144 , estError = ConfInt { confIntLDX = 4 , confIntUDX = 6 , confIntCL = cl95 }
Prior to statistics 0.14 Estimate
data type used following definition:
data Estimate = Estimate { estPoint :: {-# UNPACK #-} !Double , estLowerBound :: {-# UNPACK #-} !Double , estUpperBound :: {-# UNPACK #-} !Double , estConfidenceLevel :: {-# UNPACK #-} !Double }
Now type Estimate ConfInt Double
should be used instead. Function
estimateFromInterval
allow to easily construct estimate from same inputs.
Constructors
Estimate | |
Instances
(Unbox a, Unbox (e a)) => Vector Vector (Estimate e a) Source # | |||||
Defined in Statistics.Types Methods basicUnsafeFreeze :: Mutable Vector s (Estimate e a) -> ST s (Vector (Estimate e a)) basicUnsafeThaw :: Vector (Estimate e a) -> ST s (Mutable Vector s (Estimate e a)) basicLength :: Vector (Estimate e a) -> Int basicUnsafeSlice :: Int -> Int -> Vector (Estimate e a) -> Vector (Estimate e a) basicUnsafeIndexM :: Vector (Estimate e a) -> Int -> Box (Estimate e a) basicUnsafeCopy :: Mutable Vector s (Estimate e a) -> Vector (Estimate e a) -> ST s () | |||||
(Unbox a, Unbox (e a)) => MVector MVector (Estimate e a) Source # | |||||
Defined in Statistics.Types Methods basicLength :: MVector s (Estimate e a) -> Int basicUnsafeSlice :: Int -> Int -> MVector s (Estimate e a) -> MVector s (Estimate e a) basicOverlaps :: MVector s (Estimate e a) -> MVector s (Estimate e a) -> Bool basicUnsafeNew :: Int -> ST s (MVector s (Estimate e a)) basicInitialize :: MVector s (Estimate e a) -> ST s () basicUnsafeReplicate :: Int -> Estimate e a -> ST s (MVector s (Estimate e a)) basicUnsafeRead :: MVector s (Estimate e a) -> Int -> ST s (Estimate e a) basicUnsafeWrite :: MVector s (Estimate e a) -> Int -> Estimate e a -> ST s () basicClear :: MVector s (Estimate e a) -> ST s () basicSet :: MVector s (Estimate e a) -> Estimate e a -> ST s () basicUnsafeCopy :: MVector s (Estimate e a) -> MVector s (Estimate e a) -> ST s () basicUnsafeMove :: MVector s (Estimate e a) -> MVector s (Estimate e a) -> ST s () basicUnsafeGrow :: MVector s (Estimate e a) -> Int -> ST s (MVector s (Estimate e a)) | |||||
Scale e => Scale (Estimate e) Source # | |||||
(FromJSON (e a), FromJSON a) => FromJSON (Estimate e a) Source # | |||||
Defined in Statistics.Types Methods parseJSON :: Value -> Parser (Estimate e a) parseJSONList :: Value -> Parser [Estimate e a] omittedField :: Maybe (Estimate e a) | |||||
(ToJSON (e a), ToJSON a) => ToJSON (Estimate e a) Source # | |||||
Defined in Statistics.Types Methods toJSON :: Estimate e a -> Value toEncoding :: Estimate e a -> Encoding toJSONList :: [Estimate e a] -> Value toEncodingList :: [Estimate e a] -> Encoding | |||||
(Typeable e, Data a, Data (e a)) => Data (Estimate e a) Source # | |||||
Defined in Statistics.Types Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Estimate e a -> c (Estimate e a) gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Estimate e a) toConstr :: Estimate e a -> Constr dataTypeOf :: Estimate e a -> DataType dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Estimate e a)) dataCast2 :: Typeable t => (forall d e0. (Data d, Data e0) => c (t d e0)) -> Maybe (c (Estimate e a)) gmapT :: (forall b. Data b => b -> b) -> Estimate e a -> Estimate e a gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Estimate e a -> r gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Estimate e a -> r gmapQ :: (forall d. Data d => d -> u) -> Estimate e a -> [u] gmapQi :: Int -> (forall d. Data d => d -> u) -> Estimate e a -> u gmapM :: Monad m => (forall d. Data d => d -> m d) -> Estimate e a -> m (Estimate e a) gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Estimate e a -> m (Estimate e a) gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Estimate e a -> m (Estimate e a) | |||||
Generic (Estimate e a) Source # | |||||
Defined in Statistics.Types Associated Types
| |||||
(Read a, Read (e a)) => Read (Estimate e a) Source # | |||||
Defined in Statistics.Types | |||||
(Show a, Show (e a)) => Show (Estimate e a) Source # | |||||
(Binary (e a), Binary a) => Binary (Estimate e a) Source # | |||||
(NFData (e a), NFData a) => NFData (Estimate e a) Source # | |||||
Defined in Statistics.Types | |||||
(Eq a, Eq (e a)) => Eq (Estimate e a) Source # | |||||
(Unbox a, Unbox (e a)) => Unbox (Estimate e a) Source # | |||||
Defined in Statistics.Types | |||||
newtype MVector s (Estimate e a) Source # | |||||
Defined in Statistics.Types | |||||
type Rep (Estimate e a) Source # | |||||
Defined in Statistics.Types type Rep (Estimate e a) = D1 ('MetaData "Estimate" "Statistics.Types" "statistics-0.16.2.1-GC0UmpORwJ8SU4BdSiJEf" 'False) (C1 ('MetaCons "Estimate" 'PrefixI 'True) (S1 ('MetaSel ('Just "estPoint") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 a) :*: S1 ('MetaSel ('Just "estError") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (e a)))) | |||||
newtype Vector (Estimate e a) Source # | |||||
Defined in Statistics.Types |
Normal errors. They are stored as 1σ errors which corresponds to 68.8% CL. Since we can recalculate them to any confidence level if needed we don't store it.
Constructors
NormalErr | |
Fields
|
Instances
Scale NormalErr Source # | |||||
Unbox a => Vector Vector (NormalErr a) Source # | |||||
Defined in Statistics.Types Methods basicUnsafeFreeze :: Mutable Vector s (NormalErr a) -> ST s (Vector (NormalErr a)) basicUnsafeThaw :: Vector (NormalErr a) -> ST s (Mutable Vector s (NormalErr a)) basicLength :: Vector (NormalErr a) -> Int basicUnsafeSlice :: Int -> Int -> Vector (NormalErr a) -> Vector (NormalErr a) basicUnsafeIndexM :: Vector (NormalErr a) -> Int -> Box (NormalErr a) basicUnsafeCopy :: Mutable Vector s (NormalErr a) -> Vector (NormalErr a) -> ST s () | |||||
Unbox a => MVector MVector (NormalErr a) Source # | |||||
Defined in Statistics.Types Methods basicLength :: MVector s (NormalErr a) -> Int basicUnsafeSlice :: Int -> Int -> MVector s (NormalErr a) -> MVector s (NormalErr a) basicOverlaps :: MVector s (NormalErr a) -> MVector s (NormalErr a) -> Bool basicUnsafeNew :: Int -> ST s (MVector s (NormalErr a)) basicInitialize :: MVector s (NormalErr a) -> ST s () basicUnsafeReplicate :: Int -> NormalErr a -> ST s (MVector s (NormalErr a)) basicUnsafeRead :: MVector s (NormalErr a) -> Int -> ST s (NormalErr a) basicUnsafeWrite :: MVector s (NormalErr a) -> Int -> NormalErr a -> ST s () basicClear :: MVector s (NormalErr a) -> ST s () basicSet :: MVector s (NormalErr a) -> NormalErr a -> ST s () basicUnsafeCopy :: MVector s (NormalErr a) -> MVector s (NormalErr a) -> ST s () basicUnsafeMove :: MVector s (NormalErr a) -> MVector s (NormalErr a) -> ST s () basicUnsafeGrow :: MVector s (NormalErr a) -> Int -> ST s (MVector s (NormalErr a)) | |||||
FromJSON a => FromJSON (NormalErr a) Source # | |||||
Defined in Statistics.Types Methods parseJSON :: Value -> Parser (NormalErr a) parseJSONList :: Value -> Parser [NormalErr a] omittedField :: Maybe (NormalErr a) | |||||
ToJSON a => ToJSON (NormalErr a) Source # | |||||
Defined in Statistics.Types Methods toJSON :: NormalErr a -> Value toEncoding :: NormalErr a -> Encoding toJSONList :: [NormalErr a] -> Value toEncodingList :: [NormalErr a] -> Encoding | |||||
Data a => Data (NormalErr a) Source # | |||||
Defined in Statistics.Types Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> NormalErr a -> c (NormalErr a) gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (NormalErr a) toConstr :: NormalErr a -> Constr dataTypeOf :: NormalErr a -> DataType dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (NormalErr a)) dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (NormalErr a)) gmapT :: (forall b. Data b => b -> b) -> NormalErr a -> NormalErr a gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> NormalErr a -> r gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> NormalErr a -> r gmapQ :: (forall d. Data d => d -> u) -> NormalErr a -> [u] gmapQi :: Int -> (forall d. Data d => d -> u) -> NormalErr a -> u gmapM :: Monad m => (forall d. Data d => d -> m d) -> NormalErr a -> m (NormalErr a) gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> NormalErr a -> m (NormalErr a) gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> NormalErr a -> m (NormalErr a) | |||||
Generic (NormalErr a) Source # | |||||
Defined in Statistics.Types Associated Types
| |||||
Read a => Read (NormalErr a) Source # | |||||
Defined in Statistics.Types | |||||
Show a => Show (NormalErr a) Source # | |||||
Binary a => Binary (NormalErr a) Source # | |||||
NFData a => NFData (NormalErr a) Source # | |||||
Defined in Statistics.Types | |||||
Eq a => Eq (NormalErr a) Source # | |||||
Unbox a => Unbox (NormalErr a) Source # | |||||
Defined in Statistics.Types | |||||
newtype MVector s (NormalErr a) Source # | |||||
Defined in Statistics.Types | |||||
type Rep (NormalErr a) Source # | |||||
Defined in Statistics.Types type Rep (NormalErr a) = D1 ('MetaData "NormalErr" "Statistics.Types" "statistics-0.16.2.1-GC0UmpORwJ8SU4BdSiJEf" 'True) (C1 ('MetaCons "NormalErr" 'PrefixI 'True) (S1 ('MetaSel ('Just "normalError") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a))) | |||||
newtype Vector (NormalErr a) Source # | |||||
Defined in Statistics.Types |
Confidence interval. It assumes that confidence interval forms single interval and isn't set of disjoint intervals.
Constructors
ConfInt | |
Fields
|
Instances
Scale ConfInt Source # | |||||
Unbox a => Vector Vector (ConfInt a) Source # | |||||
Defined in Statistics.Types Methods basicUnsafeFreeze :: Mutable Vector s (ConfInt a) -> ST s (Vector (ConfInt a)) basicUnsafeThaw :: Vector (ConfInt a) -> ST s (Mutable Vector s (ConfInt a)) basicLength :: Vector (ConfInt a) -> Int basicUnsafeSlice :: Int -> Int -> Vector (ConfInt a) -> Vector (ConfInt a) basicUnsafeIndexM :: Vector (ConfInt a) -> Int -> Box (ConfInt a) basicUnsafeCopy :: Mutable Vector s (ConfInt a) -> Vector (ConfInt a) -> ST s () | |||||
Unbox a => MVector MVector (ConfInt a) Source # | |||||
Defined in Statistics.Types Methods basicLength :: MVector s (ConfInt a) -> Int basicUnsafeSlice :: Int -> Int -> MVector s (ConfInt a) -> MVector s (ConfInt a) basicOverlaps :: MVector s (ConfInt a) -> MVector s (ConfInt a) -> Bool basicUnsafeNew :: Int -> ST s (MVector s (ConfInt a)) basicInitialize :: MVector s (ConfInt a) -> ST s () basicUnsafeReplicate :: Int -> ConfInt a -> ST s (MVector s (ConfInt a)) basicUnsafeRead :: MVector s (ConfInt a) -> Int -> ST s (ConfInt a) basicUnsafeWrite :: MVector s (ConfInt a) -> Int -> ConfInt a -> ST s () basicClear :: MVector s (ConfInt a) -> ST s () basicSet :: MVector s (ConfInt a) -> ConfInt a -> ST s () basicUnsafeCopy :: MVector s (ConfInt a) -> MVector s (ConfInt a) -> ST s () basicUnsafeMove :: MVector s (ConfInt a) -> MVector s (ConfInt a) -> ST s () basicUnsafeGrow :: MVector s (ConfInt a) -> Int -> ST s (MVector s (ConfInt a)) | |||||
FromJSON a => FromJSON (ConfInt a) Source # | |||||
Defined in Statistics.Types Methods parseJSON :: Value -> Parser (ConfInt a) parseJSONList :: Value -> Parser [ConfInt a] omittedField :: Maybe (ConfInt a) | |||||
ToJSON a => ToJSON (ConfInt a) Source # | |||||
Defined in Statistics.Types Methods toEncoding :: ConfInt a -> Encoding toJSONList :: [ConfInt a] -> Value toEncodingList :: [ConfInt a] -> Encoding | |||||
Data a => Data (ConfInt a) Source # | |||||
Defined in Statistics.Types Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ConfInt a -> c (ConfInt a) gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (ConfInt a) toConstr :: ConfInt a -> Constr dataTypeOf :: ConfInt a -> DataType dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (ConfInt a)) dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (ConfInt a)) gmapT :: (forall b. Data b => b -> b) -> ConfInt a -> ConfInt a gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ConfInt a -> r gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ConfInt a -> r gmapQ :: (forall d. Data d => d -> u) -> ConfInt a -> [u] gmapQi :: Int -> (forall d. Data d => d -> u) -> ConfInt a -> u gmapM :: Monad m => (forall d. Data d => d -> m d) -> ConfInt a -> m (ConfInt a) gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ConfInt a -> m (ConfInt a) gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ConfInt a -> m (ConfInt a) | |||||
Generic (ConfInt a) Source # | |||||
Defined in Statistics.Types Associated Types
| |||||
Read a => Read (ConfInt a) Source # | |||||
Defined in Statistics.Types | |||||
Show a => Show (ConfInt a) Source # | |||||
Binary a => Binary (ConfInt a) Source # | |||||
NFData a => NFData (ConfInt a) Source # | |||||
Defined in Statistics.Types | |||||
Eq a => Eq (ConfInt a) Source # | |||||
Unbox a => Unbox (ConfInt a) Source # | |||||
Defined in Statistics.Types | |||||
newtype MVector s (ConfInt a) Source # | |||||
Defined in Statistics.Types | |||||
type Rep (ConfInt a) Source # | |||||
Defined in Statistics.Types type Rep (ConfInt a) = D1 ('MetaData "ConfInt" "Statistics.Types" "statistics-0.16.2.1-GC0UmpORwJ8SU4BdSiJEf" 'False) (C1 ('MetaCons "ConfInt" 'PrefixI 'True) (S1 ('MetaSel ('Just "confIntLDX") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 a) :*: (S1 ('MetaSel ('Just "confIntUDX") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 a) :*: S1 ('MetaSel ('Just "confIntCL") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (CL Double))))) | |||||
newtype Vector (ConfInt a) Source # | |||||
Defined in Statistics.Types |
data UpperLimit a Source #
Upper limit. They are usually given for small non-negative values when it's not possible detect difference from zero.
Constructors
UpperLimit | |
Fields
|
Instances
Unbox a => Vector Vector (UpperLimit a) Source # | |||||
Defined in Statistics.Types Methods basicUnsafeFreeze :: Mutable Vector s (UpperLimit a) -> ST s (Vector (UpperLimit a)) basicUnsafeThaw :: Vector (UpperLimit a) -> ST s (Mutable Vector s (UpperLimit a)) basicLength :: Vector (UpperLimit a) -> Int basicUnsafeSlice :: Int -> Int -> Vector (UpperLimit a) -> Vector (UpperLimit a) basicUnsafeIndexM :: Vector (UpperLimit a) -> Int -> Box (UpperLimit a) basicUnsafeCopy :: Mutable Vector s (UpperLimit a) -> Vector (UpperLimit a) -> ST s () elemseq :: Vector (UpperLimit a) -> UpperLimit a -> b -> b | |||||
Unbox a => MVector MVector (UpperLimit a) Source # | |||||
Defined in Statistics.Types Methods basicLength :: MVector s (UpperLimit a) -> Int basicUnsafeSlice :: Int -> Int -> MVector s (UpperLimit a) -> MVector s (UpperLimit a) basicOverlaps :: MVector s (UpperLimit a) -> MVector s (UpperLimit a) -> Bool basicUnsafeNew :: Int -> ST s (MVector s (UpperLimit a)) basicInitialize :: MVector s (UpperLimit a) -> ST s () basicUnsafeReplicate :: Int -> UpperLimit a -> ST s (MVector s (UpperLimit a)) basicUnsafeRead :: MVector s (UpperLimit a) -> Int -> ST s (UpperLimit a) basicUnsafeWrite :: MVector s (UpperLimit a) -> Int -> UpperLimit a -> ST s () basicClear :: MVector s (UpperLimit a) -> ST s () basicSet :: MVector s (UpperLimit a) -> UpperLimit a -> ST s () basicUnsafeCopy :: MVector s (UpperLimit a) -> MVector s (UpperLimit a) -> ST s () basicUnsafeMove :: MVector s (UpperLimit a) -> MVector s (UpperLimit a) -> ST s () basicUnsafeGrow :: MVector s (UpperLimit a) -> Int -> ST s (MVector s (UpperLimit a)) | |||||
FromJSON a => FromJSON (UpperLimit a) Source # | |||||
Defined in Statistics.Types Methods parseJSON :: Value -> Parser (UpperLimit a) parseJSONList :: Value -> Parser [UpperLimit a] omittedField :: Maybe (UpperLimit a) | |||||
ToJSON a => ToJSON (UpperLimit a) Source # | |||||
Defined in Statistics.Types Methods toJSON :: UpperLimit a -> Value toEncoding :: UpperLimit a -> Encoding toJSONList :: [UpperLimit a] -> Value toEncodingList :: [UpperLimit a] -> Encoding omitField :: UpperLimit a -> Bool | |||||
Data a => Data (UpperLimit a) Source # | |||||
Defined in Statistics.Types Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> UpperLimit a -> c (UpperLimit a) gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (UpperLimit a) toConstr :: UpperLimit a -> Constr dataTypeOf :: UpperLimit a -> DataType dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (UpperLimit a)) dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (UpperLimit a)) gmapT :: (forall b. Data b => b -> b) -> UpperLimit a -> UpperLimit a gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> UpperLimit a -> r gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> UpperLimit a -> r gmapQ :: (forall d. Data d => d -> u) -> UpperLimit a -> [u] gmapQi :: Int -> (forall d. Data d => d -> u) -> UpperLimit a -> u gmapM :: Monad m => (forall d. Data d => d -> m d) -> UpperLimit a -> m (UpperLimit a) gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> UpperLimit a -> m (UpperLimit a) gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> UpperLimit a -> m (UpperLimit a) | |||||
Generic (UpperLimit a) Source # | |||||
Defined in Statistics.Types Associated Types
| |||||
Read a => Read (UpperLimit a) Source # | |||||
Defined in Statistics.Types Methods readsPrec :: Int -> ReadS (UpperLimit a) readList :: ReadS [UpperLimit a] readPrec :: ReadPrec (UpperLimit a) readListPrec :: ReadPrec [UpperLimit a] | |||||
Show a => Show (UpperLimit a) Source # | |||||
Defined in Statistics.Types Methods showsPrec :: Int -> UpperLimit a -> ShowS show :: UpperLimit a -> String showList :: [UpperLimit a] -> ShowS | |||||
Binary a => Binary (UpperLimit a) Source # | |||||
Defined in Statistics.Types | |||||
NFData a => NFData (UpperLimit a) Source # | |||||
Defined in Statistics.Types Methods rnf :: UpperLimit a -> () | |||||
Eq a => Eq (UpperLimit a) Source # | |||||
Defined in Statistics.Types | |||||
Unbox a => Unbox (UpperLimit a) Source # | |||||
Defined in Statistics.Types | |||||
newtype MVector s (UpperLimit a) Source # | |||||
Defined in Statistics.Types | |||||
type Rep (UpperLimit a) Source # | |||||
Defined in Statistics.Types type Rep (UpperLimit a) = D1 ('MetaData "UpperLimit" "Statistics.Types" "statistics-0.16.2.1-GC0UmpORwJ8SU4BdSiJEf" 'False) (C1 ('MetaCons "UpperLimit" 'PrefixI 'True) (S1 ('MetaSel ('Just "upperLimit") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 a) :*: S1 ('MetaSel ('Just "ulConfidenceLevel") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (CL Double)))) | |||||
newtype Vector (UpperLimit a) Source # | |||||
Defined in Statistics.Types |
data LowerLimit a Source #
Lower limit. They are usually given for large quantities when it's not possible to measure them. For example: proton half-life
Constructors
LowerLimit | |
Fields
|
Instances
Unbox a => Vector Vector (LowerLimit a) Source # | |||||
Defined in Statistics.Types Methods basicUnsafeFreeze :: Mutable Vector s (LowerLimit a) -> ST s (Vector (LowerLimit a)) basicUnsafeThaw :: Vector (LowerLimit a) -> ST s (Mutable Vector s (LowerLimit a)) basicLength :: Vector (LowerLimit a) -> Int basicUnsafeSlice :: Int -> Int -> Vector (LowerLimit a) -> Vector (LowerLimit a) basicUnsafeIndexM :: Vector (LowerLimit a) -> Int -> Box (LowerLimit a) basicUnsafeCopy :: Mutable Vector s (LowerLimit a) -> Vector (LowerLimit a) -> ST s () elemseq :: Vector (LowerLimit a) -> LowerLimit a -> b -> b | |||||
Unbox a => MVector MVector (LowerLimit a) Source # | |||||
Defined in Statistics.Types Methods basicLength :: MVector s (LowerLimit a) -> Int basicUnsafeSlice :: Int -> Int -> MVector s (LowerLimit a) -> MVector s (LowerLimit a) basicOverlaps :: MVector s (LowerLimit a) -> MVector s (LowerLimit a) -> Bool basicUnsafeNew :: Int -> ST s (MVector s (LowerLimit a)) basicInitialize :: MVector s (LowerLimit a) -> ST s () basicUnsafeReplicate :: Int -> LowerLimit a -> ST s (MVector s (LowerLimit a)) basicUnsafeRead :: MVector s (LowerLimit a) -> Int -> ST s (LowerLimit a) basicUnsafeWrite :: MVector s (LowerLimit a) -> Int -> LowerLimit a -> ST s () basicClear :: MVector s (LowerLimit a) -> ST s () basicSet :: MVector s (LowerLimit a) -> LowerLimit a -> ST s () basicUnsafeCopy :: MVector s (LowerLimit a) -> MVector s (LowerLimit a) -> ST s () basicUnsafeMove :: MVector s (LowerLimit a) -> MVector s (LowerLimit a) -> ST s () basicUnsafeGrow :: MVector s (LowerLimit a) -> Int -> ST s (MVector s (LowerLimit a)) | |||||
FromJSON a => FromJSON (LowerLimit a) Source # | |||||
Defined in Statistics.Types Methods parseJSON :: Value -> Parser (LowerLimit a) parseJSONList :: Value -> Parser [LowerLimit a] omittedField :: Maybe (LowerLimit a) | |||||
ToJSON a => ToJSON (LowerLimit a) Source # | |||||
Defined in Statistics.Types Methods toJSON :: LowerLimit a -> Value toEncoding :: LowerLimit a -> Encoding toJSONList :: [LowerLimit a] -> Value toEncodingList :: [LowerLimit a] -> Encoding omitField :: LowerLimit a -> Bool | |||||
Data a => Data (LowerLimit a) Source # | |||||
Defined in Statistics.Types Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> LowerLimit a -> c (LowerLimit a) gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (LowerLimit a) toConstr :: LowerLimit a -> Constr dataTypeOf :: LowerLimit a -> DataType dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (LowerLimit a)) dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (LowerLimit a)) gmapT :: (forall b. Data b => b -> b) -> LowerLimit a -> LowerLimit a gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> LowerLimit a -> r gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> LowerLimit a -> r gmapQ :: (forall d. Data d => d -> u) -> LowerLimit a -> [u] gmapQi :: Int -> (forall d. Data d => d -> u) -> LowerLimit a -> u gmapM :: Monad m => (forall d. Data d => d -> m d) -> LowerLimit a -> m (LowerLimit a) gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> LowerLimit a -> m (LowerLimit a) gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> LowerLimit a -> m (LowerLimit a) | |||||
Generic (LowerLimit a) Source # | |||||
Defined in Statistics.Types Associated Types
| |||||
Read a => Read (LowerLimit a) Source # | |||||
Defined in Statistics.Types Methods readsPrec :: Int -> ReadS (LowerLimit a) readList :: ReadS [LowerLimit a] readPrec :: ReadPrec (LowerLimit a) readListPrec :: ReadPrec [LowerLimit a] | |||||
Show a => Show (LowerLimit a) Source # | |||||
Defined in Statistics.Types Methods showsPrec :: Int -> LowerLimit a -> ShowS show :: LowerLimit a -> String showList :: [LowerLimit a] -> ShowS | |||||
Binary a => Binary (LowerLimit a) Source # | |||||
Defined in Statistics.Types | |||||
NFData a => NFData (LowerLimit a) Source # | |||||
Defined in Statistics.Types Methods rnf :: LowerLimit a -> () | |||||
Eq a => Eq (LowerLimit a) Source # | |||||
Defined in Statistics.Types | |||||
Unbox a => Unbox (LowerLimit a) Source # | |||||
Defined in Statistics.Types | |||||
newtype MVector s (LowerLimit a) Source # | |||||
Defined in Statistics.Types | |||||
type Rep (LowerLimit a) Source # | |||||
Defined in Statistics.Types type Rep (LowerLimit a) = D1 ('MetaData "LowerLimit" "Statistics.Types" "statistics-0.16.2.1-GC0UmpORwJ8SU4BdSiJEf" 'False) (C1 ('MetaCons "LowerLimit" 'PrefixI 'True) (S1 ('MetaSel ('Just "lowerLimit") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 a) :*: S1 ('MetaSel ('Just "llConfidenceLevel") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (CL Double)))) | |||||
newtype Vector (LowerLimit a) Source # | |||||
Defined in Statistics.Types |
Constructors
Create estimate with normal errors
Synonym for estimateNormErr
Arguments
:: Num a | |
=> a | Point estimate. Should lie within interval but it's not checked. |
-> (a, a) | Lower and upper bounds of interval |
-> CL Double | Confidence level for interval |
-> Estimate ConfInt a |
Create estimate with asymmetric error.
Arguments
:: a | Central estimate |
-> (a, a) | Lower and upper errors. Both should be positive but it's not checked. |
-> CL Double | Confidence level for interval |
-> Estimate ConfInt a |
Create estimate with asymmetric error.
Accessors
confidenceInterval :: Num a => Estimate ConfInt a -> (a, a) Source #
Get confidence interval
asymErrors :: Estimate ConfInt a -> (a, a) Source #
Get asymmetric errors
class Scale (e :: Type -> Type) where Source #
Data types which could be multiplied by constant.
Other
type WeightedSample = Vector (Double, Double) Source #
Sample with weights. First element of sample is data, second is weight