Copyright | 2021 Dominik Schrempf |
---|---|
License | GPL-3.0-or-later |
Maintainer | dominik.schrempf@gmail.com |
Stability | unstable |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
Creation date: Tue Oct 20 10:10:39 2020.
Synopsis
- data DirichletDistribution
- dirichletDistribution :: Vector Double -> Either String DirichletDistribution
- dirichletDensity :: DirichletDistribution -> Vector Double -> Log Double
- dirichletSample :: StatefulGen g m => DirichletDistribution -> g -> m (Vector Double)
- data DirichletDistributionSymmetric
- dirichletDistributionSymmetric :: Int -> Double -> Either String DirichletDistributionSymmetric
- dirichletDensitySymmetric :: DirichletDistributionSymmetric -> Vector Double -> Log Double
- dirichletSampleSymmetric :: StatefulGen g m => DirichletDistributionSymmetric -> g -> m (Vector Double)
Dirichlet distribution
data DirichletDistribution Source #
Instances
Eq DirichletDistribution Source # | |
Defined in Statistics.Distribution.Dirichlet (==) :: DirichletDistribution -> DirichletDistribution -> Bool # (/=) :: DirichletDistribution -> DirichletDistribution -> Bool # | |
Show DirichletDistribution Source # | |
Defined in Statistics.Distribution.Dirichlet showsPrec :: Int -> DirichletDistribution -> ShowS # show :: DirichletDistribution -> String # showList :: [DirichletDistribution] -> ShowS # |
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
data DirichletDistributionSymmetric Source #
See DirichletDistribution
but with parameter vector replicate DIM VAL
.
Instances
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.