MuGen
Multitrait genetics
|
Standard Student- \(t\) weights. More...
#include <MuGen.h>
Public Member Functions | |
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... | |
virtual double | alpha () const |
Const access to \(\alpha\). More... | |
virtual double | alpha () |
Access to \(\alpha\). 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... | |
virtual void | update (const Grp &dat, const Grp &mu, const SigmaI &SigI) |
Update with a mean. More... | |
virtual void | update (const Grp &dat, const SigmaI &SigI) |
Basic update. More... | |
Protected Attributes | |
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... | |
Standard Student- \(t\) weights.
Mostly a standard implementation of the weight parameter sampling for Student- \(t\) modeling. The only deviation of the standard approach concerns the situation where some values in the data are missing. If we impute values for these elements, the weights become confounded with means. So the weights are kept strictly equal to 1.0 and not updated.
|
inline |
Default constructor.
Results in an empty vector of weights.
Qgrp::Qgrp | ( | const size_t & | N | ) |
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).
[in] | size_t& | number of weights |
Qgrp::Qgrp | ( | const size_t & | N, |
const double & | nu | ||
) |
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.
[in] | size_t& | number of weights |
[in] | double& | degrees of freedom |
Qgrp::Qgrp | ( | const size_t & | N, |
const double & | nu, | ||
const string & | misVecFlNam | ||
) |
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.
[in] | size_t& | number of weights |
[in] | double& | degrees of freedom |
[in] | string& | missing value file name |
Qgrp::Qgrp | ( | const size_t & | N, |
const string & | outFileNam | ||
) |
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).
[in] | size_t& | number of weights |
[in] | string& | output file name |
Qgrp::Qgrp | ( | const size_t & | N, |
const string & | outFileNam, | ||
const double & | nu | ||
) |
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.
[in] | size_t& | number of weights |
[in] | string& | output file name |
[in] | double& | degrees of freedom |
Qgrp::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.
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.
[in] | size_t& | number of weights |
[in] | string& | output file name |
[in] | double& | degrees of freedom |
[in] | string& | missing value file name |
|
inlinevirtual |
Access to \(\alpha\).
Access to the van Dyk and Meng \(\alpha\) multiplicative redundant parameter. Is equal to 1.0 in this class.
Reimplemented in QgrpPEX.
|
inlinevirtual |
Const access to \(\alpha\).
Access to the van Dyk and Meng \(\alpha\) multiplicative redundant parameter. Is equal to 1.0 in this class.
Reimplemented in QgrpPEX.
|
inline |
Subscript operator.
[in] | size_t& | index |
|
inline |
Const subscript operator.
[in] | size_t& | index |
void Qgrp::save | ( | const char * | how = "a" | ) |
Save to a stored file name.
[in] | char* | saving mode, appending by default |
void Qgrp::save | ( | const string & | fileNam, |
const char * | how = "a" |
||
) |
Save to a given file name.
[in] | string& | output file name |
[in] | char* | saving mode, appending by default |
|
inline |
Length of the weight vector.
|
inline |
Const length of the weight vector.
|
protected |
Vector of indexes of present data.
Only _qVec elements corresponding to rows of data with no missing values are updated.
|
protected |
Pseudo-random number generator.
Initialized the same way as Grp type PNGs, with a sum of time and RTDSC.