Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
NadarayaWatson Class Reference

Nadaraya Watson regression. More...

#include <qle/math/nadarayawatson.hpp>

+ Collaboration diagram for NadarayaWatson:

Public Member Functions

template<class I1 , class I2 , class Kernel >
 NadarayaWatson (const I1 &xBegin, const I1 &xEnd, const I2 &yBegin, const Kernel &kernel)
 
Real operator() (Real x) const
 
Real standardDeviation (Real x) const
 

Private Attributes

QuantLib::ext::shared_ptr< detail::RegressionImplimpl_
 

Detailed Description

Nadaraya Watson regression.

This implements the estimator

\[ m(x) = \frac{\sum_i y_i K(x-x_i)}{\sum_i K(x-x_i)} \]

Definition at line 103 of file nadarayawatson.hpp.

Constructor & Destructor Documentation

◆ NadarayaWatson()

NadarayaWatson ( const I1 &  xBegin,
const I1 &  xEnd,
const I2 &  yBegin,
const Kernel &  kernel 
)
Precondition
the \( x \) values must be sorted.
kernel needs a Real operator()(Real x) implementation

Definition at line 109 of file nadarayawatson.hpp.

109 {
110 impl_ = QuantLib::ext::make_shared<detail::NadarayaWatsonImpl<I1, I2, Kernel> >(xBegin, xEnd, yBegin, kernel);
111 }
QuantLib::ext::shared_ptr< detail::RegressionImpl > impl_

Member Function Documentation

◆ operator()()

Real operator() ( Real  x) const

Definition at line 113 of file nadarayawatson.hpp.

113{ return impl_->value(x); }

◆ standardDeviation()

Real standardDeviation ( Real  x) const

Definition at line 115 of file nadarayawatson.hpp.

115{ return impl_->standardDeviation(x); }

Member Data Documentation

◆ impl_

QuantLib::ext::shared_ptr<detail::RegressionImpl> impl_
private

Definition at line 118 of file nadarayawatson.hpp.