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

Copyright | (c) 2015 Mihai Maruseac
License | BSD3
Maintainer | mihai.maruseac@maruseac.com
Stability | experimental
Portability | portable
Safe Haskell | None
Language | Haskell2010

Statistics.Distribution.Laplace

Contents

- Constructors
- Accessors

Description

The Laplace distribution. This is the continuous probability defined as the difference of two iid exponential random variables or a Brownian motion evaluated as exponentially distributed times. It is used in differential privacy (Laplace Method), speech recognition and least absolute deviations method (Laplace's first law of errors, giving a robust regression method)

Synopsis

- data LaplaceDistribution
- laplace :: Double -> Double -> LaplaceDistribution
- laplaceE :: Double -> Double -> Maybe LaplaceDistribution
- ldLocation :: LaplaceDistribution -> Double
- ldScale :: LaplaceDistribution -> Double

# Documentation

data LaplaceDistribution #

#### Instances

Instances details

FromJSON LaplaceDistribution # |
Instance details Defined in Statistics.Distribution.Laplace Methods parseJSON :: Value -> Parser LaplaceDistribution # parseJSONList :: Value -> Parser [LaplaceDistribution] # omittedField :: Maybe LaplaceDistribution #
ToJSON LaplaceDistribution # |
Instance details Defined in Statistics.Distribution.Laplace Methods toJSON :: LaplaceDistribution -> Value # toEncoding :: LaplaceDistribution -> Encoding # toJSONList :: [LaplaceDistribution] -> Value # toEncodingList :: [LaplaceDistribution] -> Encoding # omitField :: LaplaceDistribution -> Bool #
Binary LaplaceDistribution # |
Instance details Defined in Statistics.Distribution.Laplace Methods put :: LaplaceDistribution -> Put # get :: Get LaplaceDistribution # putList :: [LaplaceDistribution] -> Put #
Data LaplaceDistribution # |

Instance details

Defined in Statistics.Distribution.Laplace

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> LaplaceDistribution -> c LaplaceDistribution #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c LaplaceDistribution #

toConstr :: LaplaceDistribution -> Constr #

dataTypeOf :: LaplaceDistribution -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c LaplaceDistribution) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c LaplaceDistribution) #

gmapT :: (forall b. Data b => b -> b) -> LaplaceDistribution -> LaplaceDistribution #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> LaplaceDistribution -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> LaplaceDistribution -> r #

gmapQ :: (forall d. Data d => d -> u) -> LaplaceDistribution -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> LaplaceDistribution -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> LaplaceDistribution -> m LaplaceDistribution #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> LaplaceDistribution -> m LaplaceDistribution #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> LaplaceDistribution -> m LaplaceDistribution #

Generic LaplaceDistribution # |

Instance details

Defined in Statistics.Distribution.Laplace

Associated Types

type Rep LaplaceDistribution |

Instance details

Defined in Statistics.Distribution.Laplace

type Rep LaplaceDistribution = D1 ('MetaData "LaplaceDistribution" "Statistics.Distribution.Laplace" "statistics-0.16.3.0-JhFVwN7Kv9y2XSvDlj54t" 'False) (C1 ('MetaCons "LD" 'PrefixI 'True) (S1 ('MetaSel ('Just "ldLocation") 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 Double) :*: S1 ('MetaSel ('Just "ldScale") 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 Double)))

Methods

from :: LaplaceDistribution -> Rep LaplaceDistribution x #

to :: Rep LaplaceDistribution x -> LaplaceDistribution #

Read LaplaceDistribution # |
Instance details Defined in Statistics.Distribution.Laplace Methods readsPrec :: Int -> ReadS LaplaceDistribution # readList :: ReadS [LaplaceDistribution] # readPrec :: ReadPrec LaplaceDistribution # readListPrec :: ReadPrec [LaplaceDistribution] #
Show LaplaceDistribution # |
Instance details Defined in Statistics.Distribution.Laplace Methods showsPrec :: Int -> LaplaceDistribution -> ShowS # show :: LaplaceDistribution -> String # showList :: [LaplaceDistribution] -> ShowS #
Eq LaplaceDistribution # |
Instance details Defined in Statistics.Distribution.Laplace Methods (==) :: LaplaceDistribution -> LaplaceDistribution -> Bool # (/=) :: LaplaceDistribution -> LaplaceDistribution -> Bool #
ContDistr LaplaceDistribution # |
Instance details Defined in Statistics.Distribution.Laplace Methods density :: LaplaceDistribution -> Double -> Double # logDensity :: LaplaceDistribution -> Double -> Double # quantile :: LaplaceDistribution -> Double -> Double # complQuantile :: LaplaceDistribution -> Double -> Double #
ContGen LaplaceDistribution # |
Instance details Defined in Statistics.Distribution.Laplace Methods genContVar :: StatefulGen g m => LaplaceDistribution -> g -> m Double #
Distribution LaplaceDistribution # |
Instance details Defined in Statistics.Distribution.Laplace Methods cumulative :: LaplaceDistribution -> Double -> Double # complCumulative :: LaplaceDistribution -> Double -> Double #
Entropy LaplaceDistribution # |
Instance details Defined in Statistics.Distribution.Laplace Methods entropy :: LaplaceDistribution -> Double #
MaybeEntropy LaplaceDistribution # |
Instance details Defined in Statistics.Distribution.Laplace Methods maybeEntropy :: LaplaceDistribution -> Maybe Double #
MaybeMean LaplaceDistribution # |
Instance details Defined in Statistics.Distribution.Laplace Methods maybeMean :: LaplaceDistribution -> Maybe Double #
MaybeVariance LaplaceDistribution # |
Instance details Defined in Statistics.Distribution.Laplace Methods maybeVariance :: LaplaceDistribution -> Maybe Double # maybeStdDev :: LaplaceDistribution -> Maybe Double #
Mean LaplaceDistribution # |
Instance details Defined in Statistics.Distribution.Laplace Methods mean :: LaplaceDistribution -> Double #
Variance LaplaceDistribution # |
Instance details Defined in Statistics.Distribution.Laplace Methods variance :: LaplaceDistribution -> Double # stdDev :: LaplaceDistribution -> Double #
FromSample LaplaceDistribution Double # | Create Laplace distribution from sample. The location is estimated as the median of the sample, and the scale as the mean absolute deviation of the median.
Instance details Defined in Statistics.Distribution.Laplace Methods fromSample :: Vector v Double => v Double -> Maybe LaplaceDistribution #
type Rep LaplaceDistribution # |

Instance details

Defined in Statistics.Distribution.Laplace

type Rep LaplaceDistribution = D1 ('MetaData "LaplaceDistribution" "Statistics.Distribution.Laplace" "statistics-0.16.3.0-JhFVwN7Kv9y2XSvDlj54t" 'False) (C1 ('MetaCons "LD" 'PrefixI 'True) (S1 ('MetaSel ('Just "ldLocation") 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 Double) :*: S1 ('MetaSel ('Just "ldScale") 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 Double)))

# Constructors

laplace #

Arguments

:: Double | Location
-> Double | Scale
-> LaplaceDistribution |

Create an Laplace distribution.

laplaceE #

Arguments

:: Double | Location
-> Double | Scale
-> Maybe LaplaceDistribution |

Create an Laplace distribution.

# Accessors

ldLocation :: LaplaceDistribution -> Double #

Location.

ldScale :: LaplaceDistribution -> Double #

Scale.