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

PEX inverse-covariance. More...

#include <MuGen.h>

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

Public Member Functions

 SigmaIpex ()
 Default constructor.
 
 SigmaIpex (const size_t &d, const double &invVar, const double &df)
 Deterministic diagonal matrix constructor. More...
 
 SigmaIpex (const size_t &d, const double &invVar, const double &df, const string &outFlNam)
 Deterministic diagonal matrix constructor with output file name. More...
 
 SigmaIpex (const Grp &dat, const double &prDiag, const double &nu0)
 Location data-based constructor. More...
 
 SigmaIpex (const Grp &dat, const string &outFlNam, const double &prDiag, const double &nu0)
 Location data-based constructor with output file name. More...
 
 ~SigmaIpex ()
 Destructor.
 
void save (const char *how="a")
 Save to a stored file name. More...
 
void save (const string &fileNam, const char *how="a")
 Save to a given file name. More...
 
void update (const Grp &dat, const Qgrp &q)
 Basic Student- \(t\) update. More...
 
void update (const Grp &dat, const Grp &mu, const Qgrp &q)
 Student- \(t\) update with a mean. More...
 
- Public Member Functions inherited from SigmaI
 SigmaI ()
 Default constructor. More...
 
 SigmaI (const size_t &d, const double &invVar)
 Deterministic diagonal matrix constructor. More...
 
 SigmaI (const size_t &d, const double &invVar, const double &df)
 Deterministic diagonal matrix constructor. More...
 
 SigmaI (const size_t &d, const double &invVar, const double &df, const string &outFlNam)
 Deterministic diagonal matrix constructor with output file name. More...
 
 SigmaI (const gsl_matrix *mat)
 Deterministic matrix constructor. More...
 
 SigmaI (const gsl_matrix *S, const size_t &d, const size_t &df, const gsl_matrix *LamPr, const double &nu0)
 Constructor with a matrix prior. More...
 
 SigmaI (const gsl_matrix *S, const size_t &d, const size_t &df, const double &diagPr, const double &nu0)
 Constructor with a diagonal prior. More...
 
 SigmaI (const Grp &dat, const double &prDiag, const double &nu0)
 Location data-based constructor. More...
 
 SigmaI (const Grp &dat, const string &outFlNam, const double &prDiag, const double &nu0)
 Location data-based constructor with output file name. More...
 
 SigmaI (const SigmaI &)
 Copy constructor. More...
 
SigmaIoperator= (const SigmaI &)
 Assignment operator. More...
 
virtual ~SigmaI ()
 Destructor.
 
virtual void update (const Grp &dat)
 Basic Gaussian update. More...
 
virtual void update (const Grp &dat, const Grp &mu)
 Gaussian update with a mean. More...
 
void save (const string &fileNam, const Apex &A, const char *how="a")
 Save adjusted matrix. More...
 
void save (FILE *fileStr)
 Save to file stream. More...
 
string getOutFile () const
 Access the output file. More...
 
const gsl_matrix * getMat () const
 Access to the inverse-covariance matrix. More...
 
void srDetUpdate ()
 Update square-root of the determinant.
 
double getSrDet () const
 Access the square-root of the determinant. More...
 

Protected Attributes

double _alpha
 The PEX \( \alpha \) parameter.
 
- Protected Attributes inherited from SigmaI
gsl_matrix * _mat
 Inverse-covariance matrix. More...
 
size_t _d
 Dimension of the matrix. More...
 
double _srDet
 Square root of the determinant. More...
 
gsl_matrix * _LamSc
 Prior inverse-covariance. More...
 
double _n0
 Prior degrees of freedom.
 
string _outFlNam
 Output file name.
 
gsl_rng * _r
 Pseudo-random number generator. More...
 

Detailed Description

PEX inverse-covariance.

Implementation of the van Dyk and Meng's [dyk01] parameter expansion scheme from multivariate Student- \(t\) sampling. Note that it only works when all the scale values in Qgrp are sampled. So, for example, when we have missing data with a Student- \(t\) model for the rest (see Qgrp documentation for details), this class should not be used, it will cause divergence and crashing.

Note
Not to be confused with location parameter PEX such as MuGrpPEX

Constructor & Destructor Documentation

◆ SigmaIpex() [1/4]

SigmaIpex::SigmaIpex ( const size_t &  d,
const double &  invVar,
const double &  df 
)
inline

Deterministic diagonal matrix constructor.

Creates a diagonal matrix with the provided inverse-variance and degrees of freedom parameter.

Parameters
[in]size_t&number of rows and columns
[in]double&inverse variance
[in]double&degrees of freedom

◆ SigmaIpex() [2/4]

SigmaIpex::SigmaIpex ( const size_t &  d,
const double &  invVar,
const double &  df,
const string &  outFlNam 
)
inline

Deterministic diagonal matrix constructor with output file name.

Creates a diagonal matrix with the provided inverse-variance and degrees of freedom parameter.

Parameters
[in]size_t&number of rows and columns
[in]double&inverse variance
[in]double&degrees of freedom
[in]string&output file name

◆ SigmaIpex() [3/4]

SigmaIpex::SigmaIpex ( const Grp dat,
const double &  prDiag,
const double &  nu0 
)
inline

Location data-based constructor.

Initializes the object with an inverse-covariance of the provided location data. The dimension of the object os equal to the number of columns in the data.

Parameters
[in]Grp&data
[in]double&prior inverse-variance
[in]double&prior degrees of freedom

◆ SigmaIpex() [4/4]

SigmaIpex::SigmaIpex ( const Grp dat,
const string &  outFlNam,
const double &  prDiag,
const double &  nu0 
)
inline

Location data-based constructor with output file name.

Initializes the object with an inverse-covariance of the provided location data. The dimension of the object os equal to the number of columns in the data.

Parameters
[in]Grp&data
[in]string&output file name
[in]double&prior inverse-variance
[in]double&prior degrees of freedom

Member Function Documentation

◆ save() [1/2]

void SigmaIpex::save ( const char *  how = "a")
virtual

Save to a stored file name.

Saves the "adjusted" value, i.e. scaled by the multiplicative parameter.

Parameters
[in]char*saving mode, appending by default

Reimplemented from SigmaI.

◆ save() [2/2]

void SigmaIpex::save ( const string &  fileNam,
const char *  how = "a" 
)
virtual

Save to a given file name.

Saves the "adjusted" value, i.e. scaled by the multiplicative parameter.

Parameters
[in]string&output file name
[in]char*saving mode, appending by default

Reimplemented from SigmaI.

◆ update() [1/2]

void SigmaIpex::update ( const Grp dat,
const Grp mu,
const Qgrp q 
)
virtual

Student- \(t\) update with a mean.

The mean value is subtracted from the data according to the up-pointing RanIndex in the data object.

Parameters
[in]Grp&data
[in]Grp&mean
[in]Qgrp&scale parameter

Reimplemented from SigmaI.

◆ update() [2/2]

void SigmaIpex::update ( const Grp dat,
const Qgrp q 
)
virtual

Basic Student- \(t\) update.

The data are assumed already centered, so the update is based on the simple cross-product of the data and the current value of the scale parameter.

Parameters
[in]Grp&data
[in]Qgrp&scale parameter

Reimplemented from SigmaI.


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