vSMC  v3.0.0
Scalable Monte Carlo
Public Types | Public Member Functions | List of all members
vsmc::Covariance< RealType > Class Template Reference

Covariance. More...

#include <vsmc/utility/covariance.hpp>

Public Types

using result_type = RealType
 

Public Member Functions

void operator() (MatrixLayout layout, std::size_t n, std::size_t p, const result_type *x, const result_type *w, result_type *mean, result_type *cov, MatrixLayout cov_layout=RowMajor, bool cov_upper=false, bool cov_packed=false)
 Compute the sample covariance matrix. More...
 

Detailed Description

template<typename RealType = double>
class vsmc::Covariance< RealType >

Covariance.

Definition at line 43 of file covariance.hpp.

Member Typedef Documentation

template<typename RealType = double>
using vsmc::Covariance< RealType >::result_type = RealType

Definition at line 49 of file covariance.hpp.

Member Function Documentation

template<typename RealType = double>
void vsmc::Covariance< RealType >::operator() ( MatrixLayout  layout,
std::size_t  n,
std::size_t  p,
const result_type x,
const result_type w,
result_type mean,
result_type cov,
MatrixLayout  cov_layout = RowMajor,
bool  cov_upper = false,
bool  cov_packed = false 
)
inline

Compute the sample covariance matrix.

Parameters
layoutThe storage layout of sample x. It is assumed to be an n by p matrix.
nSample size. If n == 0 then no computation is carried out.
pDimension of the random variable. If p == 0 then no computation carried out.
xThe sample matrix. If it is a null pointer, then no computation is carried out.
wThe weight vector. If it is a null pointer, then all samples are assigned weight 1.
meanOutput storage of the mean. If it is a null pointer, then it is ignored.
covOutput storage of the covarianc matrix. If it is a null pointer, then it is ignored.
cov_layoutThe storage layout of the covariance matrix.
cov_upperIf true, then the upper triangular of the covariance matrix is packed, otherwise the lower triangular is packed. Ignored if cov_pack is false.
cov_packedIf true, then the covariance matrix is packed.

Definition at line 71 of file covariance.hpp.