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

Individual regression with parameter expansion. More...

#include <MuGen.h>

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

Public Member Functions

 MVnormBetaPEX ()
 Default constructor.
 
 MVnormBetaPEX (const gsl_matrix *resp, gsl_matrix *pred, const size_t &iCl, vector< double > &eaFt, const gsl_matrix *Sig, const gsl_rng *r, const size_t &up, gsl_matrix *bet, const size_t &iRw, Apex &A, gsl_matrix *tSigIAt)
 Random constructor. More...
 
 MVnormBetaPEX (const size_t &d, gsl_matrix *pred, const size_t &iCl, vector< double > &eaFt, const size_t &up, gsl_matrix *bet, const size_t &iRw, Apex &A, gsl_matrix *tSigIAt)
 Deterministic constructor. More...
 
 MVnormBetaPEX (const MVnormBetaPEX &bet)
 Deterministic copy constructor. More...
 
MVnormBetaPEXoperator= (const MVnormBetaPEX &bet)
 Assignment operator. More...
 
 ~MVnormBetaPEX ()
 Destructor.
 
void update (const Grp &dat, const SigmaI &SigIm, const SigmaI &SigIp, const gsl_rng *r)
 Gaussian likelihood, Gaussian prior. More...
 
void update (const Grp &dat, const SigmaI &SigIm, const double &qPr, const SigmaI &SigIp, const gsl_rng *r)
 Gaussian likelihood, Student- \(t\) prior. More...
 
void update (const Grp &dat, const Qgrp &q, const SigmaI &SigIm, const SigmaI &SigIp, const gsl_rng *r)
 Student- \(t\) likelihood, Gaussian prior. More...
 
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...
 
void update (const Grp &dat, const SigmaI &SigIm, const Grp &muPr, const SigmaI &SigIp, const gsl_rng *r)
 Gaussian likelihood, Gaussian prior. More...
 
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...
 
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...
 
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...
 
- Public Member Functions inherited from MVnormMuPEX
 MVnormMuPEX ()
 Default constructor.
 
 MVnormMuPEX (gsl_matrix *mn, const size_t &iRw, const vector< size_t > &low, const size_t &up, Apex &A, gsl_matrix *tSigIAt)
 Deterministic constructor. More...
 
 MVnormMuPEX (gsl_matrix *mn, const size_t &iRw, const gsl_vector *sd, const gsl_rng *r, const vector< size_t > &low, const size_t &up, Apex &A, gsl_matrix *tSigIAt)
 Univariate random constructor. More...
 
 MVnormMuPEX (const MVnormMuPEX &mu)
 Deterministic copy constructor. More...
 
MVnormMuPEXoperator= (const MVnormMuPEX &mu)
 Assignment operator. More...
 
virtual ~MVnormMuPEX ()
 Destructor.
 
- 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 SigmaI &SigIm, const gsl_rng *r)
 Gaussian likelihood. More...
 
virtual void update (const Grp &dat, const Qgrp &q, const SigmaI &SigIm, const gsl_rng *r)
 Sudent- \(t\) likelihood. More...
 
virtual size_t nMissP () const
 Number of missing values. More...
 
virtual const vector< size_t > getMisPhen () const
 Indexes of missing values. 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

gsl_vector_view _X
 Predictor. More...
 
double _scale
 Scale parameter. More...
 
size_t _N
 Length of the predictor.
 
gsl_matrix_view _fitted
 Fitted values. More...
 
- Protected Attributes inherited from MVnormMuPEX
Apex_A
 Pointer to the redundant parameter. More...
 
gsl_matrix_view _tSAprod
 Pre-computed auxiliary matrix. 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 regression with parameter expansion.

Implements handling of one-at-a-time regressions, as in MVnormBetaFt but with parameter expansion.

Constructor & Destructor Documentation

◆ MVnormBetaPEX() [1/3]

MVnormBetaPEX::MVnormBetaPEX ( const gsl_matrix *  resp,
gsl_matrix *  pred,
const size_t &  iCl,
vector< double > &  eaFt,
const gsl_matrix *  Sig,
const gsl_rng *  r,
const size_t &  up,
gsl_matrix *  bet,
const size_t &  iRw,
Apex A,
gsl_matrix *  tSigIAt 
)

Random constructor.

Calculates initial values for the regression using the provided responce and covariance matrix. The initial values modify the corresponding row of the value matrix, stored in the encapsulating class.

Parameters
[in]gsl_matrix*response matrix
[in]gsl_matrix*predictor matrix
[in]size_t&column index of the current predictor in the predictor matrix
[in]vector<double>&vectorized partial fitted matrix
[in]gsl_matrix*covariance matrix
[in]gsl_rng*pointer to a PNG
[in]size_t&row index for the prior matrix
[in]gsl_matrix*value matrix
[in]size_t&row index of the value matrix
[in]Apex&object storing the redundant parameter matrix
[in]gsl_matrix*pre-computed auxiliary matrix

◆ MVnormBetaPEX() [2/3]

MVnormBetaPEX::MVnormBetaPEX ( const size_t &  d,
gsl_matrix *  pred,
const size_t &  iCl,
vector< double > &  eaFt,
const size_t &  up,
gsl_matrix *  bet,
const size_t &  iRw,
Apex A,
gsl_matrix *  tSigIAt 
)

Deterministic constructor.

Sets up the proper pointers to parameters of the regression that have already been calculated in the encapsulating class. The corresponding value matrix is not modified.

Parameters
[in]gsl_matrix*response matrix
[in]gsl_matrix*predictor matrix
[in]size_t&column index of the current predictor in the predictor matrix
[in]vector<double>&vectorized partial fitted matrix
[in]size_t&row index for the prior matrix
[in]gsl_matrix*value matrix
[in]size_t&row index of the value matrix
[in]Apex&object storing the redundant parameter matrix
[in]gsl_matrix*pre-computed auxiliary matrix

◆ MVnormBetaPEX() [3/3]

MVnormBetaPEX::MVnormBetaPEX ( const MVnormBetaPEX bet)

Deterministic copy constructor.

Parameters
[in]MVnormBetaPEX&object of type MVnormBetaPEX

Member Function Documentation

◆ operator=()

MVnormBetaPEX & MVnormBetaPEX::operator= ( const MVnormBetaPEX bet)

Assignment operator.

Deterministic assignement operator

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

◆ update() [1/8]

void MVnormBetaPEX::update ( const Grp ,
const Qgrp ,
const SigmaI ,
const double &  ,
const SigmaI ,
const gsl_rng *   
)
virtual

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

Parameters
[in]Grp&data for the likelihood
[in]Qgrp&vector Student- \(t\) covariance scale parameter for the likelihood covariance
[in]SigmaI&inverse-covariance matrix for the likelihood
[in]double&Student- \(t\) scale parameter for the prior covariance
[in]SigmaI&prior inverse-covariance matrix
[in]gsl_rng*pointer to a PNG

Reimplemented from MVnormMuPEX.

◆ update() [2/8]

void MVnormBetaPEX::update ( const Grp ,
const Qgrp ,
const SigmaI ,
const Grp ,
const double &  ,
const SigmaI ,
const gsl_rng *   
)
virtual

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

Parameters
[in]Grp&data for the likelihood
[in]Qgrp&vector Student- \(t\) covariance scale parameter for the likelihood covariance
[in]SigmaI&inverse-covariance matrix for the likelihood
[in]Grp&prior mean
[in]double&Student- \(t\) scale parameter for the prior covariance
[in]SigmaI&prior inverse-covariance matrix
[in]gsl_rng*pointer to a PNG

Reimplemented from MVnormMuPEX.

◆ update() [3/8]

void MVnormBetaPEX::update ( const Grp ,
const Qgrp ,
const SigmaI ,
const Grp ,
const SigmaI ,
const gsl_rng *   
)
virtual

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

Parameters
[in]Grp&data for the likelihood
[in]Qgrp&vector Student- \(t\) covariance scale parameter for the likelihood covariance
[in]SigmaI&inverse-covariance matrix for the likelihood
[in]Grp&prior mean
[in]SigmaI&prior inverse-covariance matrix
[in]gsl_rng*pointer to a PNG

Reimplemented from MVnormMuPEX.

◆ update() [4/8]

void MVnormBetaPEX::update ( const Grp ,
const Qgrp ,
const SigmaI ,
const SigmaI ,
const gsl_rng *   
)
virtual

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

Parameters
[in]Grp&data for the likelihood
[in]Qgrp&vector of Student- \(t\) covariance scale parameters for the likelihood covariance
[in]SigmaI&inverse-covariance matrix for the likelihood
[in]SigmaI&prior inverse-covariance matrix
[in]gsl_rng*pointer to a PNG

Reimplemented from MVnormMuPEX.

◆ update() [5/8]

void MVnormBetaPEX::update ( const Grp ,
const SigmaI ,
const double &  ,
const SigmaI ,
const gsl_rng *   
)
virtual

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

Parameters
[in]Grp&data for the likelihood
[in]SigmaI&inverse-covariance matrix for the likelihood
[in]double&Student- \(t\) scale parameter for the prior covariance
[in]SigmaI&prior inverse-covariance matrix
[in]gsl_rng*pointer to a PNG

Reimplemented from MVnormMuPEX.

◆ update() [6/8]

void MVnormBetaPEX::update ( const Grp ,
const SigmaI ,
const Grp ,
const double &  ,
const SigmaI ,
const gsl_rng *   
)
virtual

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

Parameters
[in]Grp&data for the likelihood
[in]SigmaI&inverse-covariance matrix for the likelihood
[in]Grp&prior mean
[in]double&Student- \(t\) scale parameter for the prior covariance
[in]SigmaI&prior inverse-covariance matrix
[in]gsl_rng*pointer to a PNG

Reimplemented from MVnormMuPEX.

◆ update() [7/8]

void MVnormBetaPEX::update ( const Grp ,
const SigmaI ,
const Grp ,
const SigmaI ,
const gsl_rng *   
)
virtual

Gaussian likelihood, Gaussian prior.

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

Reimplemented from MVnormMuPEX.

◆ update() [8/8]

void MVnormBetaPEX::update ( const Grp ,
const SigmaI ,
const SigmaI ,
const gsl_rng *   
)
virtual

Gaussian likelihood, Gaussian prior.

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

Reimplemented from MVnormMuPEX.

Member Data Documentation

◆ _fitted

gsl_matrix_view MVnormBetaPEX::_fitted
protected

Fitted values.

Points to a matrix of partial fitted values that exclude the current regression ( \( \boldsymbol{X}_{\cdot -i}\boldsymbol{B}_{-i \cdot} \)).

◆ _scale

double MVnormBetaPEX::_scale
protected

Scale parameter.

Typically \( x^{\textsc{t}}x \), but some exceptions exist in special cases.

◆ _X

gsl_vector_view MVnormBetaPEX::_X
protected

Predictor.

Points to a vector of predictor values, typically a column of the predictor matrix that is in the encapsulating Grp class.


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