BIE::EnsembleStat Class Reference

Caches an group of posterior states in a vector and provides member functions to characterize the posterior from this distribution and produce statistical diagnostics on the convergence of the simulation. More...

#include <EnsembleStat.h>

Inheritance diagram for BIE::EnsembleStat:
Collaboration diagram for BIE::EnsembleStat:

List of all members.

ComputeDistribution

Computes the covariance matrix and its eigenvalues/vectors

Return = 1 (variance computed), Return = 0 (too few values)

class boost::serialization::access
void ComputeDistribution ()
 Compute distribution estimate as needed.
void ComputeDistribution (int n)
void ComputeDistributionMarginal (ostream &out)
int trim_location (int m)
 Index of non-null space for subspace m.
int trim_location_marginal (int m, int n)
 Index of non-null space for subspace.
EnsembleStatNew ()
 Object factory (clone).
double PDF (State &)
 Differential distribution function P(x).
double logPDF (State &)
 Log of differential distribution function P(x).
double logPDFMarginal (int m, int n, vector< double > &V)
 Log of differential distribution function for a component in subspace.
double PDF (int, State &)
 Differential distribution function for a single component.
vector< double > lower (void)
 Lower bound on distribution (in each dimension).
vector< double > upper (void)
 Upper bound on distribution (in each dimension).
vector< double > Mean (int m)
 Return mean of distribution (mulitvariate).
vector< double > StdDev (int m)
 Return standard deviation of distribution (mulitvariate).
vector< double > Moments (int m, int k)
 Return specifided moment of distribution (mulitvariate).
vector< double > Width (int m)
 Width.
vector< double > Sample (int m)
 Return random variate from distribution for the given subspace m.
double SampleOne (int m, int j)
 Return random variate from fully marginalized distribution.
vector< double > StdDevMarginal (int m, int n)
 Retrieve the std dev for the component marginal.
vector< double > MeanMarginal (int m, int n)
 Retrieve the mean for the component marginal.
vector< double > SampleMarginal (int m, int n)
 Sample the distribution for the component marginal.
vector< double > WidthMarginal (int m, int n)
 Width for component marginal.
void PrintDiag (ostream &out)
 Print current covariance matrix (debug and diag).
void PrintDiag (string &outfile)
 To a given file.

Public Member Functions

 EnsembleStat ()
 Constructor.
 EnsembleStat (int nmix, int ndim)
 Mixture constructor.
 EnsembleStat (int nmix, int ndim, int level, int nburn, string filename, int keypos)
 General constructor.
 EnsembleStat (const EnsembleStat &)
 Copy constructor.
 ~EnsembleStat ()
 Destructor.
void Reset (int nmix, int ndim)
 Reinitialize the EnsembleStat.
void Reset (int nmix, int ndim, int level, int nburn, string filename, int keypos)
 Reinitialize the EnsembleStat.
void setDimensions (int nmix, int ndim)
 Set total size of arrays.

Public Attributes

vector< Matrix > covar
 The covariance matrix for all parameters and weights in the deque.
vector< vector< Matrix > > covarM
 The covariance matrix for all parameters and weights in the deque by component.
vector< Matrix > Teigen
 The transpose of the eigenvector matrix.
vector< vector< Matrix > > TeigeM
 The transpose of the eigenvector matrix for the components.
vector< Matrix > eigen
 The eigenvector matrix.
vector< vector< Matrix > > eigenM
 The eigenvectors for each component in the subspace.
vector< Vector > mean
 The mean for each dimension.
vector< vector< Vector > > meanM
 The mean for each dimension for each component.
vector< Vector > evals
 The eigenvalues.
vector< vector< Vector > > evalsM
 The eigenvalues by component.
vector< Vector > Tmean
 The mean in the eigenspace.
vector< vector< Vector > > TmeanM
 The mean in the component eigenspace.

Static Public Attributes

static int minsub
 Minimum number of states per subspace to retain subspace (default 3).

Protected Attributes

vector< int > icut
 Trimmed dimension for each subspace (that is, remove the null space).
vector< vector< int > > mcut
 Trimmed dimension for each subspace for each component.
vector< int > mcum
 Fraction of states in each subspace per component.
bool var_computed
 True of mean and variance has been computed.
vector< vector< double > > vmean
 Mean for each dimension.
vector< vector< vector< double > > > mmean
vector< vector< double > > vvar
 Variance for each dimension.
vector< vector< vector< double > > > mvar
Normal * normal
 Normal distribution generator.
double factor
 Scaling factor for realizing variates from the multidimensional Gaussian defined by the mean and covariance of the ensemble.


Detailed Description

Caches an group of posterior states in a vector and provides member functions to characterize the posterior from this distribution and produce statistical diagnostics on the convergence of the simulation.

The posterior state is characterized from the ensemble variance by a principal component analysis.


Constructor & Destructor Documentation

BIE::EnsembleStat::EnsembleStat ( int  nmix,
int  ndim 
)

Mixture constructor.

Parameters:
nmix is the mixture number
ndim is the dimension of each mixture copmonent

BIE::EnsembleStat::EnsembleStat ( int  nmix,
int  ndim,
int  level,
int  nburn,
string  filename,
int  keypos 
)

General constructor.

Parameters:
nmix is the mixture number
ndim is the dimension of each mixture copmonent
level is the update level
nburn is the desired number of converged states
filename is the logfile for ensemble statistics
keypos is the parameter index for computing PDF and CDF evaluations


Member Function Documentation

int BIE::EnsembleStat::trim_location_marginal ( int  m,
int  n 
) [inline]

Index of non-null space for subspace.

Parameters:
m for component
n 

double BIE::EnsembleStat::logPDFMarginal ( int  m,
int  n,
vector< double > &  V 
) [virtual]

Log of differential distribution function for a component in subspace.

Parameters:
m,component 
n,and parameter vector
V 

Reimplemented from BIE::Ensemble.

void BIE::EnsembleStat::PrintDiag ( ostream &  out  )  [virtual]

Print current covariance matrix (debug and diag).

To a given ostream

Reimplemented from BIE::Ensemble.


Member Data Documentation

vector<Matrix> BIE::EnsembleStat::covar

The covariance matrix for all parameters and weights in the deque.

This and Teigen and eigen are only defined after EnsembleStat::ComputeDistribution() is called.

vector< vector<Matrix> > BIE::EnsembleStat::covarM

The covariance matrix for all parameters and weights in the deque by component.

This and TeigenM and eigenM are only defined after EnsembleStat::ComputeDistributionMarginal() is called.

vector<Matrix> BIE::EnsembleStat::eigen

The eigenvector matrix.

Eigenvectors are ranked in decreasing order by their eigenvalues. The eigenvectors for the subspace


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

Send suggestions, questions, and feedback to WEINBERG at ASTRO dot UMASS dot EDU.
Documentation generated at Fri Mar 26 00:35:12 2010 by doxygen