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

SABR smile interpolation between discrete volatility points. More...

#include <qle/models/normalsabrinterpolation.hpp>

+ Inheritance diagram for NormalSABRInterpolation:
+ Collaboration diagram for NormalSABRInterpolation:

Public Member Functions

template<class I1 , class I2 >
 NormalSABRInterpolation (const I1 &xBegin, const I1 &xEnd, const I2 &yBegin, Time t, const Real &forward, Real alpha, Real nu, Real rho, bool alphaIsFixed, bool nuIsFixed, bool rhoIsFixed, bool vegaWeighted=true, const Size atmStrikeIndex=Null< Size >(), const bool implyAlphaFromAtmVol=false, const QuantLib::ext::shared_ptr< EndCriteria > &endCriteria=QuantLib::ext::shared_ptr< EndCriteria >(), const QuantLib::ext::shared_ptr< OptimizationMethod > &optMethod=QuantLib::ext::shared_ptr< OptimizationMethod >(), const Real errorAccept=0.0002, const bool useMaxError=false, const Size maxGuesses=50)
 
Real expiry () const
 
Real forward () const
 
Real alpha () const
 
Real nu () const
 
Real rho () const
 
Real rmsError () const
 
Real maxError () const
 
const std::vector< Real > & interpolationWeights () const
 
EndCriteria::Type endCriteria ()
 

Private Attributes

QuantLib::ext::shared_ptr< QuantLib::detail::XABRCoeffHolder< detail::NormalSABRSpecs > > coeffs_
 

Detailed Description

SABR smile interpolation between discrete volatility points.

Definition at line 109 of file normalsabrinterpolation.hpp.

Constructor & Destructor Documentation

◆ NormalSABRInterpolation()

NormalSABRInterpolation ( const I1 &  xBegin,
const I1 &  xEnd,
const I2 &  yBegin,
Time  t,
const Real &  forward,
Real  alpha,
Real  nu,
Real  rho,
bool  alphaIsFixed,
bool  nuIsFixed,
bool  rhoIsFixed,
bool  vegaWeighted = true,
const Size  atmStrikeIndex = Null<Size>(),
const bool  implyAlphaFromAtmVol = false,
const QuantLib::ext::shared_ptr< EndCriteria > &  endCriteria = QuantLib::ext::shared_ptr<EndCriteria>(),
const QuantLib::ext::shared_ptr< OptimizationMethod > &  optMethod = QuantLib::ext::shared_ptr<OptimizationMethod>(),
const Real  errorAccept = 0.0002,
const bool  useMaxError = false,
const Size  maxGuesses = 50 
)

Definition at line 112 of file normalsabrinterpolation.hpp.

121 {
122
123 QL_REQUIRE(
124 !implyAlphaFromAtmVol || atmStrikeIndex != Null<Real>(),
125 "NormalSABRInterpolation: imply alpha from atm vol implies a) that the atm strike index must be given");
126
127 std::vector<Real> addParams;
128 if (implyAlphaFromAtmVol) {
129 addParams.push_back(*std::next(yBegin, atmStrikeIndex));
130 }
131
132 impl_ = QuantLib::ext::shared_ptr<Interpolation::Impl>(
133 new QuantLib::detail::XABRInterpolationImpl<I1, I2, detail::NormalSABRSpecs>(
134 xBegin, xEnd, yBegin, t, forward, boost::assign::list_of(alpha)(nu)(rho),
135 boost::assign::list_of(alphaIsFixed)(nuIsFixed)(rhoIsFixed), vegaWeighted, endCriteria, optMethod,
136 errorAccept, useMaxError, maxGuesses, addParams));
137 coeffs_ = QuantLib::ext::dynamic_pointer_cast<QuantLib::detail::XABRCoeffHolder<detail::NormalSABRSpecs>>(impl_);
138 }
QuantLib::ext::shared_ptr< QuantLib::detail::XABRCoeffHolder< detail::NormalSABRSpecs > > coeffs_
+ Here is the call graph for this function:

Member Function Documentation

◆ expiry()

Real expiry ( ) const

Definition at line 139 of file normalsabrinterpolation.hpp.

139{ return coeffs_->t_; }

◆ forward()

Real forward ( ) const

Definition at line 140 of file normalsabrinterpolation.hpp.

140{ return coeffs_->forward_; }
+ Here is the caller graph for this function:

◆ alpha()

Real alpha ( ) const

Definition at line 141 of file normalsabrinterpolation.hpp.

141{ return coeffs_->modelInstance_->params()[0]; }
+ Here is the caller graph for this function:

◆ nu()

Real nu ( ) const

Definition at line 142 of file normalsabrinterpolation.hpp.

142{ return coeffs_->modelInstance_->params()[1]; }
+ Here is the caller graph for this function:

◆ rho()

Real rho ( ) const

Definition at line 143 of file normalsabrinterpolation.hpp.

143{ return coeffs_->modelInstance_->params()[2]; }
+ Here is the caller graph for this function:

◆ rmsError()

Real rmsError ( ) const

Definition at line 144 of file normalsabrinterpolation.hpp.

144{ return coeffs_->error_; }

◆ maxError()

Real maxError ( ) const

Definition at line 145 of file normalsabrinterpolation.hpp.

145{ return coeffs_->maxError_; }

◆ interpolationWeights()

const std::vector< Real > & interpolationWeights ( ) const

Definition at line 146 of file normalsabrinterpolation.hpp.

146{ return coeffs_->weights_; }

◆ endCriteria()

EndCriteria::Type endCriteria ( )

Definition at line 147 of file normalsabrinterpolation.hpp.

147{ return coeffs_->XABREndCriteria_; }
+ Here is the caller graph for this function:

Member Data Documentation

◆ coeffs_

QuantLib::ext::shared_ptr<QuantLib::detail::XABRCoeffHolder<detail::NormalSABRSpecs> > coeffs_
private

Definition at line 150 of file normalsabrinterpolation.hpp.