|
From: Amine I. <ami...@gm...> - 2020-08-25 10:50:11
|
Hi Daniel,
These functions below are implemented using the (intelligent) MACRO design:
#define DEFINE_SEQUENCE_STAT_CONST_METHOD_VOID(METHOD) \
template <class Stat> \
std::vector<Real> \
GenericSequenceStatistics<Stat>::METHOD() const { \
for (Size i=0; i<dimension_; i++) \
results_[i] = stats_[i].METHOD(); \
return results_; \
}
DEFINE_SEQUENCE_STAT_CONST_METHOD_VOID(mean)
DEFINE_SEQUENCE_STAT_CONST_METHOD_VOID(variance)
DEFINE_SEQUENCE_STAT_CONST_METHOD_VOID(standardDeviation)
DEFINE_SEQUENCE_STAT_CONST_METHOD_VOID(downsideVariance)
DEFINE_SEQUENCE_STAT_CONST_METHOD_VOID(downsideDeviation)
DEFINE_SEQUENCE_STAT_CONST_METHOD_VOID(semiVariance)
DEFINE_SEQUENCE_STAT_CONST_METHOD_VOID(semiDeviation)
DEFINE_SEQUENCE_STAT_CONST_METHOD_VOID(errorEstimate)
DEFINE_SEQUENCE_STAT_CONST_METHOD_VOID(skewness)
DEFINE_SEQUENCE_STAT_CONST_METHOD_VOID(kurtosis)
DEFINE_SEQUENCE_STAT_CONST_METHOD_VOID(min)
DEFINE_SEQUENCE_STAT_CONST_METHOD_VOID(max)
#undef DEFINE_SEQUENCE_STAT_CONST_METHOD_VOID
And these methods METHOD() are defined here: ql/math/statistics/generalstatistics.cpp
Hope this helps.
Amine
> On 25 Aug 2020, at 11:25, Daniel Lobo <dan...@gm...> wrote:
>
> Hi Quantlib experts -
>
> I was looking at various implementation of the statistical tools here -
>
> https://github.com/lballabio/QuantLib/blob/master/ql/math/statistics/sequencestatistics.hpp <https://github.com/lballabio/QuantLib/blob/master/ql/math/statistics/sequencestatistics.hpp>
>
> There implemented various methods and classes like -
>
> std::vector<Real> mean() const;
> std::vector<Real> variance() const;
> std::vector<Real> standardDeviation() const;
> std::vector<Real> downsideVariance() const;
> std::vector<Real> downsideDeviation() const;
> std::vector<Real> semiVariance() const;
> std::vector<Real> semiDeviation() const;
> std::vector<Real> errorEstimate() const;
> std::vector<Real> skewness() const;
> std::vector<Real> kurtosis() const;
> std::vector<Real> min() const;
> std::vector<Real> max() const;
>
> and classes like Real() etc.
>
> Can you please help to point the source files, where actual definitions and calculations are coded?
>
> Really appreciate for your help and apologies if my question is really stupid.
>
> Thanks and regards,
>
> _______________________________________________
> QuantLib-users mailing list
> Qua...@li...
> https://lists.sourceforge.net/lists/listinfo/quantlib-users
|