statistics-0.15.2.0: A library of statistical types, data, and functions

Copyright (c) 2009 2010 Bryan O'Sullivan BSD3 bos@serpentine.com experimental portable None Haskell98

Statistics.Resampling

Description

Resampling statistics.

Synopsis

# Data types

newtype Resample Source #

A resample drawn randomly, with replacement, from a set of data points. Distinct from a normal array to make it harder for your humble author's brain to go wrong.

Constructors

 Resample FieldsfromResample :: Vector Double
Instances
 Source # Instance detailsDefined in Statistics.Resampling Methods Source # Instance detailsDefined in Statistics.Resampling Methodsgfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Resample -> c Resample #gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Resample #dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Resample) #dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Resample) #gmapT :: (forall b. Data b => b -> b) -> Resample -> Resample #gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Resample -> r #gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Resample -> r #gmapQ :: (forall d. Data d => d -> u) -> Resample -> [u] #gmapQi :: Int -> (forall d. Data d => d -> u) -> Resample -> u #gmapM :: Monad m => (forall d. Data d => d -> m d) -> Resample -> m Resample #gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Resample -> m Resample #gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Resample -> m Resample # Source # Instance detailsDefined in Statistics.Resampling Methods Source # Instance detailsDefined in Statistics.Resampling MethodsshowList :: [Resample] -> ShowS # Source # Instance detailsDefined in Statistics.Resampling Associated Typestype Rep Resample :: Type -> Type # Methodsto :: Rep Resample x -> Resample # Source # Instance detailsDefined in Statistics.Resampling MethodstoJSONList :: [Resample] -> Value #toEncodingList :: [Resample] -> Encoding # Source # Instance detailsDefined in Statistics.Resampling Methods Source # Instance detailsDefined in Statistics.Resampling Methodsput :: Resample -> Put #putList :: [Resample] -> Put # type Rep Resample Source # Instance detailsDefined in Statistics.Resampling type Rep Resample = D1 (MetaData "Resample" "Statistics.Resampling" "statistics-0.15.2.0-FCVAYbUNN6k6ys2hOZ1wTy" True) (C1 (MetaCons "Resample" PrefixI True) (S1 (MetaSel (Just "fromResample") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Vector Double))))

data Bootstrap v a Source #

Constructors

 Bootstrap FieldsfullSample :: !a resamples :: v a
Instances

data Estimator Source #

An estimator of a property of a sample, such as its mean.

The use of an algebraic data type here allows functions such as jackknife and bootstrapBCA to use more efficient algorithms when possible.

Constructors

 Mean Variance VarianceUnbiased StdDev Function (Sample -> Double)

Run an Estimator over a sample.

# Resampling

Arguments

 :: PrimMonad m => Gen (PrimState m) -> [Estimator] Estimation functions. -> Int Number of resamples to compute. -> Vector Double Original sample. -> m [Bootstrap Vector Double]

Single threaded and deterministic version of resample.

Arguments

 :: GenIO -> [Estimator] Estimation functions. -> Int Number of resamples to compute. -> Vector Double Original sample. -> IO [(Estimator, Bootstrap Vector Double)]

O(e*r*s) Resample a data set repeatedly, with replacement, computing each estimate over the resampled data.

This function is expensive; it has to do work proportional to e*r*s, where e is the number of estimation functions, r is the number of resamples to compute, and s is the number of original samples.

To improve performance, this function will make use of all available CPUs. At least with GHC 7.0, parallel performance seems best if the parallel garbage collector is disabled (RTS option -qg).

resampleVector :: (PrimMonad m, Vector v a) => Gen (PrimState m) -> v a -> m (v a) Source #

Create vector using resamples

# Jackknife

O(n) or O(n^2) Compute a statistical estimate repeatedly over a sample, each time omitting a successive element.

O(n) Compute the jackknife mean of a sample.

O(n) Compute the jackknife variance of a sample.

O(n) Compute the unbiased jackknife variance of a sample.

O(n) Compute the jackknife standard deviation of a sample.

# Helper functions

splitGen :: Int -> GenIO -> IO [GenIO] Source #

Split a generator into several that can run independently.
{"ft_lang_label":"__label__en","ft_lang_prob":0.6018632,"math_prob":0.823821,"size":7288,"snap":"2020-24-2020-29","text_gpt3_token_len":2150,"char_repetition_ratio":0.23050521,"word_repetition_ratio":0.48022208,"special_character_ratio":0.35373217,"punctuation_ratio":0.16462481,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9840479,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-07-12T08:28:54Z\",\"WARC-Record-ID\":\"<urn:uuid:216ea8c1-8151-4c79-be6a-c3777b35ea70>\",\"Content-Length\":\"80549\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:af3d813b-1d83-4a0d-a764-295b901a52e9>\",\"WARC-Concurrent-To\":\"<urn:uuid:00fa4c53-c979-4a69-9845-91f024156604>\",\"WARC-IP-Address\":\"199.232.64.68\",\"WARC-Target-URI\":\"http://hackage.haskell.org/package/statistics-0.15.2.0/docs/Statistics-Resampling.html\",\"WARC-Payload-Digest\":\"sha1:RASGTWVHP3HKS2PXUSK6CQ74DC7DXHHX\",\"WARC-Block-Digest\":\"sha1:FUKAFJ5RBMSR3R6WFVLTK7KU7PGLMMQV\",\"WARC-Identified-Payload-Type\":\"application/xhtml+xml\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-29/CC-MAIN-2020-29_segments_1593657134758.80_warc_CC-MAIN-20200712082512-20200712112512-00421.warc.gz\"}"}