statistics.hpp
Go to the documentation of this file.
1 /* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 
3 /*
4  Copyright (C) 2006, 2007, 2008 Ferdinando Ametrano
5  Copyright (C) 2006 Cristina Duminuco
6 
7  This file is part of QuantLib, a free-software/open-source library
8  for financial quantitative analysts and developers - http://quantlib.org/
9 
10  QuantLib is free software: you can redistribute it and/or modify it
11  under the terms of the QuantLib license. You should have received a
12  copy of the license along with this program; if not, please email
13  <quantlib-dev@lists.sf.net>. The license is also available online at
14  <http://quantlib.org/license.shtml>.
15 
16  This program is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
18  FOR A PARTICULAR PURPOSE. See the license for more details.
19 */
20 
21 #ifndef qla_riskstatistics_hpp
22 #define qla_riskstatistics_hpp
23 
24 #include <oh/libraryobject.hpp>
25 #include <ql/types.hpp>
26 
27 namespace QuantLib {
28  class GeneralStatistics;
29 
30  template<class Stat>
31  class GenericGaussianStatistics;
32 
33  typedef GenericGaussianStatistics<GeneralStatistics> GaussianStatistics;
34 
35  template<class S>
36  class GenericRiskStatistics;
37 
38  typedef GenericRiskStatistics<GaussianStatistics> RiskStatistics;
39 
40  typedef RiskStatistics Statistics;
41  class IncrementalStatistics;
42 
43 }
44 
45 namespace QuantLibAddin {
46 
47  class Statistics :
48  public ObjectHandler::LibraryObject<QuantLib::Statistics> {
49  public:
50  Statistics(const boost::shared_ptr<ObjectHandler::ValueObject>& properties,
51  const std::vector<QuantLib::Real>& values,
52  const std::vector<QuantLib::Real>& weights,
53  bool permanent);
54  };
55 
57  public ObjectHandler::LibraryObject<QuantLib::IncrementalStatistics> {
58  public:
60  const boost::shared_ptr<ObjectHandler::ValueObject>& properties,
61  const std::vector<QuantLib::Real>& values,
62  const std::vector<QuantLib::Real>& weights,
63  bool permanent);
64  };
65 
66 
67  #define DECLARE_TYPICAL_GAUSSIAN_2DOUBLE_STAT_FUNCTION(NAME) \
68  QuantLib::Real NAME(QuantLib::Real, QuantLib::Real);
69 
70  DECLARE_TYPICAL_GAUSSIAN_2DOUBLE_STAT_FUNCTION(gaussianDownsideVariance)
71  DECLARE_TYPICAL_GAUSSIAN_2DOUBLE_STAT_FUNCTION(gaussianDownsideDeviation)
72 
73 
74 
75  #define DECLARE_TYPICAL_GAUSSIAN_3DOUBLE_STAT_FUNCTION(NAME) \
76  QuantLib::Real NAME(QuantLib::Real, QuantLib::Real, QuantLib::Real);
77 
81  DECLARE_TYPICAL_GAUSSIAN_3DOUBLE_STAT_FUNCTION(gaussianPotentialUpside)
83  DECLARE_TYPICAL_GAUSSIAN_3DOUBLE_STAT_FUNCTION(gaussianExpectedShortfall)
85  DECLARE_TYPICAL_GAUSSIAN_3DOUBLE_STAT_FUNCTION(gaussianAverageShortfall)
86 
87 }
88 
89 #endif
#define DECLARE_TYPICAL_GAUSSIAN_3DOUBLE_STAT_FUNCTION(NAME)
Definition: statistics.hpp:75
#define DECLARE_TYPICAL_GAUSSIAN_2DOUBLE_STAT_FUNCTION(NAME)
Definition: statistics.hpp:67
IncrementalStatistics(const boost::shared_ptr< ObjectHandler::ValueObject > &properties, const std::vector< QuantLib::Real > &values, const std::vector< QuantLib::Real > &weights, bool permanent)
Definition: statistics.hpp:47
Statistics(const boost::shared_ptr< ObjectHandler::ValueObject > &properties, const std::vector< QuantLib::Real > &values, const std::vector< QuantLib::Real > &weights, bool permanent)
GenericRiskStatistics< GaussianStatistics > RiskStatistics
Definition: correlation.hpp:55
RiskStatistics Statistics
Definition: correlation.hpp:59
Definition: abcd.hpp:38
GenericGaussianStatistics< GeneralStatistics > GaussianStatistics
Definition: correlation.hpp:50
Definition: abcd.hpp:30
Definition: statistics.hpp:56