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

Data with measurement error and missing phenotypes. More...

#include <MuGen.h>

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

Public Member Functions

 MuGrpEEmiss ()
 Default constructor.
 
 MuGrpEEmiss (const string &datFlNam, const string &varFlNam, const string &indFlNam, const string &misMatFlNam, const string &misVecFlNam, RanIndex &up, const size_t &d)
 Constructor with index read from a file. More...
 
 MuGrpEEmiss (const string &datFlNam, const string &varFlNam, const vector< size_t > &varInd, const string &misMatFlNam, const string &misVecFlNam, RanIndex &up, const size_t &d)
 Constructor with index vector. More...
 
 ~MuGrpEEmiss ()
 Destructor.
 
 MuGrpEEmiss (const MuGrpEEmiss &mG)
 Copy constructor. More...
 
MuGrpEEmissoperator= (const MuGrpEEmiss &mG)
 Assignment operator. More...
 
void update (const Grp &muPr, const SigmaI &SigIm)
 Standard Gaussian imputation. More...
 
void update (const Grp &muPr, const Qgrp &q, const SigmaI &SigIm)
 Student- \(t\) likelihood, improper prior. More...
 
- Public Member Functions inherited from MuGrpMiss
 MuGrpMiss ()
 Default constructor.
 
 MuGrpMiss (const string &datFlNam, const string &misMatFlNam, const string &misVecFlNam, RanIndex &up, const size_t &d)
 Full constructor. More...
 
 ~MuGrpMiss ()
 Destructor.
 
 MuGrpMiss (const MuGrpMiss &mG)
 Copy constructor. More...
 
MuGrpMissoperator= (const MuGrpMiss &mG)
 Assignment operator. More...
 
virtual void update (const Grp &mu, const SigmaI &SigIm, const SigmaI &SigIp)
 Gaussian imputation with a prior. More...
 
size_t nMis () const
 
size_t nMis ()
 
- Public Member Functions inherited from MuGrp
 MuGrp ()
 Default constructor.
 
 MuGrp (RanIndex &low, const size_t &d)
 Deterministic zero-value constructor. More...
 
 MuGrp (const string &datFlNam, RanIndex &low, RanIndex &up, const size_t &d)
 Constructor with data from file. More...
 
 MuGrp (const string &datFlNam, RanIndex &up, const size_t &d)
 Constructor with data from file and no lower level. More...
 
 MuGrp (const vector< MVnorm * > &dat, RanIndex &low, RanIndex &up)
 Constructor with a vector of MVnorm pointers. More...
 
 MuGrp (const Grp &dat, RanIndex &low, RanIndex &up)
 Constructor with a Grp object. More...
 
 MuGrp (const vector< MVnorm * > &dat, RanIndex &low, RanIndex &up, const string &outFlNam)
 Constructor with a vector of MVnorm pointers and output file name. More...
 
 MuGrp (const Grp &dat, RanIndex &low, RanIndex &up, const string &outFlNam)
 Constructor with a Grp object and output file name. More...
 
 MuGrp (const Grp &dat, RanIndex &low)
 Deterministic mean constructor. More...
 
 MuGrp (const Grp &dat, const Qgrp &q, RanIndex &low)
 Deterministic weighted mean constructor. More...
 
 MuGrp (const gsl_matrix *dat)
 Deterministic constructor with a GSL matrix. More...
 
 MuGrp (const gsl_matrix *dat, RanIndex &low)
 Deterministic GSL matrix mean constructor. More...
 
 MuGrp (const gsl_matrix *dat, const Qgrp &q, RanIndex &low)
 Deterministic GSL matrix weighted mean constructor. More...
 
virtual ~MuGrp ()
 Destructor.
 
 MuGrp (const MuGrp &mG)
 Copy constructor. More...
 
 MuGrp (const Grp &g)
 Copy constructor. More...
 
MuGrpoperator= (const MuGrp &mG)
 Assignemnt operator. More...
 
virtual void update (const Grp &dat, const Qgrp &q, const SigmaI &SigIm, const SigmaI &SigIp)
 Student- \(t\) likelihood, 0-mean Gaussian prior. More...
 
virtual void update (const Grp &dat, const SigmaI &SigIm, const Qgrp &qPr, const SigmaI &SigIp)
 Gaussian likelihood, 0-mean Student- \(t\) prior. More...
 
virtual void update (const Grp &dat, const Qgrp &q, const SigmaI &SigIm, const Qgrp &qPr, const SigmaI &SigIp)
 Student- \(t\) likelihood, 0-mean Student- \(t\) prior. More...
 
virtual void update (const Grp &dat, const SigmaI &SigIm, const Grp &muPr, const SigmaI &SigIp)
 Gaussian likelihood, non-zero mean Gaussian prior. More...
 
virtual void update (const Grp &dat, const Qgrp &q, const SigmaI &SigIm, const Grp &muPr, const SigmaI &SigIp)
 Student- \(t\) likelihood, non-zero mean Gaussian prior. More...
 
virtual void update (const Grp &dat, const SigmaI &SigIm, const Grp &muPr, const Qgrp &qPr, const SigmaI &SigIp)
 Gaussian likelihood, non-zero mean Student- \(t\) prior. More...
 
virtual void update (const Grp &dat, const Qgrp &q, const SigmaI &SigIm, const Grp &muPr, const Qgrp &qPr, const SigmaI &SigIp)
 Student- \(t\) likelihood, non-zero mean Student- \(t\) prior. More...
 
- Public Member Functions inherited from Grp
virtual ~Grp ()
 Destructor.
 
virtual void save ()
 Save to pre-specified file. More...
 
virtual void save (const string &outFlNam)
 Save to file. More...
 
virtual void save (const string &outMuFlNam, const string &outSigFlNam, const SigmaI &SigI)
 Joint save. More...
 
virtual void save (const SigmaI &SigI)
 Save with inverse-covariance. More...
 
virtual void save (const Grp &y, const SigmaI &SigI)
 Save with data and inverse-covariance. More...
 
void mhlSave (const string &outFlNam, const SigmaI SigI)
 Save Mahalanobis distance. More...
 
virtual void dump ()
 Dump to a file. More...
 
const vector< MVnorm * > & dataVec () const
 Get vector of row pointers. More...
 
virtual const gsl_matrix * dMat () const
 Access the value matrix. More...
 
virtual const gsl_matrix * fMat () const
 Access the value matrix. More...
 
const size_t Ndata () const
 Get number of rows. More...
 
const size_t phenD () const
 Get number of traits. More...
 
virtual double lnOddsRat (const Grp &y, const SigmaI &SigI, const size_t i) const
 Log-odds ratio. More...
 
const MVnormoperator[] (const size_t i) const
 Subscript operator. More...
 
MVnormoperator[] (const size_t i)
 Subscript operator. More...
 
virtual MuGrp mean (RanIndex &grp)
 Group mean. More...
 
virtual const MuGrp mean (RanIndex &grp) const
 Group mean. More...
 
virtual MuGrp mean (RanIndex &grp, const Qgrp &q)
 Group weighted mean. More...
 
virtual const MuGrp mean (RanIndex &grp, const Qgrp &q) const
 Group weighted mean. More...
 
void center ()
 Center the value matrix. More...
 

Protected Attributes

vector< list< double > > _errorInvVar
 Measurement error inverse-variances. More...
 
vector< list< double > > _meanVal
 Means for values with errors. More...
 
vector< list< size_t > > _missErrMat
 Error index. More...
 
- Protected Attributes inherited from MuGrpMiss
vector< size_t > _misInd
 Index of the rows with missing data.
 
- Protected Attributes inherited from Grp
vector< MVnorm * > _theta
 Vector of pointers to value rows. More...
 
gsl_matrix * _valueMat
 Value matrix. More...
 
RanIndex_lowLevel
 Lower level index. More...
 
RanIndex_upLevel
 Upper level index. More...
 
vector< gsl_rng * > _rV
 Vector of PNG pointers. More...
 
string _outFlNam
 Name of the output file.
 

Additional Inherited Members

- Protected Member Functions inherited from Grp
 Grp ()
 

Detailed Description

Data with measurement error and missing phenotypes.

Some traits have measurment errors, some (possibly an overlapping set) are missing. Sampling with error is done only for the present phenotypes, thus not all rows have the same number of traits with error variances.

Constructor & Destructor Documentation

◆ MuGrpEEmiss() [1/3]

MuGrpEEmiss::MuGrpEEmiss ( const string &  datFlNam,
const string &  varFlNam,
const string &  indFlNam,
const string &  misMatFlNam,
const string &  misVecFlNam,
RanIndex up,
const size_t &  d 
)

Constructor with index read from a file.

The data, error variances and the index identifying traits with errors are read from files. The index file must be a white-space separated text file. The index is initially the same for each row, but then the values corresponding to missing phenotypes are dropped for relevant rows.

Parameters
[in]string&data file name
[in]string&variance file name
[in]string&index values file name
[in]string&matrix missing data index file name
[in]string&vector missing data index file name
[in]RainIndex&upper level (prior) index
[in]size_t&number of traits

◆ MuGrpEEmiss() [2/3]

MuGrpEEmiss::MuGrpEEmiss ( const string &  datFlNam,
const string &  varFlNam,
const vector< size_t > &  varInd,
const string &  misMatFlNam,
const string &  misVecFlNam,
RanIndex up,
const size_t &  d 
)

Constructor with index vector.

The data and error variances are read from files, but the index identifying traits with errors is provided in a vector. The index is initially the same for each row, but then the values corresponding to missing phenotypes are dropped for relevant rows.

Parameters
[in]string&data file name
[in]string&variance file name
[in]vector<size_t>&index values
[in]string&matrix missing data index file name
[in]string&vector missing data index file name
[in]RainIndex&upper level (prior) index
[in]size_t&number of traits

◆ MuGrpEEmiss() [3/3]

MuGrpEEmiss::MuGrpEEmiss ( const MuGrpEEmiss mG)

Copy constructor.

Parameters
[in]MuGrpEEmiss&object to be copied
Returns
MuGrpEEmiss object

Member Function Documentation

◆ operator=()

MuGrpEEmiss & MuGrpEEmiss::operator= ( const MuGrpEEmiss mG)

Assignment operator.

Parameters
[in]MuGrpEEmiss&object to be copied
Returns
MuGrpEEmiss& target object

◆ update() [1/2]

void MuGrpEEmiss::update ( const Grp ,
const Qgrp ,
const SigmaI  
)
virtual

Student- \(t\) likelihood, improper prior.

Parameters
[in]Grp&data
[in]Qgrp&Student- \(t\) weight parameter for data
[in]SigmaI&data inverse-covariance

Reimplemented from MuGrp.

◆ update() [2/2]

void MuGrpEEmiss::update ( const Grp mu,
const SigmaI SigIm 
)
virtual

Standard Gaussian imputation.

If some data are present, performs standard Gaussian marginal imputation (desribed in, e.g., [chatfield80] ) with the provided Grp object as a mean and the SigmaI object as the inverse-covariance. If no data for a row are present, simply replaces the row values by a Gaussian sample with mean and inverse-covariance provided. Rows with no missing data are ignored.

Parameters
[in]Grp&mean
[in]SigmaI&inverse-covariance

Reimplemented from MuGrpMiss.

Member Data Documentation

◆ _errorInvVar

vector< list<double> > MuGrpEEmiss::_errorInvVar
protected

Measurement error inverse-variances.

The same configuration as the variance vector of lists. This is the subset of _valueMat that corresponds to the values to be updated with experimental error.

◆ _meanVal

vector< list<double> > MuGrpEEmiss::_meanVal
protected

Means for values with errors.

The length of the vector is equal to the number of rows of the value matrix. For each row, the error variances are in a list that has as many members as there are non-missing phenotypes with errors.

◆ _missErrMat

vector< list<size_t> > MuGrpEEmiss::_missErrMat
protected

Error index.

The same configuration as the variance vector of lists, but containing indexes of the elements of the value matrix that have measurement errors.


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