/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* Copyright (C) 2005, 2006 Klaus Spanderen This file is part of QuantLib, a free-software/open-source library for financial quantitative analysts and developers - http://quantlib.org/ QuantLib is free software: you can redistribute it and/or modify it under the terms of the QuantLib license. You should have received a copy of the license along with this program; if not, please email . The license is also available online at . This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the license for more details. */ /*! \file lfmprocess.hpp \brief stochastic process of a libor forward model */ #ifndef quantlib_libor_forward_model_process_hpp #define quantlib_libor_forward_model_process_hpp #include #include #include #include #include namespace QuantLib { //! libor-forward-model process /*! stochastic process of a libor forward model using the rolling forward measure incl. predictor-corrector step References: Glasserman, Paul, 2004, Monte Carlo Methods in Financial Engineering, Springer, Section 3.7 Antoon Pelsser, 2000, Efficient Methods for Valuing Interest Rate Derivatives, Springer, 8 Hull, John, White, Alan, 1999, Forward Rate Volatilities, Swap Rate Volatilities and the Implementation of the Libor Market Model () \test the correctness is tested by Monte-Carlo reproduction of caplet & ratchet NPVs and comparison with Black pricing. \warning this class does not work correctly with Visual C++ 6. \ingroup processes */ class LiborForwardModelProcess : public StochasticProcess { public: LiborForwardModelProcess(Size size, const boost::shared_ptr& index); Disposable initialValues() const; Disposable drift(Time t, const Array& x) const; Disposable diffusion(Time t, const Array& x) const; Disposable covariance(Time t0, const Array& x0, Time dt) const; Disposable apply(const Array& x0, const Array& dx) const; // implements the predictor-corrector schema Disposable evolve(Time t0, const Array& x0, Time dt, const Array& dw) const; Size size() const; Size factors() const; boost::shared_ptr index() const; Leg cashFlows( Real amount = 1.0) const; void setCovarParam( const boost::shared_ptr& param); boost::shared_ptr covarParam() const; // convenience support methods Size nextIndexReset(Time t) const; const std::vector