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

Multivariate multiple regression with parameter expansion. More...

#include <MuGen.h>

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

Public Member Functions

 BetaGrpPEX ()
 Default constructor.
 
 BetaGrpPEX (const Grp &rsp, const string &predFlNam, const size_t &Npred, const double &Spr, RanIndex &up, const int &nThr)
 Simple constructor with a prior index. More...
 
 BetaGrpPEX (const Grp &rsp, const string &predFlNam, const size_t &Npred, const double &Spr, RanIndex &low, RanIndex &up, const int &nThr)
 Simple constructor with a prior index and replication. More...
 
 BetaGrpPEX (const Grp &rsp, const string &predFlNam, const size_t &Npred, const double &Spr, RanIndex &up, const string &outFlNam, const int &nThr)
 Simple constructor with a prior index and output file name. More...
 
 BetaGrpPEX (const Grp &rsp, const string &predFlNam, const size_t &Npred, const double &Spr, RanIndex &low, RanIndex &up, const string &outFlNam, const int &nThr)
 Simple constructor with a prior index, replication and output file name. More...
 
 BetaGrpPEX (const Grp &rsp, const string &predFlNam, const size_t &Npred, const double &Spr, const double &absLab, RanIndex &up, const int &nThr)
 Missing data constructor with a prior index. More...
 
 BetaGrpPEX (const Grp &rsp, const string &predFlNam, const size_t &Npred, const double &Spr, const double &absLab, RanIndex &low, RanIndex &up, const int &nThr)
 Missing data constructor with a prior index and replication. More...
 
 BetaGrpPEX (const Grp &rsp, const string &predFlNam, const size_t &Npred, const double &Spr, const double &absLab, RanIndex &up, const string &outFlNam, const int &nThr)
 Missing data constructor with a prior index and output file name. More...
 
 BetaGrpPEX (const Grp &rsp, const string &predFlNam, const size_t &Npred, const double &Spr, const double &absLab, RanIndex &low, RanIndex &up, const string &outFlNam, const int &nThr)
 Missing data constructor with a prior index, replication and output file name. More...
 
 BetaGrpPEX (const Grp &rsp, const SigmaI &SigI, const string &predFlNam, const size_t &Npred, const double &Spr, const double &Nmul, const double &rSqMax, RanIndex &up, const string &outFlNam, const int &nThr)
 Selection constructor. More...
 
 BetaGrpPEX (const Grp &rsp, const SigmaI &SigI, const string &predFlNam, const size_t &Npred, const double &Spr, const double &Nmul, const double &rSqMax, RanIndex &low, RanIndex &up, const string &outFlNam, const int &nThr)
 Selection constructor with replication. More...
 
 BetaGrpPEX (const Grp &rsp, const SigmaI &SigI, const string &predFlNam, const size_t &Npred, const double &Spr, const double &Nmul, const double &rSqMax, const double &absLab, RanIndex &up, const string &outFlNam, const int &nThr)
 Selection constructor with missing predictor data. More...
 
 BetaGrpPEX (const Grp &rsp, const SigmaI &SigI, const string &predFlNam, const size_t &Npred, const double &Spr, const double &Nmul, const double &rSqMax, const double &absLab, RanIndex &low, RanIndex &up, const string &outFlNam, const int &nThr)
 Selection constructor with missing predictor data and replication. More...
 
virtual ~BetaGrpPEX ()
 Destructor.
 
virtual const gsl_matrix * fMat () const
 Access adjusted fitted value matrix. More...
 
virtual void save ()
 Save adjusted values. More...
 
virtual void save (const string &outFlNam)
 Save adjusted values to named file. More...
 
virtual void save (const SigmaI &SigI)
 Save adjusted values with the adjusted covariance matrix. More...
 
virtual void update (const Grp &dat, const SigmaI &SigIm, const SigmaI &SigIp)
 Gaussian likelihood, 0-mean Gaussian prior. 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 BetaGrpFt
 BetaGrpFt ()
 Default constructor.
 
 BetaGrpFt (const Grp &rsp, const string &predFlNam, const size_t &Npred, const int &nThr)
 Simple constructor. More...
 
 BetaGrpFt (const Grp &rsp, const string &predFlNam, const size_t &Npred, RanIndex &up, const int &nThr)
 Simple constructor with a prior index. More...
 
 BetaGrpFt (const Grp &rsp, const string &predFlNam, const size_t &Npred, RanIndex &low, RanIndex &up, const int &nThr)
 Simple constructor with a prior index and replication. More...
 
 BetaGrpFt (const Grp &rsp, const string &predFlNam, const size_t &Npred, const string &outFlNam, const int &nThr)
 Simple constructor with output file name. More...
 
 BetaGrpFt (const Grp &rsp, const string &predFlNam, const size_t &Npred, RanIndex &up, const string &outFlNam, const int &nThr)
 Simple constructor with a prior index and output file name. More...
 
 BetaGrpFt (const Grp &rsp, const string &predFlNam, const size_t &Npred, RanIndex &low, RanIndex &up, const string &outFlNam, const int &nThr)
 Simple constructor with a prior index, replication and output file name. More...
 
 BetaGrpFt (const Grp &rsp, const string &predFlNam, const size_t &Npred, const double &absLab, const int &nThr)
 Missing data constructor. More...
 
 BetaGrpFt (const Grp &rsp, const string &predFlNam, const size_t &Npred, const double &absLab, RanIndex &up, const int &nThr)
 Missing data constructor with a prior index. More...
 
 BetaGrpFt (const Grp &rsp, const string &predFlNam, const size_t &Npred, const double &absLab, RanIndex &low, RanIndex &up, const int &nThr)
 Missing data constructor with a prior index and replication. More...
 
 BetaGrpFt (const Grp &rsp, const string &predFlNam, const size_t &Npred, const double &absLab, const string &outFlNam, const int &nThr)
 Missing data constructor with output file name. More...
 
 BetaGrpFt (const Grp &rsp, const string &predFlNam, const size_t &Npred, const double &absLab, RanIndex &up, const string &outFlNam, const int &nThr)
 Missing data constructor with a prior index and output file name. More...
 
 BetaGrpFt (const Grp &rsp, const string &predFlNam, const size_t &Npred, const double &absLab, RanIndex &low, RanIndex &up, const string &outFlNam, const int &nThr)
 Missing data constructor with a prior index, replication and output file name. More...
 
 BetaGrpFt (const Grp &rsp, const SigmaI &SigI, const string &predFlNam, const size_t &Npred, const double &Nmul, const double &rSqMax, RanIndex &up, const string &outFlNam, const int &nThr)
 Selection constructor. More...
 
 BetaGrpFt (const Grp &rsp, const SigmaI &SigI, const string &predFlNam, const size_t &Npred, const double &Nmul, const double &rSqMax, RanIndex &low, RanIndex &up, const string &outFlNam, const int &nThr)
 Selection constructor with replication. More...
 
 BetaGrpFt (const Grp &rsp, const SigmaI &SigI, const string &predFlNam, const size_t &Npred, const double &Nmul, const double &rSqMax, const double &absLab, RanIndex &up, const string &outFlNam, const int &nThr)
 Selection constructor with missing predictor data. More...
 
 BetaGrpFt (const Grp &rsp, const SigmaI &SigI, const string &predFlNam, const size_t &Npred, const double &Nmul, const double &rSqMax, const double &absLab, RanIndex &low, RanIndex &up, const string &outFlNam, const int &nThr)
 Selection constructor with missing predictor data and replication. More...
 
virtual ~BetaGrpFt ()
 Destructor.
 
 BetaGrpFt (const BetaGrpFt &mG)
 Copy constructor. More...
 
BetaGrpFtoperator= (const BetaGrpFt &mG)
 Assignment operator. More...
 
void dump ()
 Dump to a file. More...
 
double lnOddsRat (const Grp &y, const SigmaI &SigI, const size_t i) const
 Log-odds ratio. More...
 
void update (const Grp &dat, const SigmaI &SigIm)
 Gaussian likelihood, improper prior. More...
 
void update (const Grp &dat, const Qgrp &q, const SigmaI &SigIm)
 Student- \(t\) likelihood, improper prior. More...
 
- Public Member Functions inherited from Grp
virtual ~Grp ()
 Destructor.
 
virtual void save (const string &outMuFlNam, const string &outSigFlNam, const SigmaI &SigI)
 Joint save. 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...
 
const vector< MVnorm * > & dataVec () const
 Get vector of row pointers. More...
 
virtual const gsl_matrix * dMat () 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...
 
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 Member Functions

void _finishConstruct (const double &Spr)
 Finish construction. More...
 
void _finishFitted ()
 Adjusted matrix calculation. More...
 
void _updateAfitted ()
 Calculate redundant parameter fitted values. More...
 
 BetaGrpPEX (const double &Spr)
 Finishing constructor. More...
 
- Protected Member Functions inherited from BetaGrpFt
virtual void _updateFitted ()
 Update fitted values.
 
void _rankPred (const gsl_matrix *y, const SigmaI &SigI, gsl_vector *XtX, gsl_permutation *prm)
 Rank predictors. More...
 
void _rankPred (const gsl_matrix *y, const SigmaI &SigI, const double &absLab, gsl_vector *XtX, gsl_permutation *prm)
 Rank predictors with missing data. More...
 
void _ldToss (const gsl_vector *var, const gsl_permutation *prm, const double &rSqMax, const size_t &Npck, vector< vector< size_t > > &idx, vector< vector< size_t > > &rLd, gsl_matrix *Xpck)
 Testing candidates for correlation. More...
 
virtual double _MGkernel (const Grp &dat, const SigmaI &SigI) const
 Gaussian kernel. More...
 
virtual double _MGkernel (const Grp &dat, const SigmaI &SigI, const size_t &prInd) const
 Gaussian kernel dropping one predictor. More...
 
- Protected Member Functions inherited from Grp
 Grp ()
 

Protected Attributes

gsl_matrix * _tSigIAt
 Scaled inverse-covariance. More...
 
Apex _A
 Multiplicative redundant parameter.
 
vector< vector< double > > _ftA
 Fitted values. More...
 
gsl_matrix * _fittedAllAdj
 Adjusted fitted matrix. More...
 
- Protected Attributes inherited from BetaGrpFt
vector< vector< double > > _fittedEach
 Partial fitted value matrices. More...
 
gsl_matrix * _fittedAll
 Matrix of fitted values. More...
 
gsl_matrix * _valueSum
 Sample storage matrix. More...
 
gsl_matrix * _Xmat
 Predictor matrix. More...
 
int _nThr
 Number of threads.
 
double _numSaves
 Number of saves. More...
 
- 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.
 

Detailed Description

Multivariate multiple regression with parameter expansion.

Implements multiplicative prameter expansion as in MuGrpPEX, but for regression coefficients. The "raw" value matrix \( \boldsymbol{\Xi} \) contains regression coefficients on the unadjusted scale (see MuGrpPEX for explanation of these terms). The adjusted regression coefficient matrix is not calculated, but fMat() point to the adjusted fitted value matrix \( \boldsymbol{X \Xi A} \). Regression models with this method must have a prior, typically one with mean zero.

Constructor & Destructor Documentation

◆ BetaGrpPEX() [1/13]

BetaGrpPEX::BetaGrpPEX ( const double &  Spr)
inlineprotected

Finishing constructor.

For use in BetaGrpPCpex.

Parameters
[in]double&prior inverse variance for \( \boldsymbol{A} \)

◆ BetaGrpPEX() [2/13]

BetaGrpPEX::BetaGrpPEX ( const Grp rsp,
const string &  predFlNam,
const size_t &  Npred,
const double &  Spr,
RanIndex up,
const int &  nThr 
)
inline

Simple constructor with a prior index.

Reads the predictor from a file and initiates regression coefficients using the provided response data. Number of rows of the predictor is equal to the number of rows in the response (no replication).

Parameters
[in]Grp&response
[in]srting&predictor file name
[in]size_t&number of predictors
[in]double&prior inverse variance for \( \boldsymbol{A} \)
[in]RanIndex&index to the prior
[in]int&number of threads

◆ BetaGrpPEX() [3/13]

BetaGrpPEX::BetaGrpPEX ( const Grp rsp,
const string &  predFlNam,
const size_t &  Npred,
const double &  Spr,
RanIndex low,
RanIndex up,
const int &  nThr 
)
inline

Simple constructor with a prior index and replication.

Reads the predictor from a file and initiates regression coefficients using the provided response data. Number of rows of the predictor is equal to the number of groups in the lower (data) index. The number of rows in the response is equal to the number of elements in the low index

Parameters
[in]Grp&response
[in]srting&predictor file name
[in]size_t&number of predictors
[in]double&prior inverse variance for \( \boldsymbol{A} \)
[in]RanIndex&replication index
[in]RanIndex&index to the prior
[in]int&number of threads

◆ BetaGrpPEX() [4/13]

BetaGrpPEX::BetaGrpPEX ( const Grp rsp,
const string &  predFlNam,
const size_t &  Npred,
const double &  Spr,
RanIndex up,
const string &  outFlNam,
const int &  nThr 
)
inline

Simple constructor with a prior index and output file name.

Reads the predictor from a file and initiates regression coefficients using the provided response data. Number of rows of the predictor is equal to the number of rows in the response (no replication).

Parameters
[in]Grp&response
[in]srting&predictor file name
[in]size_t&number of predictors
[in]double&prior inverse variance for \( \boldsymbol{A} \)
[in]RanIndex&index to the prior
[in]string&output file name
[in]int&number of threads

◆ BetaGrpPEX() [5/13]

BetaGrpPEX::BetaGrpPEX ( const Grp rsp,
const string &  predFlNam,
const size_t &  Npred,
const double &  Spr,
RanIndex low,
RanIndex up,
const string &  outFlNam,
const int &  nThr 
)
inline

Simple constructor with a prior index, replication and output file name.

Reads the predictor from a file and initiates regression coefficients using the provided response data. Number of rows of the predictor is equal to the number of groups in the lower (data) index. The number of rows in the response is equal to the number of elements in the low index

Parameters
[in]Grp&response
[in]srting&predictor file name
[in]size_t&number of predictors
[in]double&prior inverse variance for \( \boldsymbol{A} \)
[in]RanIndex&replication index
[in]RanIndex&index to the prior
[in]string&output file name
[in]int&number of threads

◆ BetaGrpPEX() [6/13]

BetaGrpPEX::BetaGrpPEX ( const Grp rsp,
const string &  predFlNam,
const size_t &  Npred,
const double &  Spr,
const double &  absLab,
RanIndex up,
const int &  nThr 
)
inline

Missing data constructor with a prior index.

Reads the predictor from a file and initiates regression coefficients using the provided response data. Predictor has missing data labeled by the provided value. Number of rows of the predictor is equal to the number of rows in the response (no replication).

Parameters
[in]Grp&response
[in]srting&predictor file name
[in]size_t&number of predictors
[in]double&prior inverse variance for \( \boldsymbol{A} \)
[in]double&missing data label
[in]RanIndex&index to the prior
[in]int&number of threads

◆ BetaGrpPEX() [7/13]

BetaGrpPEX::BetaGrpPEX ( const Grp rsp,
const string &  predFlNam,
const size_t &  Npred,
const double &  Spr,
const double &  absLab,
RanIndex low,
RanIndex up,
const int &  nThr 
)
inline

Missing data constructor with a prior index and replication.

Reads the predictor from a file and initiates regression coefficients using the provided response data. Predictor has missing data labeled by the provided value. Number of rows of the predictor is equal to the number of groups in the lower (data) index. The number of rows in the response is equal to the number of elements in the low index

Parameters
[in]Grp&response
[in]srting&predictor file name
[in]size_t&number of predictors
[in]double&prior inverse variance for \( \boldsymbol{A} \)
[in]double&missing data label
[in]RanIndex&replication index
[in]RanIndex&index to the prior
[in]int&number of threads

◆ BetaGrpPEX() [8/13]

BetaGrpPEX::BetaGrpPEX ( const Grp rsp,
const string &  predFlNam,
const size_t &  Npred,
const double &  Spr,
const double &  absLab,
RanIndex up,
const string &  outFlNam,
const int &  nThr 
)
inline

Missing data constructor with a prior index and output file name.

Reads the predictor from a file and initiates regression coefficients using the provided response data. Predictor has missing data labeled by the provided value. Number of rows of the predictor is equal to the number of rows in the response (no replication).

Parameters
[in]Grp&response
[in]srting&predictor file name
[in]size_t&number of predictors
[in]double&prior inverse variance for \( \boldsymbol{A} \)
[in]double&missing data label
[in]RanIndex&index to the prior
[in]string&output file name
[in]int&number of threads

◆ BetaGrpPEX() [9/13]

BetaGrpPEX::BetaGrpPEX ( const Grp rsp,
const string &  predFlNam,
const size_t &  Npred,
const double &  Spr,
const double &  absLab,
RanIndex low,
RanIndex up,
const string &  outFlNam,
const int &  nThr 
)
inline

Missing data constructor with a prior index, replication and output file name.

Reads the predictor from a file and initiates regression coefficients using the provided response data. Predictor has missing data labeled by the provided value. Number of rows of the predictor is equal to the number of groups in the lower (data) index. The number of rows in the response is equal to the number of elements in the low index

Parameters
[in]Grp&response
[in]srting&predictor file name
[in]size_t&number of predictors
[in]double&prior inverse variance for \( \boldsymbol{A} \)
[in]double&missing data label
[in]RanIndex&replication index
[in]RanIndex&index to the prior
[in]string&output file name
[in]int&number of threads

◆ BetaGrpPEX() [10/13]

BetaGrpPEX::BetaGrpPEX ( const Grp rsp,
const SigmaI SigI,
const string &  predFlNam,
const size_t &  Npred,
const double &  Spr,
const double &  Nmul,
const double &  rSqMax,
RanIndex up,
const string &  outFlNam,
const int &  nThr 
)
inline

Selection constructor.

Unlike the previous constructors, selection-type constructors pre-screen predictors for association with any of the traits (using Hoteling-like multi-trait statistics), and keeps only the specified proportion in the model. The candidate predictors are further screened for between-predictor correlation and only ones with \( r^2 \) below the provided threshold are kept in the model. This among-predictor correlation often arises in SNP data, where there is likage disequilbrium (LD) among markers. Once the predictors are picked, the updating proceeds like for other BetaGrpFt objects, i.e. the set remains the same (unlike variable selection).

Warning
This set of models is still experimental and has not been extenisively tested. For example, it seems clear that the rest of the model has to be pre-run to convergence before initializing this kind of object. Furthermore, the initializeing predictor probably has to be a mean of several ( \( \sim 50 \)) MCMC samples.
Parameters
[in]Grp&response
[in]SigmaI&data inverse-covariance
[in]srting&predictor file name
[in]size_t&number of predictors
[in]double&prior inverse variance for \( \boldsymbol{A} \)
[in]double&fraction of predictors to retain, as a fraction of the number of data points
[in]double&\( r^2 \) cut-off for among-predictor correlation
[in]RanIndex&index to the prior
[in]string&output file name
[in]int&number of threads

◆ BetaGrpPEX() [11/13]

BetaGrpPEX::BetaGrpPEX ( const Grp rsp,
const SigmaI SigI,
const string &  predFlNam,
const size_t &  Npred,
const double &  Spr,
const double &  Nmul,
const double &  rSqMax,
RanIndex low,
RanIndex up,
const string &  outFlNam,
const int &  nThr 
)
inline

Selection constructor with replication.

Unlike the previous constructors, selection-type constructors pre-screen predictors for association with any of the traits (using Hoteling-like multi-trait statistics), and keeps only the specified proportion in the model. The candidate predictors are further screened for between-predictor correlation and only ones with \( r^2 \) below the provided threshold are kept in the model. This among-predictor correlation often arises in SNP data, where there is likage disequilbrium (LD) among markers. Once the predictors are picked, the updating proceeds like for other BetaGrpFt objects, i.e. the set remains the same (unlike variable selection).

Warning
This set of models is still experimental and has not been extenisively tested. For example, it seems clear that the rest of the model has to be pre-run to convergence before initializing this kind of object. Furthermore, the initializeing predictor probably has to be a mean of several ( \( \sim 50 \)) MCMC samples.
Parameters
[in]Grp&response
[in]SigmaI&data inverse-covariance
[in]srting&predictor file name
[in]size_t&number of predictors
[in]double&prior inverse variance for \( \boldsymbol{A} \)
[in]double&fraction of predictors to retain, as a fraction of the number of data points
[in]double&\( r^2 \) cut-off for among-predictor correlation
[in]RanIndex&replication index
[in]RanIndex&index to the prior
[in]string&output file name
[in]int&number of threads

◆ BetaGrpPEX() [12/13]

BetaGrpPEX::BetaGrpPEX ( const Grp rsp,
const SigmaI SigI,
const string &  predFlNam,
const size_t &  Npred,
const double &  Spr,
const double &  Nmul,
const double &  rSqMax,
const double &  absLab,
RanIndex up,
const string &  outFlNam,
const int &  nThr 
)
inline

Selection constructor with missing predictor data.

Unlike the previous constructors, selection-type constructors pre-screen predictors for association with any of the traits (using Hoteling-like multi-trait statistics), and keeps only the specified proportion in the model. The candidate predictors are further screened for between-predictor correlation and only ones with \( r^2 \) below the provided threshold are kept in the model. This among-predictor correlation often arises in SNP data, where there is likage disequilbrium (LD) among markers. Once the predictors are picked, the updating proceeds like for other BetaGrpFt objects, i.e. the set remains the same (unlike variable selection). Missing predictor data are filled in by mean imputation.

Warning
This set of models is still experimental and has not been extenisively tested. For example, it seems clear that the rest of the model has to be pre-run to convergence before initializing this kind of object. Furthermore, the initializeing predictor probably has to be a mean of several ( \( \sim 50 \)) MCMC samples.
Parameters
[in]Grp&response
[in]SigmaI&data inverse-covariance
[in]srting&predictor file name
[in]size_t&number of predictors
[in]double&prior inverse variance for \( \boldsymbol{A} \)
[in]double&fraction of predictors to retain, as a fraction of the number of data points
[in]double&\( r^2 \) cut-off for among-predictor correlation
[in]double&missing data label
[in]RanIndex&index to the prior
[in]string&output file name
[in]int&number of threads

◆ BetaGrpPEX() [13/13]

BetaGrpPEX::BetaGrpPEX ( const Grp rsp,
const SigmaI SigI,
const string &  predFlNam,
const size_t &  Npred,
const double &  Spr,
const double &  Nmul,
const double &  rSqMax,
const double &  absLab,
RanIndex low,
RanIndex up,
const string &  outFlNam,
const int &  nThr 
)
inline

Selection constructor with missing predictor data and replication.

Unlike the previous constructors, selection-type constructors pre-screen predictors for association with any of the traits (using Hoteling-like multi-trait statistics), and keeps only the specified proportion in the model. The candidate predictors are further screened for between-predictor correlation and only ones with \( r^2 \) below the provided threshold are kept in the model. This among-predictor correlation often arises in SNP data, where there is likage disequilbrium (LD) among markers. Once the predictors are picked, the updating proceeds like for other BetaGrpFt objects, i.e. the set remains the same (unlike variable selection). Missing predictor data are filled in by mean imputation.

Warning
This set of models is still experimental and has not been extenisively tested. For example, it seems clear that the rest of the model has to be pre-run to convergence before initializing this kind of object. Furthermore, the initializeing predictor probably has to be a mean of several ( \( \sim 50 \)) MCMC samples.
Parameters
[in]Grp&response
[in]SigmaI&data inverse-covariance
[in]srting&predictor file name
[in]size_t&number of predictors
[in]double&prior inverse variance for \( \boldsymbol{A} \)
[in]double&fraction of predictors to retain, as a fraction of the number of data points
[in]double&\( r^2 \) cut-off for among-predictor correlation
[in]double&missing data label
[in]RanIndex&replication index
[in]RanIndex&index to the prior
[in]string&output file name
[in]int&number of threads

Member Function Documentation

◆ _finishConstruct()

void BetaGrpPEX::_finishConstruct ( const double &  Spr)
protected

Finish construction.

Most of the construction tasks are handled by the parent class. This function sets up the PEX portion of the class.

Parameters
[in]double&prior inverse variance for \( \boldsymbol{A} \)

◆ _finishFitted()

void BetaGrpPEX::_finishFitted ( )
protected

Adjusted matrix calculation.

Calculates adjusted fitted matrix and all sub-matrices.

◆ fMat()

virtual const gsl_matrix* BetaGrpPEX::fMat ( ) const
inlinevirtual

Access adjusted fitted value matrix.

Returns
gsl_matrix* pointer to the adjusted-value fitted matrix

Reimplemented from BetaGrpFt.

Reimplemented in BetaGrpPCpex.

◆ save() [1/3]

void BetaGrpPEX::save ( )
virtual

Save adjusted values.

Appends the current adjusted mean values to the file whose name was set during construction.

Reimplemented from Grp.

Reimplemented in BetaGrpPCpex.

◆ save() [2/3]

void BetaGrpPEX::save ( const SigmaI SigI)
virtual

Save adjusted values with the adjusted covariance matrix.

Appends the current adjusted mean values and prior covariance matrix to the files whose names were set during construction.

Reimplemented from BetaGrpFt.

Reimplemented in BetaGrpPCpex.

◆ save() [3/3]

void BetaGrpPEX::save ( const string &  outFlNam)
virtual

Save adjusted values to named file.

Appends the current adjusted mean values to the named file.

Parameters
[in]string&file name

Reimplemented from Grp.

Reimplemented in BetaGrpPCpex.

◆ update() [1/8]

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

Student- \(t\) likelihood, non-zero mean Student- \(t\) prior.

For the relationship to work properly, the _upLevel index of the focal object has to point to the rows of the prior mean matrix. This is the matrix addressed by dMat(). The relationship to the data is dependent on the derived class.

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

Reimplemented from BetaGrpFt.

Reimplemented in BetaGrpPCpex.

◆ update() [2/8]

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

Student- \(t\) likelihood, non-zero mean Gaussian prior.

For the relationship to work properly, the _upLevel index of the focal object has to point to the rows of the prior mean matrix. This is the matrix addressed by dMat(). The relationship to the data is dependent on the derived class.

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

Reimplemented from BetaGrpFt.

Reimplemented in BetaGrpPCpex.

◆ update() [3/8]

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

Student- \(t\) likelihood, 0-mean Student- \(t\) prior.

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

Reimplemented from BetaGrpFt.

Reimplemented in BetaGrpPCpex.

◆ update() [4/8]

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

Student- \(t\) likelihood, 0-mean Gaussian prior.

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

Reimplemented from BetaGrpFt.

Reimplemented in BetaGrpPCpex.

◆ update() [5/8]

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

Gaussian likelihood, non-zero mean Student- \(t\) prior.

For the relationship to work properly, the _upLevel index of the focal object has to point to the rows of the prior mean matrix. This is the matrix addressed by dMat(). The relationship to the data is dependent on the derived class.

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

Reimplemented from BetaGrpFt.

Reimplemented in BetaGrpPCpex.

◆ update() [6/8]

void BetaGrpPEX::update ( const Grp ,
const SigmaI ,
const Grp ,
const SigmaI  
)
virtual

Gaussian likelihood, non-zero mean Gaussian prior.

For the relationship to work properly, the _upLevel index of the focal object has to point to the rows of the prior mean matrix. This is the matrix addressed by dMat(). The relationship to the data is dependent on the derived class.

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

Reimplemented from BetaGrpFt.

Reimplemented in BetaGrpPCpex.

◆ update() [7/8]

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

Gaussian likelihood, 0-mean Student- \(t\) prior.

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

Reimplemented from BetaGrpFt.

Reimplemented in BetaGrpPCpex.

◆ update() [8/8]

void BetaGrpPEX::update ( const Grp ,
const SigmaI ,
const SigmaI  
)
virtual

Gaussian likelihood, 0-mean Gaussian prior.

Parameters
[in]Grp&data
[in]SigmaI&data inverse-covariance
[in]SigmaI&prior inverse-covariance

Reimplemented from BetaGrpFt.

Reimplemented in BetaGrpPCpex.

Member Data Documentation

◆ _fittedAllAdj

gsl_matrix* BetaGrpPEX::_fittedAllAdj
protected

Adjusted fitted matrix.

The \( \boldsymbol{X \Xi A} \) matrix. The inherited _fittedAll matrix is \( \boldsymbol{X \Xi} \), i.e. the "raw" version.

◆ _ftA

vector<vector<double> > BetaGrpPEX::_ftA
protected

Fitted values.

Vector of vectorized individual fitted matrices \( \boldsymbol{\Xi}_{\cdot -m}\boldsymbol{A}_{-m\cdot} \).

◆ _tSigIAt

gsl_matrix* BetaGrpPEX::_tSigIAt
protected

Scaled inverse-covariance.

The matrix \( \left( \boldsymbol{\Sigma}^{-1}\boldsymbol{A}^T \right)^T \) that is common for sampling each row of the value matrix.


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