QuantLib: a free/open-source library for quantitative finance
Reference manual - version 1.40
Loading...
Searching...
No Matches
LongstaffSchwartzPathPricer< PathType > Class Template Reference

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

#include <ql/methods/montecarlo/longstaffschwartzpathpricer.hpp>

Inheritance diagram for LongstaffSchwartzPathPricer< PathType >:

Public Types

typedef EarlyExerciseTraits< PathType >::StateType StateType
Public Types inherited from PathPricer< PathType, ValueType >
typedef ValueType result_type

Public Member Functions

 LongstaffSchwartzPathPricer (const TimeGrid &times, ext::shared_ptr< EarlyExercisePathPricer< PathType > >, const ext::shared_ptr< YieldTermStructure > &termStructure)
Real operator() (const PathType &path) const override
virtual void calibrate ()
Real exerciseProbability () const

Protected Member Functions

virtual void post_processing (const Size i, const std::vector< StateType > &state, const std::vector< Real > &price, const std::vector< Real > &exercise)

Protected Attributes

bool calibrationPhase_ = true
const ext::shared_ptr< EarlyExercisePathPricer< PathType > > pathPricer_
QuantLib::IncrementalStatistics exerciseProbability_
std::unique_ptr< Array[]> coeff_
std::unique_ptr< DiscountFactor[]> dF_
std::vector< PathType > paths_
const std::vector< std::function< Real(StateType)> > v_
const Size len_

Detailed Description

template<class PathType>
class QuantLib::LongstaffSchwartzPathPricer< PathType >

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

Member Function Documentation

◆ operator()()

template<class PathType>
Real operator() ( const PathType & path) const
overridevirtual