dirichlet-0.1.0.7: Multivariate Dirichlet distribution
Copyright2021 Dominik Schrempf
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

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 :: StatefulGen g m => DirichletDistribution -> g -> 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 :: StatefulGen g m => DirichletDistributionSymmetric -> g -> m (Vector Double) Source #

Sample a value vector from the symmetric Dirichlet distribution.