MuGen
Multitrait genetics
Public Member Functions | Protected Attributes | List of all members
MVnormMuMiss Class Reference

Individual vector of means with missing data. More...

#include <MuGen.h>

Inheritance diagram for MVnormMuMiss:
[legend]
Collaboration diagram for MVnormMuMiss:
[legend]

Public Member Functions

 MVnormMuMiss ()
 Default constructor.
 
 MVnormMuMiss (const size_t &d)
 0-mean deterministic constructor More...
 
 MVnormMuMiss (const size_t &d, const vector< size_t > &low, const size_t &up, const vector< size_t > &mis)
 Deterministic constructor. More...
 
 MVnormMuMiss (gsl_vector *mn, const vector< size_t > &low, const size_t &up, const vector< size_t > &mis)
 Deterministic constructor with a vector. More...
 
 MVnormMuMiss (gsl_vector *mn, const size_t &up, const vector< size_t > &mis)
 Deterministic constructor with a vector. More...
 
 MVnormMuMiss (gsl_vector *mn, const gsl_vector *sd, const gsl_rng *r, const vector< size_t > &low, const size_t &up, const vector< size_t > &mis)
 Univariate random constructor with a vector. More...
 
 MVnormMuMiss (gsl_vector *mn, const gsl_matrix *Sig, const gsl_rng *r, const vector< size_t > &low, const size_t &up, const vector< size_t > &mis)
 Multivariate random constructor with a vector. More...
 
 MVnormMuMiss (gsl_matrix *mn, const size_t &iRw, const vector< size_t > &low, const size_t &up, const vector< size_t > &mis)
 Deterministic constructor with a matrix. More...
 
 MVnormMuMiss (gsl_matrix *mn, const size_t &iRw, const size_t &up, const vector< size_t > &mis)
 Deterministic constructor with a matrix. More...
 
 MVnormMuMiss (gsl_matrix *mn, const size_t &iRw, const gsl_vector *sd, const gsl_rng *r, const vector< size_t > &low, const size_t &up, const vector< size_t > &mis)
 Univariate random constructor with a matrix. More...
 
 MVnormMuMiss (gsl_matrix *mn, const size_t &iRw, const gsl_matrix *Sig, const gsl_rng *r, const vector< size_t > &low, const size_t &up, const vector< size_t > &mis)
 Multivariate random constructor with a matrix. More...
 
 MVnormMuMiss (const MVnormMuMiss &)
 Deterministic copy constructor. More...
 
MVnormMuMissoperator= (const MVnormMuMiss &)
 Assignment operator. More...
 
 ~MVnormMuMiss ()
 Destructor.
 
void update (const Grp &mu, const SigmaI &SigIm, const gsl_rng *r)
 Gaussian likelihood. More...
 
void update (const Grp &mu, const SigmaI &SigIm, const SigmaI &SigIp, const gsl_rng *r)
 Gaussian likelihood, Gaussian 0-mean prior. More...
 
size_t nMissP () const
 Number of missing values. More...
 
const vector< size_t > getMisPhen () const
 Indexes of missing values. More...
 
- Public Member Functions inherited from MVnormMu
 MVnormMu ()
 Default constructor. More...
 
 MVnormMu (const size_t &d)
 Zero vector constructor. More...
 
 MVnormMu (const size_t &d, const vector< size_t > &low, const size_t &up)
 Zero vector with pointers. More...
 
 MVnormMu (gsl_vector *mn, const vector< size_t > &low, const size_t &up)
 Deterministic constructor. More...
 
 MVnormMu (gsl_vector *mn, const size_t &up)
 Deterministic constructor, prior index only. More...
 
 MVnormMu (gsl_matrix *mn, const size_t &iRw)
 Deterministic constructor with a matrix. More...
 
 MVnormMu (gsl_matrix *mn, const size_t &iRw, const vector< size_t > &low)
 Deterministic constructor with a matrix and an index to data. More...
 
 MVnormMu (gsl_matrix *mn, const size_t &iRw, const vector< size_t > &low, const size_t &up)
 Deterministic constructor with a matrix and indexes to data and a prior. More...
 
 MVnormMu (gsl_matrix *mn, const size_t &iRw, const size_t &up)
 Deterministic constructor with a matrix and an index to a prior. More...
 
 MVnormMu (gsl_vector *mn, const gsl_vector *sd, const gsl_rng *r, const vector< size_t > &low, const size_t &up)
 Univariate random constructor with a vector and indexes to data and a prior. More...
 
 MVnormMu (gsl_vector *mn, const gsl_matrix *Sig, const gsl_rng *r, const vector< size_t > &low, const size_t &up)
 Multivariate random constructor with a vector and indexes to data and a prior. More...
 
 MVnormMu (gsl_matrix *mn, const size_t &iRw, const gsl_vector *sd, const gsl_rng *r, const vector< size_t > &low, const size_t &up)
 Univariate random constructor with a matrix and indexes to data and a prior. More...
 
 MVnormMu (gsl_matrix *mn, const size_t &iRw, const gsl_matrix *Sig, const gsl_rng *r, const vector< size_t > &low, const size_t &up)
 Multivariate random constructor with a matrix and indexes to data and a prior. More...
 
 MVnormMu (const MVnormMu &)
 Copy constructor. More...
 
MVnormMuoperator= (const MVnormMu &)
 Assignment operator. More...
 
virtual ~MVnormMu ()
 Destructor.
 
virtual void update (const Grp &dat, const Qgrp &q, const SigmaI &SigIm, const gsl_rng *r)
 Sudent- \(t\) likelihood. More...
 
virtual void update (const Grp &dat, const SigmaI &SigIm, const double &qPr, const SigmaI &SigIp, const gsl_rng *r)
 Gaussian likelihood, Student- \(t\) prior. More...
 
virtual void update (const Grp &dat, const Qgrp &q, const SigmaI &SigIm, const SigmaI &SigIp, const gsl_rng *r)
 Student- \(t\) likelihood, Gaussian prior. More...
 
virtual void update (const Grp &dat, const Qgrp &q, const SigmaI &SigIm, const double &qPr, const SigmaI &SigIp, const gsl_rng *r)
 Student- \(t\) likelihood, Student- \(t\) prior. More...
 
virtual void update (const Grp &dat, const SigmaI &SigIm, const Grp &muPr, const SigmaI &SigIp, const gsl_rng *r)
 Gaussian likelihood, Gaussian prior. More...
 
virtual void update (const Grp &dat, const SigmaI &SigIm, const Grp &muPr, const double &qPr, const SigmaI &SigIp, const gsl_rng *r)
 Gaussian likelihood, Student- \(t\) prior. More...
 
virtual void update (const Grp &dat, const Qgrp &q, const SigmaI &SigIm, const Grp &muPr, const SigmaI &SigIp, const gsl_rng *r)
 Student- \(t\) likelihood, Gaussian prior. More...
 
virtual void update (const Grp &dat, const Qgrp &q, const SigmaI &SigIm, const Grp &muPr, const double &qPr, const SigmaI &SigIp, const gsl_rng *r)
 Student- \(t\) likelihood, Student- \(t\) prior. More...
 
const vector< size_t > * down () const
 Points to the corresponding data. More...
 
const size_t * up () const
 Points to the prior. More...
 
- Public Member Functions inherited from MVnorm
 MVnorm (const MVnorm &)
 Copy constructor. More...
 
MVnormoperator= (const MVnorm &)
 Assignement operator. More...
 
virtual ~MVnorm ()
 Virtual destructor. More...
 
virtual double mhl (const MVnorm *x, const SigmaI &SigI)
 Mahalanobis distance to a vector. More...
 
virtual double mhl (const MVnorm *x, const SigmaI &SigI) const
 Mahalanobis distance to a vector. More...
 
virtual double mhl (const gsl_vector *x, const SigmaI &SigI)
 Mahalanobis distance to a vector. More...
 
virtual double mhl (const gsl_vector *x, const SigmaI &SigI) const
 Mahalanobis distance to a vector. More...
 
virtual double mhl (const SigmaI &SigI)
 Mahalanobis distance to zero. More...
 
virtual double mhl (const SigmaI &SigI) const
 Mahalanobis distance to zero. More...
 
double density (const gsl_vector *theta, const SigmaI &SigI)
 Multivariate Gaussian density. More...
 
double density (const gsl_vector *theta, const SigmaI &SigI) const
 Multivariate Gaussian density. More...
 
double density (const MVnorm *theta, const SigmaI &SigI)
 Multivariate Gaussian density. More...
 
double density (const MVnorm *theta, const SigmaI &SigI) const
 Multivariate Gaussian density. More...
 
void save (const string &fileNam, const char *how="a")
 Save function. More...
 
void save (FILE *fileStr)
 Save function. More...
 
double operator[] (const size_t i) const
 Subscript operator. More...
 
void valSet (const size_t i, const double x)
 Setting an element to a value. More...
 
const gsl_vector * getVec () const
 Access the location vector. More...
 
size_t len () const
 Length of the location vector. More...
 
virtual double scalePar () const
 Scale parameter. More...
 

Protected Attributes

vector< size_t > _misPhenInd
 Missing data index. More...
 
size_t _myInd
 own index More...
 
- Protected Attributes inherited from MVnormMu
const vector< size_t > * _lowLevel
 Data indexes. More...
 
const size_t * _upLevel
 Prior index. More...
 
- Protected Attributes inherited from MVnorm
gsl_vector_view _vec
 Data vector. More...
 
size_t _d
 Length of the data vector.
 

Additional Inherited Members

- Protected Member Functions inherited from MVnorm
 MVnorm ()
 Default constructor. More...
 
 MVnorm (const size_t &d)
 Dimension-only constructor. More...
 
 MVnorm (gsl_vector *mn)
 Dimension and vector value constructor. More...
 
 MVnorm (gsl_vector *mn, const gsl_vector *sd, const gsl_rng *r)
 Univariate Gaussian constructor. More...
 
 MVnorm (gsl_vector *mn, const gsl_matrix *Sig, const gsl_rng *r)
 Multivariate Gaussian constructor. More...
 
 MVnorm (gsl_matrix *mn, const size_t &iRw)
 Dimension and vector value constructor. More...
 
 MVnorm (gsl_matrix *mn, const size_t &iRw, const gsl_vector *sd, const gsl_rng *r)
 Univariate Gaussian constructor with a matrix. More...
 
 MVnorm (gsl_matrix *mn, const size_t &iRw, const gsl_matrix *Sig, const gsl_rng *r)
 Multivariate Gaussian constructor with a matrix. More...
 

Detailed Description

Individual vector of means with missing data.

Implements missing phenotype data imputation. Some parameters for update methods have a different meaning than for other MVnorm classes.

Constructor & Destructor Documentation

◆ MVnormMuMiss() [1/11]

MVnormMuMiss::MVnormMuMiss ( const size_t &  d)
inline

0-mean deterministic constructor

Sets up the instance to point to a vector of zeros

Parameters
[in]size_t&dimension of the vector

◆ MVnormMuMiss() [2/11]

MVnormMuMiss::MVnormMuMiss ( const size_t &  d,
const vector< size_t > &  low,
const size_t &  up,
const vector< size_t > &  mis 
)

Deterministic constructor.

Parameters
[in]size_t&dimension of the vector
[in]vector<size_t>&vector of row indexes for data
[in]size_t&row index for the prior matrix
[in]vector<size_t>&indexes of missing data

◆ MVnormMuMiss() [3/11]

MVnormMuMiss::MVnormMuMiss ( gsl_vector *  mn,
const vector< size_t > &  low,
const size_t &  up,
const vector< size_t > &  mis 
)

Deterministic constructor with a vector.

Parameters
[in]gsl_vector*vector of values
[in]size_t&dimension of the vector
[in]vector<size_t>&vector of row indexes for data
[in]size_t&row index for the prior matrix
[in]vector<size_t>&indexes of missing data

◆ MVnormMuMiss() [4/11]

MVnormMuMiss::MVnormMuMiss ( gsl_vector *  mn,
const size_t &  up,
const vector< size_t > &  mis 
)

Deterministic constructor with a vector.

Parameters
[in]gsl_vector*vector of values
[in]size_t&row index for the prior matrix
[in]vector<size_t>&indexes of missing data

◆ MVnormMuMiss() [5/11]

MVnormMuMiss::MVnormMuMiss ( gsl_vector *  mn,
const gsl_vector *  sd,
const gsl_rng *  r,
const vector< size_t > &  low,
const size_t &  up,
const vector< size_t > &  mis 
)

Univariate random constructor with a vector.

Parameters
[in]gsl_vector*vector of values
[in]gsl_vector*vector of standard deviations
[in]gsl_rng*pointer to a PNG
[in]size_t&dimension of the vector
[in]vector<size_t>&vector of row indexes for data
[in]size_t&row index for the prior matrix
[in]vector<size_t>&indexes of missing data

◆ MVnormMuMiss() [6/11]

MVnormMuMiss::MVnormMuMiss ( gsl_vector *  mn,
const gsl_matrix *  Sig,
const gsl_rng *  r,
const vector< size_t > &  low,
const size_t &  up,
const vector< size_t > &  mis 
)

Multivariate random constructor with a vector.

Parameters
[in]gsl_vector*vector of values
[in]gsl_matrix*covariance matrix
[in]gsl_rng*pointer to a PNG
[in]size_t&dimension of the vector
[in]vector<size_t>&vector of row indexes for data
[in]size_t&row index for the prior matrix
[in]vector<size_t>&indexes of missing data

◆ MVnormMuMiss() [7/11]

MVnormMuMiss::MVnormMuMiss ( gsl_matrix *  mn,
const size_t &  iRw,
const vector< size_t > &  low,
const size_t &  up,
const vector< size_t > &  mis 
)

Deterministic constructor with a matrix.

Parameters
[in]gsl_matrix*vector of values
[in]size_t&row index of the matrix of values
[in]vector<size_t>&vector of row indexes for data
[in]size_t&row index for the prior matrix
[in]vector<size_t>&indexes of missing data

◆ MVnormMuMiss() [8/11]

MVnormMuMiss::MVnormMuMiss ( gsl_matrix *  mn,
const size_t &  iRw,
const size_t &  up,
const vector< size_t > &  mis 
)

Deterministic constructor with a matrix.

Parameters
[in]gsl_matrix*vector of values
[in]size_t&row index of the matrix of values
[in]size_t&row index for the prior matrix
[in]vector<size_t>&indexes of missing data

◆ MVnormMuMiss() [9/11]

MVnormMuMiss::MVnormMuMiss ( gsl_matrix *  mn,
const size_t &  iRw,
const gsl_vector *  sd,
const gsl_rng *  r,
const vector< size_t > &  low,
const size_t &  up,
const vector< size_t > &  mis 
)

Univariate random constructor with a matrix.

Parameters
[in]gsl_matrix*matrix of values
[in]size_t&row index of the matrix of values
[in]gsl_vector*vector of standard deviations
[in]gsl_rng*pointer to a PNG
[in]size_t&dimension of the vector
[in]vector<size_t>&vector of row indexes for data
[in]size_t&row index for the prior matrix
[in]vector<size_t>&indexes of missing data

◆ MVnormMuMiss() [10/11]

MVnormMuMiss::MVnormMuMiss ( gsl_matrix *  mn,
const size_t &  iRw,
const gsl_matrix *  Sig,
const gsl_rng *  r,
const vector< size_t > &  low,
const size_t &  up,
const vector< size_t > &  mis 
)

Multivariate random constructor with a matrix.

Parameters
[in]gsl_matrix*matrix of values
[in]size_t&row index of the matrix of values
[in]gsl_matrix*covariance matrix
[in]gsl_rng*pointer to a PNG
[in]size_t&dimension of the vector
[in]vector<size_t>&vector of row indexes for data
[in]size_t&row index for the prior matrix
[in]vector<size_t>&indexes of missing data

◆ MVnormMuMiss() [11/11]

MVnormMuMiss::MVnormMuMiss ( const MVnormMuMiss )

Deterministic copy constructor.

Parameters
[in]MVnormMuMiss&object of type MVnormMuMiss

Member Function Documentation

◆ getMisPhen()

const vector<size_t> MVnormMuMiss::getMisPhen ( ) const
inlinevirtual

Indexes of missing values.

Accesses a vector with indexes of missing phenotypes. Implemented for this class.

Returns
Vector of size_t that contains indexes that correspond to missing values.

Reimplemented from MVnormMu.

◆ nMissP()

size_t MVnormMuMiss::nMissP ( ) const
inlinevirtual

Number of missing values.

Accesses the number of missing phenotype values. Implemented in this class.

Returns
Number of missing phenotypes, of type size_t.

Reimplemented from MVnormMu.

◆ operator=()

MVnormMuMiss& MVnormMuMiss::operator= ( const MVnormMuMiss )

Assignment operator.

Deterministic assignement operator

Parameters
[in]MVnormMuMiss&object of type MVnormMuMiss
Returns
A reference to an object of type MVnormMuMiss

◆ update() [1/2]

void MVnormMuMiss::update ( const Grp mu,
const SigmaI SigIm,
const gsl_rng *  r 
)
virtual

Gaussian likelihood.

Here, the Grp variable contains the means for imputation rather than the data

Parameters
[in]Grp&data
[in]SigmaI&inverse-covariance matrix for the likelihood
[in]gsl_rng*pointer to a PNG

Reimplemented from MVnormMu.

◆ update() [2/2]

void MVnormMuMiss::update ( const Grp mu,
const SigmaI SigIm,
const SigmaI SigIp,
const gsl_rng *  r 
)
virtual

Gaussian likelihood, Gaussian 0-mean prior.

Here, the Grp variable contains the means for imputation rather than the data

Parameters
[in]Grp&data
[in]SigmaI&inverse-covariance matrix for the likelihood
[in]SigmaI&inverse-covariance matrix for the prior
[in]gsl_rng*pointer to a PNG

Reimplemented from MVnormMu.

Member Data Documentation

◆ _misPhenInd

vector<size_t> MVnormMuMiss::_misPhenInd
protected

Missing data index.

Vector of indexes tagging missing data.

◆ _myInd

size_t MVnormMuMiss::_myInd
protected

own index

Index of the row the current instance of this class is pointing to. Only defined with constructors that take iRw.


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