MuGen
Multitrait genetics
Public Member Functions | List of all members
MixP Class Reference

Dirichlet-multinomial mixture prior. More...

#include <MuGen.h>

Public Member Functions

 MixP ()
 Default constructor.
 
 MixP (const vector< double > &initP)
 Constructor with a vector of proportions. More...
 
 MixP (const gsl_vector *initP)
 Constructor with a GSL vector of proportions. More...
 
 MixP (const vector< double > &initP, const double &a)
 Constructor with a vector of proportions and a single prior class size. More...
 
 MixP (const gsl_vector *initP, const double &a)
 Constructor with a GSL vector of proportions and a single prior class size. More...
 
 MixP (const vector< double > &initP, const double *a, const size_t &len)
 Constructor with a vector of proportions and an array of prior class sizes. More...
 
 MixP (const gsl_vector *initP, const double *a)
 Constructor with a GSL vector of proportions and an array of prior class sizes. More...
 
 MixP (const vector< double > &initP, const vector< double > &a)
 Constructor with a vector of proportions and a vector of prior class sizes. More...
 
 MixP (const gsl_vector *initP, const vector< double > &a)
 Constructor with a GSL vector of proportions and a vector of prior class sizes. More...
 
 MixP (const RanIndex &ind, const double &a)
 Constructor with a RanIndex of group IDs and a vector of prior class sizes. More...
 
 ~MixP ()
 Destructor.
 
 MixP (const MixP &)
 Copy constructor. More...
 
MixPoperator= (const MixP &)
 Assignement operator. More...
 
const double & operator[] (const size_t i) const
 Subscript operator. More...
 
void update (const RanIndex &Nvec)
 Gibbs update function. More...
 

Detailed Description

Dirichlet-multinomial mixture prior.

Implements the Dirichlet-multinomial prior on proportions in a mixture of Gaussians.

Warning
This has not been extenisively tested

Constructor & Destructor Documentation

◆ MixP() [1/10]

MixP::MixP ( const vector< double > &  initP)
inline

Constructor with a vector of proportions.

The prior is set to all ones, i.e. the vaguest possible.

Parameters
[in]vector<double>&vector of initial proportions

◆ MixP() [2/10]

MixP::MixP ( const gsl_vector *  initP)

Constructor with a GSL vector of proportions.

The prior is set to all ones, i.e. the vaguest possible.

Parameters
[in]gsl_vector*vector of initial proportions

◆ MixP() [3/10]

MixP::MixP ( const vector< double > &  initP,
const double &  a 
)

Constructor with a vector of proportions and a single prior class size.

The prior for each mixture category is set to the same provided value.

Parameters
[in]vector<double>&vector of initial proportions
[in]double&prior category size

◆ MixP() [4/10]

MixP::MixP ( const gsl_vector *  initP,
const double &  a 
)

Constructor with a GSL vector of proportions and a single prior class size.

The prior for each mixture category is set to the same provided value.

Parameters
[in]gsl_vector*vector of initial proportions
[in]double&prior category size

◆ MixP() [5/10]

MixP::MixP ( const vector< double > &  initP,
const double *  a,
const size_t &  len 
)

Constructor with a vector of proportions and an array of prior class sizes.

The prior for each mixture category is set to the corresponding value in the array.

Parameters
[in]vector<double>&vector of initial proportions
[in]double*prior category size
[in]size_t&prior array length

◆ MixP() [6/10]

MixP::MixP ( const gsl_vector *  initP,
const double *  a 
)

Constructor with a GSL vector of proportions and an array of prior class sizes.

The prior for each mixture category is set to the corresponding value in the array.

Parameters
[in]gsl_vector*vector of initial proportions
[in]double*prior category size

◆ MixP() [7/10]

MixP::MixP ( const vector< double > &  initP,
const vector< double > &  a 
)

Constructor with a vector of proportions and a vector of prior class sizes.

The prior for each mixture category is set to the corresponding value in the vector.

Parameters
[in]vector<double>&vector of initial proportions
[in]vector<double>&prior category size

◆ MixP() [8/10]

MixP::MixP ( const gsl_vector *  initP,
const vector< double > &  a 
)

Constructor with a GSL vector of proportions and a vector of prior class sizes.

The prior for each mixture category is set to the corresponding value in the vector.

Parameters
[in]gsl_vector*vector of initial proportions
[in]vector<double>prior category size

◆ MixP() [9/10]

MixP::MixP ( const RanIndex ind,
const double &  a 
)

Constructor with a RanIndex of group IDs and a vector of prior class sizes.

The prior for each mixture category is set to the same provided value. The proportions are calculated using the data in the RanIndex object.

Parameters
[in]gsl_vector*vector of initial proportions
[in]double&prior category size

◆ MixP() [10/10]

MixP::MixP ( const MixP mp)

Copy constructor.

Parameters
[in]MixP&object to be copied

Member Function Documentation

◆ operator=()

MixP & MixP::operator= ( const MixP mp)

Assignement operator.

Parameters
[in]Mixp&object to be copied
Returns
MixP target object

◆ operator[]()

const double& MixP::operator[] ( const size_t  i) const
inline

Subscript operator.

Parameters
[in]size_t&index of the category
Returns
double& proprtion of the elements in the given category

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