QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
LongstaffSchwartzMultiPathPricer Class Reference

Longstaff-Schwarz path pricer for early exercise options. More...

#include <longstaffschwartzmultipathpricer.hpp>

+ Inheritance diagram for LongstaffSchwartzMultiPathPricer:
+ Collaboration diagram for LongstaffSchwartzMultiPathPricer:

Classes

struct  PathInfo
 

Public Member Functions

 LongstaffSchwartzMultiPathPricer (const ext::shared_ptr< PathPayoff > &payoff, const std::vector< Size > &timePositions, std::vector< Handle< YieldTermStructure > > forwardTermStructure, Array discounts, Size polynomialOrder, LsmBasisSystem::PolynomialType polynomialType)
 
Real operator() (const MultiPath &multiPath) const override
 
virtual void calibrate ()
 
- Public Member Functions inherited from PathPricer< MultiPath >
virtual ~PathPricer ()=default
 
virtual Real operator() (const MultiPath &path) const=0
 

Protected Member Functions

PathInfo transformPath (const MultiPath &path) const
 

Protected Attributes

bool calibrationPhase_ = true
 
const ext::shared_ptr< PathPayoffpayoff_
 
std::unique_ptr< Array[]> coeff_
 
std::unique_ptr< Real[]> lowerBounds_
 
const std::vector< SizetimePositions_
 
const std::vector< Handle< YieldTermStructure > > forwardTermStructures_
 
const Array dF_
 
std::vector< PathInfopaths_
 
const std::vector< ext::function< Real(Array)> > v_
 

Additional Inherited Members

- Public Types inherited from PathPricer< MultiPath >
typedef Real result_type
 

Detailed Description

Longstaff-Schwarz path pricer for early exercise options.

References:

Francis Longstaff, Eduardo Schwartz, 2001. Valuing American Options by Simulation: A Simple Least-Squares Approach, The Review of Financial Studies, Volume 14, No. 1, 113-147

Tests:
the correctness of the returned value is tested by reproducing results available in web/literature

Definition at line 45 of file longstaffschwartzmultipathpricer.hpp.

Constructor & Destructor Documentation

◆ LongstaffSchwartzMultiPathPricer()

LongstaffSchwartzMultiPathPricer ( const ext::shared_ptr< PathPayoff > &  payoff,
const std::vector< Size > &  timePositions,
std::vector< Handle< YieldTermStructure > >  forwardTermStructure,
Array  discounts,
Size  polynomialOrder,
LsmBasisSystem::PolynomialType  polynomialType 
)

Definition at line 38 of file longstaffschwartzmultipathpricer.cpp.

Member Function Documentation

◆ operator()()

Real operator() ( const MultiPath multiPath) const
overridevirtual

Implements PathPricer< MultiPath >.

Definition at line 82 of file longstaffschwartzmultipathpricer.cpp.

+ Here is the call graph for this function:

◆ calibrate()

void calibrate ( )
virtual

Definition at line 155 of file longstaffschwartzmultipathpricer.cpp.

+ Here is the call graph for this function:

◆ transformPath()

LongstaffSchwartzMultiPathPricer::PathInfo transformPath ( const MultiPath path) const
protected

Definition at line 62 of file longstaffschwartzmultipathpricer.cpp.

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

Member Data Documentation

◆ calibrationPhase_

bool calibrationPhase_ = true
protected

Definition at line 70 of file longstaffschwartzmultipathpricer.hpp.

◆ payoff_

const ext::shared_ptr<PathPayoff> payoff_
protected

Definition at line 72 of file longstaffschwartzmultipathpricer.hpp.

◆ coeff_

std::unique_ptr<Array[]> coeff_
protected

Definition at line 74 of file longstaffschwartzmultipathpricer.hpp.

◆ lowerBounds_

std::unique_ptr<Real[]> lowerBounds_
protected

Definition at line 75 of file longstaffschwartzmultipathpricer.hpp.

◆ timePositions_

const std::vector<Size> timePositions_
protected

Definition at line 77 of file longstaffschwartzmultipathpricer.hpp.

◆ forwardTermStructures_

const std::vector<Handle<YieldTermStructure> > forwardTermStructures_
protected

Definition at line 78 of file longstaffschwartzmultipathpricer.hpp.

◆ dF_

const Array dF_
protected

Definition at line 79 of file longstaffschwartzmultipathpricer.hpp.

◆ paths_

std::vector<PathInfo> paths_
mutableprotected

Definition at line 81 of file longstaffschwartzmultipathpricer.hpp.

◆ v_

const std::vector<ext::function<Real(Array)> > v_
protected

Definition at line 82 of file longstaffschwartzmultipathpricer.hpp.