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

#include <qle/models/fxbsmodel.hpp>

+ Inheritance diagram for FxBsModel:
+ Collaboration diagram for FxBsModel:

Public Member Functions

 FxBsModel (const QuantLib::ext::shared_ptr< FxBsParametrization > &parametrization)
 
const QuantLib::ext::shared_ptr< ParametrizationparametrizationBase () const override
 
Handle< Quote > fxSpotToday () const override
 
Size n () const override
 
Size m () const override
 
Array eulerStep (const Time t0, const Array &x0, const Time dt, const Array &dw, const Real r_dom, const Real r_for) const override
 
virtual const QuantLib::ext::shared_ptr< ParametrizationparametrizationBase () const =0
 
virtual Handle< Quote > fxSpotToday () const =0
 
virtual Size n () const =0
 
virtual Size m () const =0
 
virtual Array eulerStep (const Time t0, const Array &x0, const Time dt, const Array &dw, const Real r_dom, const Real r_for) const =0
 
- Public Member Functions inherited from LinkableCalibratedModel
 LinkableCalibratedModel ()
 
void update () override
 
virtual void calibrate (const std::vector< QuantLib::ext::shared_ptr< CalibrationHelper > > &, OptimizationMethod &method, const EndCriteria &endCriteria, const Constraint &constraint=Constraint(), const std::vector< Real > &weights=std::vector< Real >(), const std::vector< bool > &fixParameters=std::vector< bool >())
 Calibrate to a set of market instruments (usually caps/swaptions) More...
 
virtual void calibrate (const std::vector< QuantLib::ext::shared_ptr< BlackCalibrationHelper > > &, OptimizationMethod &method, const EndCriteria &endCriteria, const Constraint &constraint=Constraint(), const std::vector< Real > &weights=std::vector< Real >(), const std::vector< bool > &fixParameters=std::vector< bool >())
 for backward compatibility More...
 
Real value (const Array &params, const std::vector< QuantLib::ext::shared_ptr< CalibrationHelper > > &)
 
Real value (const Array &params, const std::vector< QuantLib::ext::shared_ptr< BlackCalibrationHelper > > &)
 for backward compatibility More...
 
const QuantLib::ext::shared_ptr< Constraint > & constraint () const
 
EndCriteria::Type endCriteria () const
 Returns end criteria result. More...
 
const Array & problemValues () const
 Returns the problem values. More...
 
Array params () const
 Returns array of arguments on which calibration is done. More...
 
virtual void setParams (const Array &params)
 
virtual void setParam (Size idx, const Real value)
 

Private Attributes

QuantLib::ext::shared_ptr< FxBsParametrizationparametrization_
 

Additional Inherited Members

- Protected Member Functions inherited from LinkableCalibratedModel
virtual void generateArguments ()
 
- Protected Attributes inherited from LinkableCalibratedModel
std::vector< QuantLib::ext::shared_ptr< Parameter > > arguments_
 
QuantLib::ext::shared_ptr< Constraintconstraint_
 
EndCriteria::Type endCriteria_
 
Array problemValues_
 

Detailed Description

Definition at line 33 of file fxbsmodel.hpp.

Constructor & Destructor Documentation

◆ FxBsModel()

FxBsModel ( const QuantLib::ext::shared_ptr< FxBsParametrization > &  parametrization)
explicit

Definition at line 50 of file fxbsmodel.hpp.

51 : parametrization_(parametrization) {
52 QL_REQUIRE(parametrization != nullptr, "FxBsModel: parametrization is null");
53}
QuantLib::ext::shared_ptr< FxBsParametrization > parametrization_
Definition: fxbsmodel.hpp:47

Member Function Documentation

◆ parametrizationBase()

const QuantLib::ext::shared_ptr< Parametrization > parametrizationBase ( ) const
overridevirtual

parametrization (as base class)

Implements FxModel.

Definition at line 37 of file fxbsmodel.hpp.

37{ return parametrization_; }

◆ fxSpotToday()

Handle< Quote > fxSpotToday ( ) const
overridevirtual

today's fx rate on which the model is based

Implements FxModel.

Definition at line 39 of file fxbsmodel.hpp.

39{ return parametrization_->fxSpotToday(); }

◆ n()

Size n ( ) const
overridevirtual

dimension of model state, excluding auxilliary states

Implements FxModel.

Definition at line 40 of file fxbsmodel.hpp.

40{ return 1; }

◆ m()

Size m ( ) const
overridevirtual

number of Brownians to evolve the state

Implements FxModel.

Definition at line 41 of file fxbsmodel.hpp.

41{ return 1; }

◆ eulerStep()

Array eulerStep ( const Time  t0,
const Array &  x0,
const Time  dt,
const Array &  dw,
const Real  r_dom,
const Real  r_for 
) const
overridevirtual

perform an Euler step given short rates for the rates

Implements FxModel.

Definition at line 55 of file fxbsmodel.hpp.

56 {
57 Real sigma = parametrization_->sigma(t0);
58 return x0 + (r_dom - r_for - 0.5 * sigma * sigma) * dt + sigma * std::sqrt(dt) * dw[0];
59}

Member Data Documentation

◆ parametrization_

QuantLib::ext::shared_ptr<FxBsParametrization> parametrization_
private

Definition at line 47 of file fxbsmodel.hpp.