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

Student- \(t\) weights for PEX. More...

#include <MuGen.h>

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

Public Member Functions

 QgrpPEX ()
 Default constructor.
 
 QgrpPEX (const size_t &N)
 Deterministic size-only constructor. More...
 
 QgrpPEX (const size_t &N, const double &nu)
 Deterministic constructor with degrees of freedom. More...
 
 QgrpPEX (const size_t &N, const double &nu, const string &misVecFlNam)
 Deterministic constructor with degrees of freedom and missing values. More...
 
 QgrpPEX (const size_t &N, const string &outFileNam)
 Deterministic size-only constructor with output file name. More...
 
 QgrpPEX (const size_t &N, const string &outFileNam, const double &nu)
 Deterministic constructor with degrees of freedom and output file name. More...
 
 QgrpPEX (const size_t &N, const string &outFileNam, const double &nu, const string &misVecFlNam)
 Deterministic constructor with degrees of freedom, missing values and output file name. More...
 
double alpha () const
 Const access to \(\alpha\). More...
 
double alpha ()
 Access to \(\alpha\). More...
 
void update (const Grp &dat, const Grp &mu, const SigmaI &SigI)
 Update with a mean. More...
 
void update (const Grp &dat, const SigmaI &SigI)
 Basic update. More...
 
- Public Member Functions inherited from Qgrp
 Qgrp ()
 Default constructor. More...
 
 Qgrp (const size_t &N)
 Deterministic size-only constructor. More...
 
 Qgrp (const size_t &N, const double &nu)
 Deterministic constructor with degrees of freedom. More...
 
 Qgrp (const size_t &N, const double &nu, const string &misVecFlNam)
 Deterministic constructor with degrees of freedom and missing values. More...
 
 Qgrp (const size_t &N, const string &outFileNam)
 Deterministic size-only constructor with output file name. More...
 
 Qgrp (const size_t &N, const string &outFileNam, const double &nu)
 Deterministic constructor with degrees of freedom and output file name. More...
 
 Qgrp (const size_t &N, const string &outFileNam, const double &nu, const string &misVecFlNam)
 Deterministic constructor with degrees of freedom, missing values and output file name. More...
 
virtual ~Qgrp ()
 Destructor.
 
double operator[] (const size_t i) const
 Const subscript operator. More...
 
double operator[] (const size_t i)
 Subscript operator. More...
 
size_t size () const
 Const length of the weight vector. More...
 
size_t size ()
 Length of the weight vector. More...
 
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...
 

Protected Attributes

double _alpha
 Redundant parameter \(\alpha\).
 
- Protected Attributes inherited from Qgrp
vector< double > _qVec
 Vector of weights.
 
vector< size_t > _presInd
 Vector of indexes of present data. More...
 
double _nu
 Student- \(t\) degrees of freedom.
 
string _outFile
 Output file name.
 
gsl_rng * _r
 Pseudo-random number generator. More...
 

Detailed Description

Student- \(t\) weights for PEX.

Implements the weight updating for van Dyk and Meng's [dyk01] PEX scheme. The multiplicative redundant parameter \(\alpha\) is a member of this class and is updated internally. \(\alpha\) is initialized deterministically to 1.0.

Constructor & Destructor Documentation

◆ QgrpPEX() [1/6]

QgrpPEX::QgrpPEX ( const size_t &  N)
inline

Deterministic size-only constructor.

Creates a vector of weights that all equal to 1.0, and three degrees of freedom (the smallest possible that still gives a destribution with defined mean and variance).

Parameters
[in]size_t&number of weights

◆ QgrpPEX() [2/6]

QgrpPEX::QgrpPEX ( const size_t &  N,
const double &  nu 
)
inline

Deterministic constructor with degrees of freedom.

Creates a vector of weights that all equal to 1.0, and degrees of freedom set to the given value.

Parameters
[in]size_t&number of weights
[in]double&degrees of freedom

◆ QgrpPEX() [3/6]

QgrpPEX::QgrpPEX ( const size_t &  N,
const double &  nu,
const string &  misVecFlNam 
)
inline

Deterministic constructor with degrees of freedom and missing values.

Creates a vector of weights that all equal to 1.0, and degrees of freedom set to the given value. The given file is read to determine which rows of data have missing values.

Parameters
[in]size_t&number of weights
[in]double&degrees of freedom
[in]string&missing value file name

◆ QgrpPEX() [4/6]

QgrpPEX::QgrpPEX ( const size_t &  N,
const string &  outFileNam 
)
inline

Deterministic size-only constructor with output file name.

Creates a vector of weights that all equal to 1.0, and three degrees of freedom (the smallest possible that still gives a destribution with defined mean and variance).

Parameters
[in]size_t&number of weights
[in]string&output file name

◆ QgrpPEX() [5/6]

QgrpPEX::QgrpPEX ( const size_t &  N,
const string &  outFileNam,
const double &  nu 
)
inline

Deterministic constructor with degrees of freedom and output file name.

Creates a vector of weights that all equal to 1.0, and degrees of freedom set to the given value.

Parameters
[in]size_t&number of weights
[in]string&output file name
[in]double&degrees of freedom

◆ QgrpPEX() [6/6]

QgrpPEX::QgrpPEX ( const size_t &  N,
const string &  outFileNam,
const double &  nu,
const string &  misVecFlNam 
)
inline

Deterministic constructor with degrees of freedom, missing values and output file name.

Creates a vector of weights that all equal to 1.0, and degrees of freedom set to the given value. The given file is read to determine which rows of data have missing values.

Parameters
[in]size_t&number of weights
[in]string&output file name
[in]double&degrees of freedom
[in]string&missing value file name

Member Function Documentation

◆ alpha() [1/2]

double QgrpPEX::alpha ( )
inlinevirtual

Access to \(\alpha\).

Access to the van Dyk and Meng \(\alpha\) multiplicative redundant parameter. Is equal to 1.0 in this class.

Returns
double \(\alpha\)

Reimplemented from Qgrp.

◆ alpha() [2/2]

double QgrpPEX::alpha ( ) const
inlinevirtual

Const access to \(\alpha\).

Access to the van Dyk and Meng \(\alpha\) multiplicative redundant parameter. Is equal to 1.0 in this class.

Returns
double \(\alpha\)

Reimplemented from Qgrp.

◆ update() [1/2]

void QgrpPEX::update ( const Grp dat,
const Grp mu,
const SigmaI SigI 
)
virtual

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]SigmaI&inverse-covariance

Reimplemented from Qgrp.

◆ update() [2/2]

void QgrpPEX::update ( const Grp dat,
const SigmaI SigI 
)
virtual

Basic 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 inverse-covariance.

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

Reimplemented from Qgrp.


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