|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r60969 - in sandbox/statistics/non_parametric/boost/statistics/detail/non_parametric: empirical_distribution kolmogorov_smirnov
From: erwann.rogard_at_[hidden]
Date: 2010-03-31 10:23:14
Author: e_r
Date: 2010-03-31 10:23:13 EDT (Wed, 31 Mar 2010)
New Revision: 60969
URL: http://svn.boost.org/trac/boost/changeset/60969
Log:
m
Text files modified:
sandbox/statistics/non_parametric/boost/statistics/detail/non_parametric/empirical_distribution/count.hpp | 12 ++++++++----
sandbox/statistics/non_parametric/boost/statistics/detail/non_parametric/empirical_distribution/frequency.hpp | 8 ++++++++
sandbox/statistics/non_parametric/boost/statistics/detail/non_parametric/empirical_distribution/ordered_sample.hpp | 14 ++++++++++----
sandbox/statistics/non_parametric/boost/statistics/detail/non_parametric/kolmogorov_smirnov/statistic.hpp | 15 +++++++--------
4 files changed, 33 insertions(+), 16 deletions(-)
Modified: sandbox/statistics/non_parametric/boost/statistics/detail/non_parametric/empirical_distribution/count.hpp
==============================================================================
--- sandbox/statistics/non_parametric/boost/statistics/detail/non_parametric/empirical_distribution/count.hpp (original)
+++ sandbox/statistics/non_parametric/boost/statistics/detail/non_parametric/empirical_distribution/count.hpp 2010-03-31 10:23:13 EDT (Wed, 31 Mar 2010)
@@ -32,12 +32,16 @@
namespace detail{
namespace empirical_distribution{
+ // Usage:
+ // namespace ns = empirical_distribution;
+ // accumulator_set<T,stats<ns::tag::count<Cum> > > acc;
+ // acc = boost:for_each(samples,acc);
+ // ns::extract::count<Cum>(acc,x);
+ // The result of the last statement is number of observations matching (less
+ // than) x in the samples if Cum = false (true).
+
namespace impl{
-
- // Count of occurences matching (Cum = false) a given value or less or equal
- // to that value (Cum = true).
- //
// T can be an integer or a float
template<typename T,bool Cum,typename Comp = std::less<T> >
class count : public boost::accumulators::accumulator_base{
Modified: sandbox/statistics/non_parametric/boost/statistics/detail/non_parametric/empirical_distribution/frequency.hpp
==============================================================================
--- sandbox/statistics/non_parametric/boost/statistics/detail/non_parametric/empirical_distribution/frequency.hpp (original)
+++ sandbox/statistics/non_parametric/boost/statistics/detail/non_parametric/empirical_distribution/frequency.hpp 2010-03-31 10:23:13 EDT (Wed, 31 Mar 2010)
@@ -30,6 +30,14 @@
namespace detail{
namespace empirical_distribution{
+ // Usage:
+ // namespace ns = empirical_distribution;
+ // accumulator_set<T,stats<ns::tag::count<Cum> > > acc;
+ // acc = boost:for_each(samples,acc);
+ // ns::extract::count<Cum>(acc,x);
+ // The result of the last statement is the % of observation matching (less
+ // than) x in the samples if Cum = false (true).
+
namespace impl{
// Frequency as percentage of the sample size
Modified: sandbox/statistics/non_parametric/boost/statistics/detail/non_parametric/empirical_distribution/ordered_sample.hpp
==============================================================================
--- sandbox/statistics/non_parametric/boost/statistics/detail/non_parametric/empirical_distribution/ordered_sample.hpp (original)
+++ sandbox/statistics/non_parametric/boost/statistics/detail/non_parametric/empirical_distribution/ordered_sample.hpp 2010-03-31 10:23:13 EDT (Wed, 31 Mar 2010)
@@ -25,10 +25,16 @@
namespace detail{
namespace empirical_distribution{
+ // Usage:
+ // namespace ns = empirical_distribution;
+ // accumulator_set<T,stats<ns::tag::ordered_sample> > acc;
+ // acc = boost:for_each(samples,acc);
+ // ns::extract::ordered_sample(acc);
+ // The result of the last statement is a sorted map associating each value
+ // in the sample (of type T) with their number of occurences in the sample.
+
namespace impl{
- // Associates sample values (type T) with their number of occurences in
- // the sample
template<typename T>
class ordered_sample : public boost::accumulators::accumulator_base{
typedef std::less<T> comp_;
@@ -59,10 +65,10 @@
// Returns the entire distribution, represented by a map
result_type result(dont_care_)const{
- return (this->freq);
+ return (this->freq);
}
- private:
+ private:
mutable map_ freq;
};
Modified: sandbox/statistics/non_parametric/boost/statistics/detail/non_parametric/kolmogorov_smirnov/statistic.hpp
==============================================================================
--- sandbox/statistics/non_parametric/boost/statistics/detail/non_parametric/kolmogorov_smirnov/statistic.hpp (original)
+++ sandbox/statistics/non_parametric/boost/statistics/detail/non_parametric/kolmogorov_smirnov/statistic.hpp 2010-03-31 10:23:13 EDT (Wed, 31 Mar 2010)
@@ -33,17 +33,16 @@
namespace detail{
namespace kolmogorov_smirnov{
-namespace impl{
-
// Usage:
- // namespace ks = kolmogorov_smirnov;
- // using namespace math;
- // accumulator_set<T,stats<ks::statistic<T1> > acc;
- // acc = boost:for_each(samples,acc)
- // ks::extract::statistic<T1>(acc,normal_distribution<T1>(0,1));
+ // namespace ns = kolmogorov_smirnov;
+ // accumulator_set<T,stats<ns::tag::statistic<T1> > acc;
+ // acc = boost:for_each(samples,acc);
+ // ns::extract::statistic<T1>(acc,normal_distribution<T1>(0,1));
// In this example, the kolmogorov-statistic between the samples and the
// standard normal distribution is computed.
- //
+
+namespace impl{
+
// Warning : See empirical_distribution::impl::count
template<typename T,typename T1>
class statistic : public boost::accumulators::accumulator_base{
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk