QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
AlphaFinder Class Reference

#include <ql/models/marketmodels/models/alphafinder.hpp>

+ Collaboration diagram for AlphaFinder:

Public Member Functions

 AlphaFinder (ext::shared_ptr< AlphaForm > parametricform)
 
bool solve (Real alpha0, Integer stepindex, const std::vector< Volatility > &rateonevols, const std::vector< Volatility > &ratetwohomogeneousvols, const std::vector< Real > &correlations, Real w0, Real w1, Real targetVariance, Real tolerance, Real alphaMax, Real alphaMin, Integer steps, Real &alpha, Real &a, Real &b, std::vector< Volatility > &ratetwovols)
 
bool solveWithMaxHomogeneity (Real alpha0, Integer stepindex, const std::vector< Volatility > &rateonevols, const std::vector< Volatility > &ratetwohomogeneousvols, const std::vector< Real > &correlations, Real w0, Real w1, Real targetVariance, Real tolerance, Real alphaMax, Real alphaMin, Integer steps, Real &alpha, Real &a, Real &b, std::vector< Volatility > &ratetwovols)
 

Private Member Functions

Real computeLinearPart (Real alpha)
 
Real computeQuadraticPart (Real alpha)
 
Real valueAtTurningPoint (Real alpha)
 
Real minusValueAtTurningPoint (Real alpha)
 
bool testIfSolutionExists (Real alpha)
 
bool finalPart (Real alphaFound, Integer stepindex, const std::vector< Volatility > &ratetwohomogeneousvols, Real quadraticPart, Real linearPart, Real constantPart, Real &alpha, Real &a, Real &b, std::vector< Volatility > &ratetwovols)
 
Real homogeneityfailure (Real alpha)
 

Private Attributes

ext::shared_ptr< AlphaFormparametricform_
 
Integer stepindex_
 
std::vector< Volatilityrateonevols_
 
std::vector< Volatilityratetwohomogeneousvols_
 
std::vector< Volatilityputativevols_
 
std::vector< Realcorrelations_
 
Real w0_
 
Real w1_
 
Real constantPart_
 
Real linearPart_
 
Real quadraticPart_
 
Real totalVar_
 
Real targetVariance_
 

Detailed Description

Definition at line 29 of file alphafinder.hpp.

Constructor & Destructor Documentation

◆ AlphaFinder()

AlphaFinder ( ext::shared_ptr< AlphaForm parametricform)

Definition at line 179 of file alphafinder.cpp.

Member Function Documentation

◆ solve()

bool solve ( Real  alpha0,
Integer  stepindex,
const std::vector< Volatility > &  rateonevols,
const std::vector< Volatility > &  ratetwohomogeneousvols,
const std::vector< Real > &  correlations,
Real  w0,
Real  w1,
Real  targetVariance,
Real  tolerance,
Real  alphaMax,
Real  alphaMin,
Integer  steps,
Real alpha,
Real a,
Real b,
std::vector< Volatility > &  ratetwovols 
)

Definition at line 297 of file alphafinder.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ solveWithMaxHomogeneity()

bool solveWithMaxHomogeneity ( Real  alpha0,
Integer  stepindex,
const std::vector< Volatility > &  rateonevols,
const std::vector< Volatility > &  ratetwohomogeneousvols,
const std::vector< Real > &  correlations,
Real  w0,
Real  w1,
Real  targetVariance,
Real  tolerance,
Real  alphaMax,
Real  alphaMin,
Integer  steps,
Real alpha,
Real a,
Real b,
std::vector< Volatility > &  ratetwovols 
)

Definition at line 418 of file alphafinder.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ computeLinearPart()

Real computeLinearPart ( Real  alpha)
private

Definition at line 183 of file alphafinder.cpp.

+ Here is the caller graph for this function:

◆ computeQuadraticPart()

Real computeQuadraticPart ( Real  alpha)
private

Definition at line 197 of file alphafinder.cpp.

+ Here is the caller graph for this function:

◆ valueAtTurningPoint()

Real valueAtTurningPoint ( Real  alpha)
private

Definition at line 265 of file alphafinder.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ minusValueAtTurningPoint()

Real minusValueAtTurningPoint ( Real  alpha)
private

Definition at line 275 of file alphafinder.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ testIfSolutionExists()

bool testIfSolutionExists ( Real  alpha)
private

Definition at line 279 of file alphafinder.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ finalPart()

bool finalPart ( Real  alphaFound,
Integer  stepindex,
const std::vector< Volatility > &  ratetwohomogeneousvols,
Real  quadraticPart,
Real  linearPart,
Real  constantPart,
Real alpha,
Real a,
Real b,
std::vector< Volatility > &  ratetwovols 
)
private

Definition at line 232 of file alphafinder.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ homogeneityfailure()

Real homogeneityfailure ( Real  alpha)
private

Definition at line 210 of file alphafinder.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ parametricform_

ext::shared_ptr<AlphaForm> parametricform_
private

Definition at line 84 of file alphafinder.hpp.

◆ stepindex_

Integer stepindex_
private

Definition at line 85 of file alphafinder.hpp.

◆ rateonevols_

std::vector<Volatility> rateonevols_
private

Definition at line 86 of file alphafinder.hpp.

◆ ratetwohomogeneousvols_

std::vector<Volatility> ratetwohomogeneousvols_
private

Definition at line 86 of file alphafinder.hpp.

◆ putativevols_

std::vector<Volatility> putativevols_
private

Definition at line 87 of file alphafinder.hpp.

◆ correlations_

std::vector<Real> correlations_
private

Definition at line 88 of file alphafinder.hpp.

◆ w0_

Real w0_
private

Definition at line 89 of file alphafinder.hpp.

◆ w1_

Real w1_
private

Definition at line 89 of file alphafinder.hpp.

◆ constantPart_

Real constantPart_
private

Definition at line 90 of file alphafinder.hpp.

◆ linearPart_

Real linearPart_
private

Definition at line 90 of file alphafinder.hpp.

◆ quadraticPart_

Real quadraticPart_
private

Definition at line 90 of file alphafinder.hpp.

◆ totalVar_

Real totalVar_
private

Definition at line 91 of file alphafinder.hpp.

◆ targetVariance_

Real targetVariance_
private

Definition at line 91 of file alphafinder.hpp.