statistics-0.13.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 | Haskell98

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
- laplaceFromSample :: Sample -> LaplaceDistribution
- ldLocation :: LaplaceDistribution -> Double
- ldScale :: LaplaceDistribution -> Double

# Documentation

data LaplaceDistribution Source #

Instances

Eq LaplaceDistribution Source # |
Methods (==) :: LaplaceDistribution -> LaplaceDistribution -> Bool # (/=) :: LaplaceDistribution -> LaplaceDistribution -> Bool #
Data LaplaceDistribution Source # |

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 :: (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 #

Read LaplaceDistribution Source # |
Methods readsPrec :: Int -> ReadS LaplaceDistribution # readList :: ReadS [LaplaceDistribution] # readPrec :: ReadPrec LaplaceDistribution # readListPrec :: ReadPrec [LaplaceDistribution] #
Show LaplaceDistribution Source # |
Methods showsPrec :: Int -> LaplaceDistribution -> ShowS # show :: LaplaceDistribution -> String # showList :: [LaplaceDistribution] -> ShowS #
Generic LaplaceDistribution Source # |
Associated Types type Rep LaplaceDistribution :: * -> * # Methods from :: LaplaceDistribution -> Rep LaplaceDistribution x # to :: Rep LaplaceDistribution x -> LaplaceDistribution #
ToJSON LaplaceDistribution Source # |
Methods toJSON :: LaplaceDistribution -> Value # toEncoding :: LaplaceDistribution -> Encoding # toJSONList :: [LaplaceDistribution] -> Value # toEncodingList :: [LaplaceDistribution] -> Encoding #
FromJSON LaplaceDistribution Source # |
Methods parseJSON :: Value -> Parser LaplaceDistribution # parseJSONList :: Value -> Parser [LaplaceDistribution] #
Binary LaplaceDistribution Source # |
Methods put :: LaplaceDistribution -> Put # get :: Get LaplaceDistribution # putList :: [LaplaceDistribution] -> Put #
ContGen LaplaceDistribution Source # |
Methods genContVar :: PrimMonad m => LaplaceDistribution -> Gen (PrimState m) -> m Double Source #
Entropy LaplaceDistribution Source # |
Methods entropy :: LaplaceDistribution -> Double Source #
MaybeEntropy LaplaceDistribution Source # |
Methods maybeEntropy :: LaplaceDistribution -> Maybe Double Source #
Variance LaplaceDistribution Source # |
Methods variance :: LaplaceDistribution -> Double Source # stdDev :: LaplaceDistribution -> Double Source #
MaybeVariance LaplaceDistribution Source # |
Methods maybeVariance :: LaplaceDistribution -> Maybe Double Source # maybeStdDev :: LaplaceDistribution -> Maybe Double Source #
Mean LaplaceDistribution Source # |
Methods mean :: LaplaceDistribution -> Double Source #
MaybeMean LaplaceDistribution Source # |
Methods maybeMean :: LaplaceDistribution -> Maybe Double Source #
ContDistr LaplaceDistribution Source # |
Methods density :: LaplaceDistribution -> Double -> Double Source # quantile :: LaplaceDistribution -> Double -> Double Source # logDensity :: LaplaceDistribution -> Double -> Double Source #
Distribution LaplaceDistribution Source # |
Methods cumulative :: LaplaceDistribution -> Double -> Double Source # complCumulative :: LaplaceDistribution -> Double -> Double Source #
type Rep LaplaceDistribution Source # |
type Rep LaplaceDistribution = D1 (MetaData "LaplaceDistribution" "Statistics.Distribution.Laplace" "statistics-0.13.3.0-Fvkducafmyw9ljEnBhS6Nm" False) (C1 (MetaCons "LD" PrefixI True) ((:*:) (S1 (MetaSel (Just Symbol "ldLocation") SourceUnpack SourceStrict DecidedUnpack) (Rec0 Double)) (S1 (MetaSel (Just Symbol "ldScale") SourceUnpack SourceStrict DecidedUnpack) (Rec0 Double))))

# Constructors

laplace Source #

Arguments

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

Create an Laplace distribution.

laplaceFromSample :: Sample -> LaplaceDistribution Source #

Create Laplace distribution from sample. No tests are made to check whether it truly is Laplace. Location of distribution estimated as median of sample.

# Accessors

ldLocation :: LaplaceDistribution -> Double Source #

Location.

ldScale :: LaplaceDistribution -> Double Source #

Scale.