Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r72913 - sandbox/statistics/non_parametric/libs/statistics/detail/non_parametric/example
From: erwann.rogard_at_[hidden]
Date: 2011-07-05 07:26:31


Author: e_r
Date: 2011-07-05 07:26:30 EDT (Tue, 05 Jul 2011)
New Revision: 72913
URL: http://svn.boost.org/trac/boost/changeset/72913

Log:
cleaning up directory
Removed:
   sandbox/statistics/non_parametric/libs/statistics/detail/non_parametric/example/frequency_int.cpp
   sandbox/statistics/non_parametric/libs/statistics/detail/non_parametric/example/frequency_int.h
   sandbox/statistics/non_parametric/libs/statistics/detail/non_parametric/example/kolmogorov_smirnov.cpp
   sandbox/statistics/non_parametric/libs/statistics/detail/non_parametric/example/kolmogorov_smirnov.h

Deleted: sandbox/statistics/non_parametric/libs/statistics/detail/non_parametric/example/frequency_int.cpp
==============================================================================
--- sandbox/statistics/non_parametric/libs/statistics/detail/non_parametric/example/frequency_int.cpp 2011-07-05 07:26:30 EDT (Tue, 05 Jul 2011)
+++ (empty file)
@@ -1,81 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-// frequency_int.cpp //
-// //
-// Copyright 2010 Erwann Rogard. Distributed under the Boost //
-// Software License, Version 1.0. (See accompanying file //
-// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //
-///////////////////////////////////////////////////////////////////////////////
-#include <cmath>
-#include <vector>
-#include <algorithm>
-
-#include <boost/mpl/int.hpp>
-
-#include <boost/numeric/conversion/bounds.hpp>
-
-#include <boost/assign/std/vector.hpp>
-#include <boost/format.hpp>
-
-#include <boost/accumulators/accumulators.hpp>
-#include <boost/accumulators/statistics/stats.hpp>
-
-#include <boost/statistics/detail/non_parametric/empirical_distribution/ordered_sample.hpp>
-#include <boost/statistics/detail/non_parametric/empirical_distribution/cumulative_count.hpp>
-#include <boost/statistics/detail/non_parametric/empirical_distribution/cdf.hpp>
-#include <boost/statistics/detail/non_parametric/empirical_distribution/pdf.hpp>
-
-#include <libs/statistics/detail/non_parametric/example/frequency_int.h>
-
-void example_frequency_int(std::ostream& os)
-{
-
- os << "-> example_frequency_int" << std::endl;
-
- typedef int sample_; // sample_ x = 1;
- typedef double val_; // val_ p = pdf(dist,x);
- typedef std::vector<sample_> samples_;
-
- using namespace boost::assign;
- samples_ samples;
- const int n = 3;
- for(int i = 0; i<n; i++){
- for(int j = i; j<n; j++){
- samples.push_back(n-i);
- }
- } // 3, 3, 3, 2, 2, 1
-
- namespace ed = boost::statistics::detail::empirical_distribution;
- typedef ed::tag::cdf<val_> tag_cdf_;
- typedef ed::tag::pdf<val_> tag_pdf_;
- typedef boost::accumulators::accumulator_set<
- sample_,boost::accumulators::stats<tag_pdf_,tag_cdf_> > acc_;
-
- acc_ acc = std::for_each(
- boost::begin( samples ),
- boost::end( samples ),
- acc_()
- );
-
- os
- << (boost::format("empirical {(pdf,cdf):i=1,...,%1%} : ")%n).str()
- << std::endl;
- int sum = 0;
- val_ freq, cum_freq;
- for(int i = 0; i < n; i++){
- BOOST_ASSERT( ed::extract::count( acc, i+1 ) == i+1);
- sum += i+1;
- BOOST_ASSERT( ed::extract::cumulative_count( acc, i+1 ) == sum);
-
- cum_freq = ed::extract::cdf<val_>( acc, i+1 );
- freq = ed::extract::pdf<val_>( acc, i+1 );
- os << '(' << freq << ',' << cum_freq << ')' << std::endl;
- }
-
- typedef boost::numeric::bounds<val_> bounds_;
- val_ eps = bounds_::smallest();
- val_ one = static_cast<val_>( 1 );
-
- BOOST_ASSERT( fabs( one - cum_freq ) < eps );
-
- os << "<-" << std::endl;
-}

Deleted: sandbox/statistics/non_parametric/libs/statistics/detail/non_parametric/example/frequency_int.h
==============================================================================
--- sandbox/statistics/non_parametric/libs/statistics/detail/non_parametric/example/frequency_int.h 2011-07-05 07:26:30 EDT (Tue, 05 Jul 2011)
+++ (empty file)
@@ -1,13 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-// empirical_distribution::frequency_int.h //
-// //
-// Copyright 2010 Erwann Rogard. Distributed under the Boost //
-// Software License, Version 1.0. (See accompanying file //
-// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //
-///////////////////////////////////////////////////////////////////////////////
-#ifndef LIBS_STATISTICS_DETAIL_NON_PARAMETRIC_EMPIRICAL_DISTRIBUTION_FREQUENCY_INT_HPP_ER_2010
-#define LIBS_STATISTICS_DETAIL_NON_PARAMETRIC_EMPIRICAL_DISTRIBUTION_FREQUENCY_INT_HPP_ER_2010
-
-void example_frequency_int(std::ostream& os);
-
-#endif

Deleted: sandbox/statistics/non_parametric/libs/statistics/detail/non_parametric/example/kolmogorov_smirnov.cpp
==============================================================================
--- sandbox/statistics/non_parametric/libs/statistics/detail/non_parametric/example/kolmogorov_smirnov.cpp 2011-07-05 07:26:30 EDT (Tue, 05 Jul 2011)
+++ (empty file)
@@ -1,97 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-// kolmogorov_smirnov_statistic.cpp //
-// //
-// Copyright 2010 Erwann Rogard. Distributed under the Boost //
-// Software License, Version 1.0. (See accompanying file //
-// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //
-///////////////////////////////////////////////////////////////////////////////
-#include <vector>
-#include <algorithm>
-#include <iterator>
-
-#include <boost/mpl/int.hpp>
-
-#include <boost/typeof/typeof.hpp>
-#include <boost/range.hpp>
-
-#include <boost/assign/std/vector.hpp>
-#include <boost/format.hpp>
-#include <boost/foreach.hpp>
-
-#include <boost/accumulators/accumulators.hpp>
-#include <boost/accumulators/statistics/stats.hpp>
-
-#include <boost/math/distributions/poisson.hpp>
-#include <boost/random/poisson_distribution.hpp>
-
-#include <boost/math/distributions/normal.hpp>
-#include <boost/random/normal_distribution.hpp>
-
-#include <boost/random/mersenne_twister.hpp>
-#include <boost/random/variate_generator.hpp>
-
-#include <boost/statistics/detail/non_parametric/empirical_distribution/kolmogorov_smirnov_statistic/value.hpp>
-#include <boost/statistics/detail/non_parametric/empirical_distribution/kolmogorov_smirnov_statistic/series.hpp>
-
-#include <libs/statistics/detail/non_parametric/example/frequency_int.h>
-
-void example_kolmogorov_smirnov(
- std::ostream& os,
- double mean,
- long offset,
- long base,
- long first_p,
- long last_p
-)
-{
-
- os << "-> example_kolmogorov_smirnov" << std::endl;
-
- // This example illustrates kolmogorov smirnov for both a discrete
- // and a continuous distribution
-
- namespace ac = boost::accumulators;
- namespace ed = boost::statistics::detail::empirical_distribution;
- namespace ks = ed::kolmogorov_smirnov_statistic;
- typedef boost::mt19937 urng_;
-
- urng_ urng;
-
- {
- typedef boost::math::poisson_distribution<> dist_;
- typedef dist_::value_type val_;
- typedef boost::poisson_distribution<> random_;
- typedef boost::variate_generator<urng_&,random_> vg_;
- dist_ dist( mean );
- vg_ vg( urng, random_(mean) );
-
- os << "poisson(" << mean << ')' << std::endl;
-
- typedef ks::series_data<val_> data_;
-
- ks::series(
- dist, vg,
- offset, base, first_p, last_p,
- std::ostream_iterator<data_>(os,"\n")
- );
-
- }
- {
- typedef boost::math::normal_distribution<> dist_;
- typedef dist_::value_type val_;
- typedef boost::poisson_distribution<> random_;
- typedef boost::variate_generator<urng_&,random_> vg_;
- const val_ sd = 1.0;
- dist_ dist( mean, sd );
- vg_ vg( urng, random_(mean) );
- os << "normal(" << mean << ',' << sd << ')' << std::endl;
- typedef ks::series_data<val_> data_;
- ks::series(
- dist, vg,
- offset, base, first_p, last_p,
- std::ostream_iterator<data_>(os,"\n")
- );
-
- }
- os << "<-" << std::endl;
-}

Deleted: sandbox/statistics/non_parametric/libs/statistics/detail/non_parametric/example/kolmogorov_smirnov.h
==============================================================================
--- sandbox/statistics/non_parametric/libs/statistics/detail/non_parametric/example/kolmogorov_smirnov.h 2011-07-05 07:26:30 EDT (Tue, 05 Jul 2011)
+++ (empty file)
@@ -1,23 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-// kolmogorov_smirnov_statistic.h //
-// //
-// Copyright 2010 Erwann Rogard. Distributed under the Boost //
-// Software License, Version 1.0. (See accompanying file //
-// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //
-///////////////////////////////////////////////////////////////////////////////
-#ifndef LIBS_STATISTICS_DETAIL_NON_PARAMETRIC_KOLMOGOROV_SMIRNOV_HPP_ER_2010
-#define LIBS_STATISTICS_DETAIL_NON_PARAMETRIC_KOLMOGOROV_SMIRNOV_HPP_ER_2010
-#include <ostream>
-
-void example_kolmogorov_smirnov(
- std::ostream& os,
- double poisson_mean = 1.0,
- long offset = 1,
- long base = 10,
- long first_p = 0,
- long last_p = 5
-);
-
-#endif
-
-


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