Hoogle Search
Within LTS Haskell 24.40 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
module System.Random.MWC.
Probability A probability monad based on sampling functions, implemented as a thin wrapper over the mwc-random library. Probability distributions are abstract constructs that can be represented in a variety of ways. The sampling function representation is particularly useful -- it's computationally efficient, and collections of samples are amenable to much practical work. Probability monads propagate uncertainty under the hood. An expression like beta 1 8 >>= binomial 10 corresponds to a beta-binomial distribution in which the uncertainty captured by beta 1 8 has been marginalized out. The distribution resulting from a series of effects is called the predictive distribution of the model described by the corresponding expression. The monadic structure lets one piece together a hierarchical structure from simpler, local conditionals:
hierarchicalModel = do [c, d, e, f] <- replicateM 4 $ uniformR (1, 10) a <- gamma c d b <- gamma e f p <- beta a b n <- uniformR (5, 10) binomial n p
The functor instance allows one to transforms the support of a distribution while leaving its density structure invariant. For example, uniform is a distribution over the 0-1 interval, but fmap (+ 1) uniform is the translated distribution over the 1-2 interval:>>> create >>= sample (fmap (+ 1) uniform) 1.5480073474340754
The applicative instance guarantees that the generated samples are generated independently:>>> create >>= sample ((,) <$> uniform <*> uniform)
newtype
Prob (m :: Type -> Type) amwc-probability System.Random.MWC.Probability A probability distribution characterized by a sampling function.
>>> gen <- createSystemRandom >>> sample uniform gen 0.4208881170464097
Prob :: (Gen (PrimState m) -> m a) -> Prob (m :: Type -> Type) amwc-probability System.Random.MWC.Probability No documentation available.
module Algebra.
PrincipalIdealDomain No documentation available.
module MathObj.
PartialFraction Implementation of partial fractions. Useful e.g. for fractions of integers and fractions of polynomials. For the considered ring the prime factorization must be unique.
-
Routines and abstractions for permutations of Integers.
- ** Seems to be a candidate for Algebra directory. Algebra.PermutationGroup ?
-
Polynomials and rational functions in a single indeterminate. Polynomials are represented by a list of coefficients. All non-zero coefficients are listed, but there may be extra '0's at the end. Usage: Say you have the ring of Integer numbers and you want to add a transcendental element x, that is an element, which does not allow for simplifications. More precisely, for all positive integer exponents n the power x^n cannot be rewritten as a sum of powers with smaller exponents. The element x must be represented by the polynomial [0,1]. In principle, you can have more than one transcendental element by using polynomials whose coefficients are polynomials as well. However, most algorithms on multi-variate polynomials prefer a different (sparse) representation, where the ordering of elements is not so fixed. If you want division, you need Number.Ratios of polynomials with coefficients from a Algebra.Field. You can also compute with an algebraic element, that is an element which satisfies an algebraic equation like x^3-x-1==0. Actually, powers of x with exponents above 3 can be simplified, since it holds x^3==x+1. You can perform these computations with Number.ResidueClass of polynomials, where the divisor is the polynomial equation that determines x. If the polynomial is irreducible (in our case x^3-x-1 cannot be written as a non-trivial product) then the residue classes also allow unrestricted division (except by zero, of course). That is, using residue classes of polynomials you can work with roots of polynomial equations without representing them by radicals (powers with fractional exponents). It is well-known, that roots of polynomials of degree above 4 may not be representable by radicals.
-
Power series, either finite or unbounded. (zipWith does exactly the right thing to make it work almost transparently.)
-
Two-variate power series.
-
For a multi-set of numbers, we describe a sequence of the sums of powers of the numbers in the set. These can be easily converted to polynomials and back. Thus they provide an easy way for computations on the roots of a polynomial.