cisst-saw
Loading...
Searching...
No Matches
nmrLinearRegressionWindowRecursiveSolver< _elementType > Class Template Reference

#include <nmrLinearRegression.h>

Inheritance diagram for nmrLinearRegressionWindowRecursiveSolver< _elementType >:
nmrLinearRegressionWindowSolver< _elementType > nmrLinearRegressionSolver< _elementType >

Public Member Functions

 nmrLinearRegressionWindowRecursiveSolver (size_t length)
 ~nmrLinearRegressionWindowRecursiveSolver ()
bool Sample (const _elementType &x, const _elementType &y)
bool EstimateAsFractions (SummationType &slope_num, SummationType &yint_num, SummationType &denom, SummationType *tse_num=0)
Public Member Functions inherited from nmrLinearRegressionWindowSolver< _elementType >
 nmrLinearRegressionWindowSolver (size_t length)
 ~nmrLinearRegressionWindowSolver ()
virtual size_t WindowLength () const
bool Sample (const _elementType &x, const _elementType &y)
bool Sample (const vctDynamicVector< _elementType > &CMN_UNUSED(x), const vctDynamicVector< _elementType > &CMN_UNUSED(y))
bool Sample (const vctDynamicConstVectorRef< _elementType > &CMN_UNUSED(x), const vctDynamicConstVectorRef< _elementType > &CMN_UNUSED(y))
bool Sample (const std::vector< _elementType > &CMN_UNUSED(x), const std::vector< _elementType > &CMN_UNUSED(y))
virtual bool Recalculate ()
bool EstimateAsFractions (SummationType &slope_num, SummationType &yint_num, SummationType &denom, SummationType *tse_num=0)
Public Member Functions inherited from nmrLinearRegressionSolver< _elementType >
 nmrLinearRegressionSolver (_elementType tol=cmnTypeTraits< _elementType >::DefaultTolerance)
virtual ~nmrLinearRegressionSolver ()
size_t NumPoints () const
_elementType GetTolerance () const
void SetTolerance (_elementType tol)
virtual void Clear ()
virtual bool Sample (const vctFixedSizeVector< _elementType, 2 > &in)
virtual bool Sample (const vctFixedSizeConstVectorRef< _elementType, 2, 1 > &in)
virtual bool Sample (const vctDynamicVector< _elementType > &x, const vctDynamicVector< _elementType > &y)
virtual bool Sample (const vctDynamicConstVectorRef< _elementType > &x, const vctDynamicConstVectorRef< _elementType > &y)
virtual bool Sample (const std::vector< _elementType > &x, const std::vector< _elementType > &y)
virtual bool Estimate (_elementType &slope, _elementType &yint, _elementType *mse=0)

Additional Inherited Members

Public Types inherited from nmrLinearRegressionSolver< _elementType >
typedef _elementType ElementType
typedef cmnTypeTraits< _elementType >::VaArgPromotion SummationType
Protected Types inherited from nmrLinearRegressionWindowSolver< _elementType >
typedef nmrLinearRegressionSolver< _elementType > BaseClass
typedef BaseClass::SummationType SummationType
typedef std::vector< vctFixedSizeVector< _elementType, 2 > > WindowType
typedef std::vector< vctFixedSizeVector< _elementType, 2 > >::iterator WindowTypeIterator
Protected Member Functions inherited from nmrLinearRegressionSolver< _elementType >
virtual bool ComputeSums (const _elementType &x, const _elementType &y)
template<class _vectorOwnerType>
bool SampleVector (const vctDynamicConstVectorBase< _vectorOwnerType, _elementType > &x, const vctDynamicConstVectorBase< _vectorOwnerType, _elementType > &y)
Protected Attributes inherited from nmrLinearRegressionWindowSolver< _elementType >
WindowType window
WindowTypeIterator iter
Protected Attributes inherited from nmrLinearRegressionSolver< _elementType >
size_t numpts
SummationType Sx
SummationType Sy
SummationType Sxx
SummationType Sxy
SummationType Syy
SummationType tolerance

Detailed Description

template<class _elementType>
class nmrLinearRegressionWindowRecursiveSolver< _elementType >

This class provides a recursive moving window linear regression solver using a least-squares solution. The window size is specified in the constructor. This implementation is recursive and therefore extremely efficient, regardless of window size. But, note that for floating point types, there is a chance for accumulation of round-off error with the recursive solver. There are two solutions: (1) use the non-recursive solver, nmrLinearRegressionWindowSolver, or (2) periodically call the Recalculate method, which is inherited from nmrLinearRegressionWindowSolver.

Constructor & Destructor Documentation

◆ nmrLinearRegressionWindowRecursiveSolver()

template<class _elementType>
nmrLinearRegressionWindowRecursiveSolver< _elementType >::nmrLinearRegressionWindowRecursiveSolver ( size_t length)
inline

◆ ~nmrLinearRegressionWindowRecursiveSolver()

template<class _elementType>
nmrLinearRegressionWindowRecursiveSolver< _elementType >::~nmrLinearRegressionWindowRecursiveSolver ( )
inline

Member Function Documentation

◆ EstimateAsFractions()

template<class _elementType>
bool nmrLinearRegressionWindowRecursiveSolver< _elementType >::EstimateAsFractions ( SummationType & slope_num,
SummationType & yint_num,
SummationType & denom,
SummationType * tse_num = 0 )
inline

Call nmrLinearRegression::EstimateAsFractions (bypassing the version in the immediate base class)

◆ Sample()

template<class _elementType>
bool nmrLinearRegressionWindowRecursiveSolver< _elementType >::Sample ( const _elementType & x,
const _elementType & y )
inlinevirtual

Sample new element; overridden from base class

Reimplemented from nmrLinearRegressionSolver< _elementType >.


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