dirichlet-0.1.0.2: Multivariate Dirichlet distribution
Copyright(c) Dominik Schrempf 2020
LicenseGPL-3.0-or-later
Maintainerdominik.schrempf@gmail.com
Stabilityunstable
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Statistics.Distribution.Dirichlet

Description

Creation date: Tue Oct 20 10:10:39 2020.

Synopsis

Dirichlet distribution

data DirichletDistribution Source #

The Dirichlet distribution is identified by a vector of parameter values.

dirichletDistribution :: Vector Double -> Either String DirichletDistribution Source #

Create a Dirichlet distribution from the given parameter vector.

Return Left if: - The parameter vector has less then two elements. - One or more parameters are negative or zero.

dirichletDensity :: DirichletDistribution -> Vector Double -> Log Double Source #

Density of the Dirichlet distribution evaluated at a given value vector.

Return 0 if: - The value vector has a different length than the parameter vector. - The value vector has elements being negative or zero. - The value vector does not sum to 1.0 (with tolerance eps = 1e-14).

dirichletSample :: PrimMonad m => DirichletDistribution -> Gen (PrimState m) -> m (Vector Double) Source #

Sample a value vector from the Dirichlet distribution.

Symmetric Dirichlet distribution

dirichletDistributionSymmetric :: Int -> Double -> Either String DirichletDistributionSymmetric Source #

Create a symmetric Dirichlet distribution of given dimension and parameter.

Return Left if: - The given dimension is smaller than two. - The parameter is negative or zero.

dirichletDensitySymmetric :: DirichletDistributionSymmetric -> Vector Double -> Log Double Source #

Density of the symmetric Dirichlet distribution evaluated at a given value vector.

Return 0 if: - The value vector has a different dimension. - The value vector has elements being negative or zero. - The value vector does not sum to 1.0 (with tolerance eps = 1e-14).

dirichletSampleSymmetric :: PrimMonad m => DirichletDistributionSymmetric -> Gen (PrimState m) -> m (Vector Double) Source #

Sample a value vector from the symmetric Dirichlet distribution.