autoppl  v0.8
A C++ template library for probabilistic programming
ppl::math::WelfordVar Struct Reference

#include <welford.hpp>

Public Member Functions

 WelfordVar (size_t n_params)
 
template<class MatType >
void update (const MatType &x)
 
const auto & get_variance () const
 
size_t get_n_samples () const
 
void reset ()
 

Detailed Description

Estimates sample variance for n-dimensional data using Welford's online algorithm

Constructor & Destructor Documentation

◆ WelfordVar()

ppl::math::WelfordVar::WelfordVar ( size_t  n_params)
inline

Member Function Documentation

◆ get_n_samples()

size_t ppl::math::WelfordVar::get_n_samples ( ) const
inline

◆ get_variance()

const auto& ppl::math::WelfordVar::get_variance ( ) const
inline

◆ reset()

void ppl::math::WelfordVar::reset ( )
inline

Resets sample mean, sample variance, and number of samples to 0 Equivalent to constructing a new object of this type.

◆ update()

template<class MatType >
void ppl::math::WelfordVar::update ( const MatType &  x)
inline

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