KJB
kjb::Mixture_distribution< Distribution > Class Template Reference

This class implements a mixture distribution. In other words, it is the sum of a finite number of fractions of distributions of the same type (with different parameters). More...

`#include <prob_distribution.h>`

## Public Member Functions

Mixture_distribution (const std::vector< Distribution > &distributions, const std::vector< double > &coefficients)
Constructs a mixture distribution from the given distributions and mixing coefficients. More...

Mixture_distribution (const std::vector< Distribution > &distributions)
Constructs a mixture distribution with equal mixing coefficients. More...

Mixture_distribution (const Distribution &dist1, const Distribution &dist2, double pi1)
Constructs two-element mixture distribution. More...

## Friends

template<class Dist >
double pdf (const kjb::Mixture_distribution< Dist > &dist, const typename Distribution_traits< Mixture_distribution< Dist > >::type &x)

template<class Dist >
double cdf (const kjb::Mixture_distribution< Dist > &dist, const typename Distribution_traits< Mixture_distribution< Dist > >::type &x)

template<class Dist >
Distribution_traits
< Mixture_distribution< Dist >
>::type
sample (const kjb::Mixture_distribution< Dist > &dist)

## Detailed Description

### template<class Distribution> class kjb::Mixture_distribution< Distribution >

This class implements a mixture distribution. In other words, it is the sum of a finite number of fractions of distributions of the same type (with different parameters).

Template Parameters
 Distribution The type of distribution that makes up the different parts of the mixture

## Constructor & Destructor Documentation

template<class Distribution>
 kjb::Mixture_distribution< Distribution >::Mixture_distribution ( const std::vector< Distribution > & distributions, const std::vector< double > & coefficients )
inline

Constructs a mixture distribution from the given distributions and mixing coefficients.

This constructore creates a mixture distribution with the given distributions and the given coefficients, where distributions[i] has mixing coefficient coefficients[i].

template<class Distribution>
 kjb::Mixture_distribution< Distribution >::Mixture_distribution ( const std::vector< Distribution > & distributions )
inline

Constructs a mixture distribution with equal mixing coefficients.

This constructore creates a mixture distribution with the given distributions and equal mixing coefficients. That is, distributions[i] has mixing coefficient 1 / distributions.size(), for all i.

template<class Distribution>
 kjb::Mixture_distribution< Distribution >::Mixture_distribution ( const Distribution & dist1, const Distribution & dist2, double pi1 )
inline

Constructs two-element mixture distribution.

This constructore creates a mixture distribution with two elements, with the coefficient of the first one being pi1, and the coefficient of the second one being 1 - pi1.

## Friends And Related Function Documentation

template<class Distribution>
template<class Dist >
 double cdf ( const kjb::Mixture_distribution< Dist > & dist, const typename Distribution_traits< Mixture_distribution< Dist > >::type & x )
friend
template<class Distribution>
template<class Dist >
 double pdf ( const kjb::Mixture_distribution< Dist > & dist, const typename Distribution_traits< Mixture_distribution< Dist > >::type & x )
friend
template<class Distribution>
template<class Dist >
 Distribution_traits >::type sample ( const kjb::Mixture_distribution< Dist > & dist )
friend

The documentation for this class was generated from the following file: