Package

io.github.mandar2812.dynaml

probability

Permalink

package probability

Contains helper functions pertaining to random variables.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. probability
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. abstract class AbstractGaussianRV[T, V, Distr <: ContinuousDistr[T] with Moments[T, V] with HasErrorBars[T]] extends ContinuousRandomVariable[T] with ContinuousRVWithDistr[T, Distr]

    Permalink

    Gaussian Random Variable
  2. abstract class AbstractStudentsTRandVar[T, V, Distr <: ContinuousDistr[T] with Moments[T, V] with HasErrorBars[T]] extends ContinuousRandomVariable[T] with ContinuousRVWithDistr[T, Distr]

    Permalink
  3. class ApproxBayesComputation[ConditioningSet, Domain] extends RandomVariable[(ConditioningSet, Domain)] with BayesJointProbabilityScheme[ConditioningSet, Domain, RandomVariable[ConditioningSet], RandomVariable[Domain]]

    Permalink

  4. trait BayesJointProbabilityScheme[Domain1, Domain2, P <: RandomVariable[Domain1], D <: RandomVariable[Domain2]] extends RandomVariable[(Domain1, Domain2)] with JointProbabilityScheme[Domain1, Domain2, P, D]

    Permalink
  5. case class BinomialRV(n: Int, p: Double) extends RandomVariable[Int] with DiscreteDistrRV[Int] with Product with Serializable

    Permalink

    A binomial random variable.

    A binomial random variable. Simulates the accumulated results of n coin tosses of a loaded coin.

  6. case class BlockedMESNRV(tau: Double, alpha: PartitionedVector, mu: PartitionedVector, sigma: PartitionedPSDMatrix) extends ContinuousRandomVariable[PartitionedVector] with ContinuousDistrRV[PartitionedVector] with Product with Serializable

    Permalink

    Created by mandar on 28/02/2017.

  7. class ContinuousDistrMixture[Domain, BaseRV <: ContinuousRVWithDistr[Domain, ContinuousDistr[Domain]]] extends ContinuousRandomVariable[Domain] with ContinuousMixtureRV[Domain, BaseRV] with ContinuousDistrRV[Domain]

    Permalink

    A random variable mixture over a continuous domain, having a computable probability distribution

    A random variable mixture over a continuous domain, having a computable probability distribution

    Domain

    Domain over which each mixture component is defined

    BaseRV

    The type of each mixture component, must be a sub type of ContinuousRVWithDistr

  8. trait ContinuousMeasurableFunc[Domain1, Domain2, +R <: ContinuousRandomVariable[Domain1]] extends ContinuousRandomVariable[Domain2] with MeasurableFunction[Domain1, Domain2, R]

    Permalink
  9. trait ContinuousMixtureRV[Domain, BaseRV <: ContinuousRandomVariable[Domain]] extends ContinuousRandomVariable[Domain] with MixtureRV[Domain, BaseRV]

    Permalink

    A random variable mixture over a continuous domain

    A random variable mixture over a continuous domain

    Domain

    Domain over which each mixture component is defined

    BaseRV

    The type of each mixture component, must be a sub type of ContinuousRandomVariable

  10. trait ContinuousRVWithDistr[Domain, +Distr <: ContinuousDistr[Domain]] extends ContinuousRandomVariable[Domain] with RandomVarWithDistr[Domain, Distr]

    Permalink

    A continuous random variable that has an associated probability density function.

    A continuous random variable that has an associated probability density function.

    Domain

    Support/Sample space of the random variable

    Distr

    Type of the probability density as a subtype of breeze ContinuousDistr

  11. abstract class ContinuousRandomVariable[Domain] extends RandomVariable[Domain]

    Permalink

    Random variable defined over a continuous domain.

    Random variable defined over a continuous domain.

    Domain

    The domain over which the random variable takes values.

  12. trait DifferentiableLikelihoodModel[Q] extends LikelihoodModel[Q]

    Permalink
  13. trait DiscreteDistrRV[Domain] extends RandomVariable[Domain] with RandomVarWithDistr[Domain, DiscreteDistr[Domain]]

    Permalink

    A random variable which takes discrete or categorical values.

  14. trait DiscreteRVWithDistr[Domain, +Distr <: DiscreteDistr[Domain]] extends RandomVariable[Domain] with RandomVarWithDistr[Domain, Distr]

    Permalink
  15. class EncodedContDistrRV[Domain1, Domain2, Distr <: ContinuousDistr[Domain1]] extends ContinuousRandomVariable[Domain2] with ContinuousRVWithDistr[Domain2, ContinuousDistr[Domain2]]

    Permalink

    A random variable which consists of a base random variable in Domain1 and an invertible homeomorphism from Domain1 to Domain2.

    A random variable which consists of a base random variable in Domain1 and an invertible homeomorphism from Domain1 to Domain2.

    Domain1

    Domain of the base random variable

    Domain2

    Domain of the morphed random variable.

  16. case class GaussianRV(mu: Double, sigma: Double) extends AbstractGaussianRV[Double, Double, UnivariateGaussian] with Product with Serializable

    Permalink

    Univariate gaussian random variable

  17. class GenericContinuousMCMC[ConditioningSet, Domain] extends RejectionSamplingScheme[ConditioningSet, Domain, ContinuousDistr[ConditioningSet], ContinuousDistr[Domain], AbstractContinuousDistr[(ConditioningSet, Domain)]]

    Permalink

    Monte Carlo based bayesian inference model where the parameter space is known to be continuous and hence represented via a ContinuousDistrRV instance.

    Monte Carlo based bayesian inference model where the parameter space is known to be continuous and hence represented via a ContinuousDistrRV instance.

    ConditioningSet

    The type representing the model parameters

    Domain

    The type representing the observed data.

  18. trait HasDistribution[Domain] extends Serializable

    Permalink

    This trait is used to denote random variables which have an underlying probability density function.

  19. trait IIDContinuousRVDistr[D, +Distr <: ContinuousDistr[D], +R <: ContinuousRVWithDistr[D, Distr]] extends RandomVariable[Stream[D]] with IIDRandomVarDistr[D, Distr, R]

    Permalink

    An IID Random variable constructed from a continuous random variable having a defined distribution.

    An IID Random variable constructed from a continuous random variable having a defined distribution.

    D

    Base domain

    Distr

    A breeze probability density defined over the base domain.

    R

    A random variable defined over the base domain and having distribution of type Distr

  20. trait IIDDiscreteRVDistr[D, +Distr <: DiscreteDistr[D], +R <: DiscreteRVWithDistr[D, Distr]] extends RandomVariable[Stream[D]] with IIDRandomVarDistr[D, Distr, R]

    Permalink
  21. trait IIDRandomVarDistr[D, +Dist <: Density[D] with Rand[D], +R <: RandomVarWithDistr[D, Dist]] extends RandomVariable[Stream[D]] with IIDRandomVariable[D, R] with RandomVarWithDistr[Stream[D], Density[Stream[D]] with Rand[Stream[D]]]

    Permalink

    An i.i.d random variable with a defined distribution.

    An i.i.d random variable with a defined distribution.

    D

    Base domain

    Dist

    A breeze distribution defined over the base domain.

    R

    A random variable defined over the base domain and having distribution of type Dist

  22. trait IIDRandomVariable[D, +R <: RandomVariable[D]] extends RandomVariable[Stream[D]]

    Permalink

    An independent and identically distributed RandomVariable represented as a Stream

    An independent and identically distributed RandomVariable represented as a Stream

    D

    The base domain

    R

    Random variable defined over the base domain

  23. trait JointProbabilityScheme[Domain1, Domain2, P <: RandomVariable[Domain1], D <: RandomVariable[Domain2]] extends RandomVariable[(Domain1, Domain2)]

    Permalink

    Created by mandar on 09/01/2017.

  24. trait Likelihood[Q, R, S, W] extends AnyRef

    Permalink

    Q

    The type of observed variable (y)

    R

    The type of conditioning variable (f)

    S

    Result type of the hessian method.

    W

    The type representing a gaussian distribution for f

  25. trait LikelihoodModel[Q] extends DataPipe[Q, Double]

    Permalink

  26. case class MatrixNormalRV(m: DenseMatrix[Double], u: DenseMatrix[Double], v: DenseMatrix[Double]) extends AbstractGaussianRV[DenseMatrix[Double], (DenseMatrix[Double], DenseMatrix[Double]), MatrixNormal] with Product with Serializable

    Permalink

    Matrix gaussian random variable

  27. case class MatrixTRV(mu: Double, m: DenseMatrix[Double], u: DenseMatrix[Double], v: DenseMatrix[Double]) extends AbstractStudentsTRandVar[DenseMatrix[Double], (DenseMatrix[Double], DenseMatrix[Double]), MatrixT] with Product with Serializable

    Permalink
  28. class MeasurableDistrRV[Domain1, Domain2, Jacobian, Distr1 <: ContinuousDistr[Domain1]] extends ContinuousRandomVariable[Domain2] with ContinuousMeasurableFunc[Domain1, Domain2, ContinuousRVWithDistr[Domain1, Distr1]] with ContinuousDistrRV[Domain2]

    Permalink

    A measurable function of a continuous random variable with a defined probability density function.

    A measurable function of a continuous random variable with a defined probability density function.

    Domain1

    The domain of the base random variable

    Domain2

    The output set of the function

    Jacobian

    The type representing the Jacobian of inverse of the map func

  29. trait MeasurableFunction[Domain1, Domain2, +R <: RandomVariable[Domain1]] extends RandomVariable[Domain2]

    Permalink

    A measurable function is any mapping/function applied to samples generated by some base random variable instance.

    A measurable function is any mapping/function applied to samples generated by some base random variable instance.

    Domain1

    Type over which the base random variable is defined.

    Domain2

    Type over which output of function takes its values.

    R

    The type of the base Random Variable, must inherit from RandomVariable

  30. trait MixtureRV[Domain, BaseRV <: RandomVariable[Domain]] extends RandomVariable[Domain]

    Permalink

    Top level class for representing random variable mixtures.

    Top level class for representing random variable mixtures.

    Domain

    Domain over which each mixture component is defined

    BaseRV

    The type of each mixture component, must be a sub type of RandomVariable

  31. case class MultGaussianPRV(mu: PartitionedVector, covariance: PartitionedPSDMatrix)(implicit ev: Field[PartitionedVector]) extends AbstractGaussianRV[PartitionedVector, PartitionedPSDMatrix, BlockedMultiVariateGaussian] with Product with Serializable

    Permalink

    Multivariate blocked gaussian random variable

  32. case class MultGaussianRV(mu: DenseVector[Double], covariance: DenseMatrix[Double])(implicit ev: Field[DenseVector[Double]]) extends AbstractGaussianRV[DenseVector[Double], DenseMatrix[Double], MVGaussian] with Product with Serializable

    Permalink

    Multivariate gaussian random variable

  33. case class MultStudentsTPRV(mu: Double, mean: PartitionedVector, covariance: PartitionedPSDMatrix)(implicit ev: Field[PartitionedVector]) extends AbstractStudentsTRandVar[PartitionedVector, PartitionedPSDMatrix, BlockedMultivariateStudentsT] with Product with Serializable

    Permalink
  34. case class MultStudentsTRV(mu: Double, mean: DenseVector[Double], covariance: DenseMatrix[Double])(implicit ev: Field[DenseVector[Double]]) extends AbstractStudentsTRandVar[DenseVector[Double], DenseMatrix[Double], MultivariateStudentsT] with Product with Serializable

    Permalink
  35. case class MultinomialRV(weights: DenseVector[Double]) extends RandomVariable[Int] with DiscreteDistrRV[Int] with Product with Serializable

    Permalink

    A multinomial random variable i.e.

    A multinomial random variable i.e. draws values between 0 and N-1

  36. trait RandomVarWithDistr[Domain, +Dist <: Density[Domain] with Rand[Domain]] extends RandomVariable[Domain] with HasDistribution[Domain]

    Permalink

    A random variable which has a computable probability density.

    A random variable which has a computable probability density.

    Domain

    The set over which the random variable takes its values.

    Dist

    A breeze probability density defined on the Domain

  37. abstract class RandomVariable[Domain] extends Serializable

    Permalink

    Represents a bare bones representation of a random variable only in terms of samples.

    Represents a bare bones representation of a random variable only in terms of samples.

    Domain

    The domain or space over which the random variable is defined; i.e. the range of values it can take

  38. abstract class RejectionSamplingScheme[ConditioningSet, Domain, Dist <: Density[ConditioningSet] with Rand[ConditioningSet], DistL <: Density[Domain] with Rand[Domain], JointDist <: Density[(ConditioningSet, Domain)] with Rand[(ConditioningSet, Domain)]] extends RandomVariable[(ConditioningSet, Domain)] with RandomVarWithDistr[(ConditioningSet, Domain), JointDist] with BayesJointProbabilityScheme[ConditioningSet, Domain, RandomVarWithDistr[ConditioningSet, Dist], RandomVarWithDistr[Domain, DistL]]

    Permalink

    Created by mandar on 26/7/16.

  39. case class StudentsTRV(mu: Double, mean: Double, sigma: Double) extends AbstractStudentsTRandVar[Double, Double, UnivariateStudentsT] with Product with Serializable

    Permalink

  40. class ThreadedRandomVariable[Domain] extends RandomVariable[Domain]

    Permalink
  41. case class UniformRV(min: Double, max: Double) extends ContinuousRandomVariable[Double] with ContinuousDistrRV[Double] with Product with Serializable

    Permalink

    Created by mandar on 26/7/16.

  42. class VectorIIDProbit extends Likelihood[DenseVector[Double], DenseVector[Double], DenseMatrix[Double], (DenseVector[Double], DenseVector[Double])]

    Permalink

    Represents an IID probit likelihood used in Gaussian Process binary classification models

    Represents an IID probit likelihood used in Gaussian Process binary classification models

    p(y = 1| f) = Φ(yf)

  43. class VectorIIDSigmoid extends Likelihood[DenseVector[Double], DenseVector[Double], DenseMatrix[Double], (DenseVector[Double], DenseVector[Double])]

    Permalink

    Represents an IID sigmoid likelihood used in Gaussian Process binary classification models

    Represents an IID sigmoid likelihood used in Gaussian Process binary classification models

    p(y = 1| f) = 1/(1 + exp(-yf))

  44. trait ContinuousDistrRV[Domain] extends ContinuousRandomVariable[Domain] with ContinuousRVWithDistr[Domain, ContinuousDistr[Domain]]

    Permalink

    A continuous random variable that has an associated probability density function.

    A continuous random variable that has an associated probability density function.

    Annotations
    @deprecated
    Deprecated

    ContinuousDistrRV is deprecated as of DynaML v1.5, prefer ContinuousRVWithDistr

Value Members

  1. object ApproxBayesComputation extends Serializable

    Permalink
  2. object ContinuousDistrMixture extends Serializable

    Permalink

    Contains convenience methods for creating various mixture random variable instances.

  3. object ContinuousMeasurableFunc extends Serializable

    Permalink
  4. object DifferentiableLikelihoodModel extends Serializable

    Permalink
  5. def E(rv: RandomVariable[Double]): Double

    Permalink
  6. def E[I](rv: RandomVariable[I])(implicit f: InnerProductSpace[I, Double]): I

    Permalink

    Calculate the monte carlo estimate of the first moment/expectation of a random variable.

    Calculate the monte carlo estimate of the first moment/expectation of a random variable.

    I

    The domain of the random variable.

    rv

    The random variable from which to sample

    f

    An implicit object representing an inner product on I

  7. object EncodedContDistrRV extends Serializable

    Permalink
  8. object IIDContinuousRVDistr extends Serializable

    Permalink
  9. object IIDDiscreteRVDistr extends Serializable

    Permalink
  10. object IIDRandomVarDistr extends Serializable

    Permalink
  11. object IIDRandomVariable extends Serializable

    Permalink
  12. def KL[I, Distr <: ContinuousDistr[I]](p: ContinuousRVWithDistr[I, Distr])(q: ContinuousRVWithDistr[I, Distr]): Double

    Permalink

    KL divergence:

    KL divergence:

    p

    The base random variable

    q

    The random variable used to approximate p

    returns

    The Kulback Leibler divergence KL(P||Q)

  13. object LikelihoodModel extends Serializable

    Permalink
  14. object MeasurableFunction extends Serializable

    Permalink
  15. object MixtureRV extends Serializable

    Permalink
  16. object MultGaussianPRV extends Serializable

    Permalink
  17. object MultGaussianRV extends Serializable

    Permalink
  18. object MultStudentsTPRV extends Serializable

    Permalink
  19. object MultStudentsTRV extends Serializable

    Permalink
  20. def OrderStats(r: ContinuousRVWithDistr[Double, ContinuousDistr[Double]], alpha: Double): (Double, Double, Double, Double, Double)

    Permalink

    Calculate the (monte carlo approximation to) mean, median, mode, lower and upper confidence interval.

    Calculate the (monte carlo approximation to) mean, median, mode, lower and upper confidence interval.

    r

    Continuous random variable in question

    alpha

    Probability of exclusion, i.e. return 100(1-alpha) % confidence interval. alpha should be between 0 and 1

  21. object RandomVariable extends Serializable

    Permalink

    Companion object of the RandomVariable class.

    Companion object of the RandomVariable class. Contains apply methods which can create random variables.

  22. var candidates: Int

    Permalink

    Number of monte carlo samples to generate.

  23. package distributions

    Permalink
  24. def entropy[I, Distr <: ContinuousDistr[I]](rv: ContinuousRVWithDistr[I, Distr]): Double

    Permalink

    Calculate the entropy of a random variable

  25. package mcmc

    Permalink

Inherited from AnyRef

Inherited from Any

Ungrouped