QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
montecarlocatbondengine.hpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2012, 2013 Grzegorz Andruszkiewicz
5
6 This file is part of QuantLib, a free-software/open-source library
7 for financial quantitative analysts and developers - http://quantlib.org/
8
9 QuantLib is free software: you can redistribute it and/or modify it
10 under the terms of the QuantLib license. You should have received a
11 copy of the license along with this program; if not, please email
12 <quantlib-dev@lists.sf.net>. The license is also available online at
13 <http://quantlib.org/license.shtml>.
14
15 This program is distributed in the hope that it will be useful, but WITHOUT
16 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17 FOR A PARTICULAR PURPOSE. See the license for more details.
18*/
19
24#ifndef quantlib_montecarlo_catbond_engine_hpp
25#define quantlib_montecarlo_catbond_engine_hpp
26
27#include <ql/optional.hpp>
28#include <ql/experimental/catbonds/catbond.hpp>
29
30namespace QuantLib {
31
33 public CatBond::engine
34 {
35 public:
37 ext::shared_ptr<CatRisk> catRisk,
39 const ext::optional<bool>& includeSettlementDateFlows = ext::nullopt);
40 void calculate() const override;
42 protected:
43 Real cashFlowRiskyValue(const ext::shared_ptr<CashFlow>& cf,
44 const NotionalPath& notionalPath) const;
45
46 Real npv(bool includeSettlementDateFlows,
47 Date settlementDate,
48 Date npvDate,
49 Real& lossProbability,
50 Real& exhaustionProbability,
51 Real& expectedLoss) const;
52
53 Real pathNpv(bool includeSettlementDateFlows,
54 Date settlementDate,
55 const NotionalPath& notionalPath) const;
56
57 private:
58 ext::shared_ptr<CatRisk> catRisk_;
60 ext::optional<bool> includeSettlementDateFlows_;
61 };
62
63}
64
65#endif
66
base class for cat bond engine
Definition: catbond.hpp:84
Concrete date class.
Definition: date.hpp:125
Shared handle to an observable.
Definition: handle.hpp:41
Handle< YieldTermStructure > discountCurve_
Real npv(bool includeSettlementDateFlows, Date settlementDate, Date npvDate, Real &lossProbability, Real &exhaustionProbability, Real &expectedLoss) const
Handle< YieldTermStructure > discountCurve() const
Real pathNpv(bool includeSettlementDateFlows, Date settlementDate, const NotionalPath &notionalPath) const
Real cashFlowRiskyValue(const ext::shared_ptr< CashFlow > &cf, const NotionalPath &notionalPath) const
QL_REAL Real
real number
Definition: types.hpp:50
const boost::none_t & nullopt
Definition: optional.cpp:27
Definition: any.hpp:35