Copyright | (c) 2009-2014 Bryan O'Sullivan |
---|---|
License | BSD-style |
Maintainer | bos@serpentine.com |
Stability | experimental |
Portability | GHC |
Safe Haskell | Trustworthy |
Language | Haskell2010 |
Criterion.Analysis
Description
Analysis code for benchmarks.
Synopsis
- data Outliers = Outliers {
- samplesSeen :: !Int64
- lowSevere :: !Int64
- lowMild :: !Int64
- highMild :: !Int64
- highSevere :: !Int64
- data OutlierEffect
- = Unaffected
- | Slight
- | Moderate
- | Severe
- data OutlierVariance = OutlierVariance {}
- data SampleAnalysis = SampleAnalysis {}
- analyseSample :: Int -> String -> Vector Measured -> ExceptT String Criterion Report
- scale :: Double -> SampleAnalysis -> SampleAnalysis
- analyseMean :: Sample -> Int -> Criterion Double
- countOutliers :: Outliers -> Int64
- classifyOutliers :: Sample -> Outliers
- noteOutliers :: Outliers -> Criterion ()
- outlierVariance :: Estimate ConfInt Double -> Estimate ConfInt Double -> Double -> OutlierVariance
- resolveAccessors :: [String] -> Either String [(String, Measured -> Maybe Double)]
- validateAccessors :: [String] -> String -> Either String [(String, Measured -> Maybe Double)]
- regress :: GenIO -> [String] -> String -> Vector Measured -> ExceptT String Criterion Regression
Documentation
Outliers from sample data, calculated using the boxplot technique.
Constructors
Outliers | |
Fields
|
Instances
data OutlierEffect #
A description of the extent to which outliers in the sample data affect the sample mean and standard deviation.
Constructors
Unaffected | Less than 1% effect. |
Slight | Between 1% and 10%. |
Moderate | Between 10% and 50%. |
Severe | Above 50% (i.e. measurements are useless). |
Instances
FromJSON OutlierEffect # | |||||
Defined in Criterion.Types Methods parseJSON :: Value -> Parser OutlierEffect # parseJSONList :: Value -> Parser [OutlierEffect] # | |||||
ToJSON OutlierEffect # | |||||
Defined in Criterion.Types Methods toJSON :: OutlierEffect -> Value # toEncoding :: OutlierEffect -> Encoding # toJSONList :: [OutlierEffect] -> Value # toEncodingList :: [OutlierEffect] -> Encoding # omitField :: OutlierEffect -> Bool # | |||||
Binary OutlierEffect # | |||||
Defined in Criterion.Types | |||||
NFData OutlierEffect # | |||||
Defined in Criterion.Types Methods rnf :: OutlierEffect -> () # | |||||
Data OutlierEffect # | |||||
Defined in Criterion.Types Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> OutlierEffect -> c OutlierEffect # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c OutlierEffect # toConstr :: OutlierEffect -> Constr # dataTypeOf :: OutlierEffect -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c OutlierEffect) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c OutlierEffect) # gmapT :: (forall b. Data b => b -> b) -> OutlierEffect -> OutlierEffect # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> OutlierEffect -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> OutlierEffect -> r # gmapQ :: (forall d. Data d => d -> u) -> OutlierEffect -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> OutlierEffect -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> OutlierEffect -> m OutlierEffect # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> OutlierEffect -> m OutlierEffect # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> OutlierEffect -> m OutlierEffect # | |||||
Generic OutlierEffect # | |||||
Defined in Criterion.Types Associated Types
| |||||
Read OutlierEffect # | |||||
Defined in Criterion.Types Methods readsPrec :: Int -> ReadS OutlierEffect # readList :: ReadS [OutlierEffect] # | |||||
Show OutlierEffect # | |||||
Defined in Criterion.Types Methods showsPrec :: Int -> OutlierEffect -> ShowS # show :: OutlierEffect -> String # showList :: [OutlierEffect] -> ShowS # | |||||
Eq OutlierEffect # | |||||
Defined in Criterion.Types Methods (==) :: OutlierEffect -> OutlierEffect -> Bool # (/=) :: OutlierEffect -> OutlierEffect -> Bool # | |||||
Ord OutlierEffect # | |||||
Defined in Criterion.Types Methods compare :: OutlierEffect -> OutlierEffect -> Ordering # (<) :: OutlierEffect -> OutlierEffect -> Bool # (<=) :: OutlierEffect -> OutlierEffect -> Bool # (>) :: OutlierEffect -> OutlierEffect -> Bool # (>=) :: OutlierEffect -> OutlierEffect -> Bool # max :: OutlierEffect -> OutlierEffect -> OutlierEffect # min :: OutlierEffect -> OutlierEffect -> OutlierEffect # | |||||
type Rep OutlierEffect # | |||||
Defined in Criterion.Types type Rep OutlierEffect = D1 ('MetaData "OutlierEffect" "Criterion.Types" "criterion-1.6.4.0-KMbd5KXmWbyCEa5Lfuxr8d" 'False) ((C1 ('MetaCons "Unaffected" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Slight" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Moderate" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Severe" 'PrefixI 'False) (U1 :: Type -> Type))) |
data OutlierVariance #
Analysis of the extent to which outliers in a sample affect its standard deviation (and to some extent, its mean).
Constructors
OutlierVariance | |
Fields
|
Instances
FromJSON OutlierVariance # | |||||
Defined in Criterion.Types Methods parseJSON :: Value -> Parser OutlierVariance # parseJSONList :: Value -> Parser [OutlierVariance] # | |||||
ToJSON OutlierVariance # | |||||
Defined in Criterion.Types Methods toJSON :: OutlierVariance -> Value # toEncoding :: OutlierVariance -> Encoding # toJSONList :: [OutlierVariance] -> Value # toEncodingList :: [OutlierVariance] -> Encoding # omitField :: OutlierVariance -> Bool # | |||||
Binary OutlierVariance # | |||||
Defined in Criterion.Types Methods put :: OutlierVariance -> Put # get :: Get OutlierVariance # putList :: [OutlierVariance] -> Put # | |||||
NFData OutlierVariance # | |||||
Defined in Criterion.Types Methods rnf :: OutlierVariance -> () # | |||||
Data OutlierVariance # | |||||
Defined in Criterion.Types Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> OutlierVariance -> c OutlierVariance # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c OutlierVariance # toConstr :: OutlierVariance -> Constr # dataTypeOf :: OutlierVariance -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c OutlierVariance) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c OutlierVariance) # gmapT :: (forall b. Data b => b -> b) -> OutlierVariance -> OutlierVariance # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> OutlierVariance -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> OutlierVariance -> r # gmapQ :: (forall d. Data d => d -> u) -> OutlierVariance -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> OutlierVariance -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> OutlierVariance -> m OutlierVariance # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> OutlierVariance -> m OutlierVariance # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> OutlierVariance -> m OutlierVariance # | |||||
Generic OutlierVariance # | |||||
Defined in Criterion.Types Associated Types
Methods from :: OutlierVariance -> Rep OutlierVariance x # to :: Rep OutlierVariance x -> OutlierVariance # | |||||
Read OutlierVariance # | |||||
Defined in Criterion.Types Methods readsPrec :: Int -> ReadS OutlierVariance # readList :: ReadS [OutlierVariance] # | |||||
Show OutlierVariance # | |||||
Defined in Criterion.Types Methods showsPrec :: Int -> OutlierVariance -> ShowS # show :: OutlierVariance -> String # showList :: [OutlierVariance] -> ShowS # | |||||
Eq OutlierVariance # | |||||
Defined in Criterion.Types Methods (==) :: OutlierVariance -> OutlierVariance -> Bool # (/=) :: OutlierVariance -> OutlierVariance -> Bool # | |||||
type Rep OutlierVariance # | |||||
Defined in Criterion.Types type Rep OutlierVariance = D1 ('MetaData "OutlierVariance" "Criterion.Types" "criterion-1.6.4.0-KMbd5KXmWbyCEa5Lfuxr8d" 'False) (C1 ('MetaCons "OutlierVariance" 'PrefixI 'True) (S1 ('MetaSel ('Just "ovEffect") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 OutlierEffect) :*: (S1 ('MetaSel ('Just "ovDesc") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String) :*: S1 ('MetaSel ('Just "ovFraction") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double)))) |
data SampleAnalysis #
Result of a bootstrap analysis of a non-parametric sample.
Constructors
SampleAnalysis | |
Fields
|
Instances
FromJSON SampleAnalysis # | |||||
Defined in Criterion.Types Methods parseJSON :: Value -> Parser SampleAnalysis # parseJSONList :: Value -> Parser [SampleAnalysis] # | |||||
ToJSON SampleAnalysis # | |||||
Defined in Criterion.Types Methods toJSON :: SampleAnalysis -> Value # toEncoding :: SampleAnalysis -> Encoding # toJSONList :: [SampleAnalysis] -> Value # toEncodingList :: [SampleAnalysis] -> Encoding # omitField :: SampleAnalysis -> Bool # | |||||
Binary SampleAnalysis # | |||||
Defined in Criterion.Types Methods put :: SampleAnalysis -> Put # get :: Get SampleAnalysis # putList :: [SampleAnalysis] -> Put # | |||||
NFData SampleAnalysis # | |||||
Defined in Criterion.Types Methods rnf :: SampleAnalysis -> () # | |||||
Generic SampleAnalysis # | |||||
Defined in Criterion.Types Associated Types
Methods from :: SampleAnalysis -> Rep SampleAnalysis x # to :: Rep SampleAnalysis x -> SampleAnalysis # | |||||
Read SampleAnalysis # | |||||
Defined in Criterion.Types Methods readsPrec :: Int -> ReadS SampleAnalysis # readList :: ReadS [SampleAnalysis] # | |||||
Show SampleAnalysis # | |||||
Defined in Criterion.Types Methods showsPrec :: Int -> SampleAnalysis -> ShowS # show :: SampleAnalysis -> String # showList :: [SampleAnalysis] -> ShowS # | |||||
Eq SampleAnalysis # | |||||
Defined in Criterion.Types Methods (==) :: SampleAnalysis -> SampleAnalysis -> Bool # (/=) :: SampleAnalysis -> SampleAnalysis -> Bool # | |||||
type Rep SampleAnalysis # | |||||
Defined in Criterion.Types type Rep SampleAnalysis = D1 ('MetaData "SampleAnalysis" "Criterion.Types" "criterion-1.6.4.0-KMbd5KXmWbyCEa5Lfuxr8d" 'False) (C1 ('MetaCons "SampleAnalysis" 'PrefixI 'True) ((S1 ('MetaSel ('Just "anRegress") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Regression]) :*: S1 ('MetaSel ('Just "anMean") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Estimate ConfInt Double))) :*: (S1 ('MetaSel ('Just "anStdDev") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Estimate ConfInt Double)) :*: S1 ('MetaSel ('Just "anOutlierVar") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 OutlierVariance)))) |
Arguments
:: Int | Experiment number. |
-> String | Experiment name. |
-> Vector Measured | Sample data. |
-> ExceptT String Criterion Report |
Perform an analysis of a measurement.
Arguments
:: Double | Value to multiply by. |
-> SampleAnalysis | |
-> SampleAnalysis |
Multiply the Estimate
s in an analysis by the given value, using
scale
.
Display the mean of a Sample
, and characterise the outliers
present in the sample.
countOutliers :: Outliers -> Int64 #
Count the total number of outliers in a sample.
classifyOutliers :: Sample -> Outliers #
Classify outliers in a data set, using the boxplot technique.
Arguments
:: Estimate ConfInt Double | Bootstrap estimate of sample mean. |
-> Estimate ConfInt Double | Bootstrap estimate of sample standard deviation. |
-> Double | Number of original iterations. |
-> OutlierVariance |
Compute the extent to which outliers in the sample data affect the sample mean and standard deviation.
resolveAccessors :: [String] -> Either String [(String, Measured -> Maybe Double)] #
Given a list of accessor names (see measureKeys
), return either
a mapping from accessor name to function or an error message if
any names are wrong.
Arguments
:: [String] | Predictor names. |
-> String | Responder name. |
-> Either String [(String, Measured -> Maybe Double)] |
Given predictor and responder names, do some basic validation, then hand back the relevant accessors.
Arguments
:: GenIO | |
-> [String] | Predictor names. |
-> String | Responder name. |
-> Vector Measured | |
-> ExceptT String Criterion Regression |
Regress the given predictors against the responder.
Errors may be returned under various circumstances, such as invalid names or lack of needed data.
See olsRegress
for details of the regression performed.