Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r56389 - in sandbox/statistics/distribution_toolkit: . boost boost/statistics boost/statistics/detail boost/statistics/detail/distribution_toolkit boost/statistics/detail/distribution_toolkit/concept boost/statistics/detail/distribution_toolkit/data boost/statistics/detail/distribution_toolkit/dist_wrap boost/statistics/detail/distribution_toolkit/distributions boost/statistics/detail/distribution_toolkit/distributions/chi_squared boost/statistics/detail/distribution_toolkit/distributions/exponential boost/statistics/detail/distribution_toolkit/distributions/gamma boost/statistics/detail/distribution_toolkit/distributions/location_scale boost/statistics/detail/distribution_toolkit/distributions/normal boost/statistics/detail/distribution_toolkit/distributions/students_t boost/statistics/detail/distribution_toolkit/distributions/uniform boost/statistics/detail/distribution_toolkit/distributions/wrapper boost/statistics/detail/distribution_toolkit/fun_wrap boost/statistics/detail/distribution_toolkit/fun_wrap/detail boost/statistics/detail/distribution_toolkit/functor boost/statistics/detail/distribution_toolkit/fwd_math boost/statistics/detail/distribution_toolkit/iterator boost/statistics/detail/distribution_toolkit/map_pdf boost/statistics/detail/distribution_toolkit/map_pdf/inherit boost/statistics/detail/distribution_toolkit/map_pdf/inverse_pdf boost/statistics/detail/distribution_toolkit/map_pdf/product_pdf boost/statistics/detail/distribution_toolkit/map_pdf/ratio_pdf boost/statistics/detail/distribution_toolkit/meta boost/statistics/detail/distribution_toolkit/random boost/statistics/detail/distribution_toolkit/statistics boost/statistics/detail/distribution_toolkit/transformation boost/statistics/detail/distribution_toolkit/unscope libs libs/statistics libs/statistics/detail libs/statistics/detail/distribution_toolkit libs/statistics/detail/distribution_toolkit/doc libs/statistics/detail/distribution_toolkit/example libs/statistics/detail/distribution_toolkit/src
From: erwann.rogard_at_[hidden]
Date: 2009-09-26 16:44:36


Author: e_r
Date: 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
New Revision: 56389
URL: http://svn.boost.org/trac/boost/changeset/56389

Log:
Merges previous packages scalar_dist dist_random standard_distribution and significant modifications to the interface
Added:
   sandbox/statistics/distribution_toolkit/
   sandbox/statistics/distribution_toolkit/boost/
   sandbox/statistics/distribution_toolkit/boost/statistics/
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/concept/
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/concept/cdf.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/concept/derivative_log_unnormalized_pdf.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/concept/log_unnormalized_pdf.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/concept/mean.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/concept/normalizing_constant.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/concept/pdf.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/concept/quantile.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/concept/variance.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/data/
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/data/sample_cdf.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/dist_wrap/
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/chi_squared/
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/chi_squared/derivative_log_unnormalized_pdf.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/chi_squared/description.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/chi_squared/include.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/chi_squared/is_math_distribution.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/chi_squared/log_unnormalized_pdf.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/chi_squared/random.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/exponential/
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/exponential/derivative_log_unnormalized_pdf.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/exponential/description.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/exponential/include.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/exponential/is_math_distribution.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/exponential/log_unnormalized_pdf.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/exponential/random.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/gamma/
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/gamma/derivative_log_unnormalized_pdf.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/gamma/description.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/gamma/include.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/gamma/is_log_concave.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/gamma/is_math_distribution.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/gamma/log_unnormalized_pdf.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/gamma/random.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/include.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/location_scale/
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/location_scale/cdf.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/location_scale/description.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/location_scale/include.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/location_scale/is_scalar_distribution.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/location_scale/location_scale.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/location_scale/log_unnormalized_pdf.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/location_scale/mean.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/location_scale/pdf.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/location_scale/random.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/location_scale/variance.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/normal/
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/normal/derivative_log_unnormalized_pdf.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/normal/description.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/normal/include.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/normal/is_math_distribution.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/normal/log_unnormalized_pdf.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/normal/normalizing_constant.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/normal/random.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/students_t/
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/students_t/derivative_log_unnormalized_pdf.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/students_t/description.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/students_t/include.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/students_t/is_math_distribution.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/students_t/log_unnormalized_pdf.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/students_t/random.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/uniform/
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/uniform/derivative_log_unnormalized_pdf.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/uniform/description.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/uniform/include.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/uniform/is_math_distribution.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/uniform/log_unnormalized_pdf.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/wrapper/
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/wrapper/cdf.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/wrapper/derivative_log_unnormalized_pdf.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/wrapper/description.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/wrapper/include.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/wrapper/is_pseudo_scalar_distribution.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/wrapper/is_scalar_distribution.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/wrapper/log_unnormalized_pdf.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/wrapper/mean.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/wrapper/normalizing_constant.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/wrapper/pdf.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/wrapper/quantile.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/wrapper/random.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/wrapper/variance.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/wrapper/wrapper.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/fun_wrap/
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/fun_wrap/cdf.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/fun_wrap/detail/
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/fun_wrap/detail/impl.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/fun_wrap/include.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/fun_wrap/log_unnormalized_pdf.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/fun_wrap/pdf.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/fun_wrap/quantile.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/fun_wrap/unnormalized_pdf.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/functor/
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/fwd_math/
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/fwd_math/cdf.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/fwd_math/include.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/fwd_math/mean.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/fwd_math/pdf.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/fwd_math/quantile.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/fwd_math/variance.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/include.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/iterator/
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/iterator/distribution_function.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/iterator/include.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/map_pdf/
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/map_pdf/include.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/map_pdf/inherit/
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/map_pdf/inverse_pdf/
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/map_pdf/inverse_pdf/include.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/map_pdf/inverse_pdf/inverse_pdf.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/map_pdf/inverse_pdf/is_pseudo_scalar_distribution.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/map_pdf/inverse_pdf/log_unnormalized_pdf.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/map_pdf/product_pdf/
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/map_pdf/product_pdf/include.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/map_pdf/product_pdf/is_pseudo_scalar_distribution.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/map_pdf/product_pdf/log_unnormalized_pdf.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/map_pdf/product_pdf/product_pdf.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/map_pdf/ratio_pdf/
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/map_pdf/ratio_pdf/include.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/map_pdf/ratio_pdf/ratio_pdf.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/meta/
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/meta/bind_delegate.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/meta/delegate.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/meta/distribution_base.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/meta/include.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/meta/inherit_policy.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/meta/inherit_value.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/meta/is_math_distribution.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/meta/is_pseudo_scalar_distribution.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/meta/is_scalar_distribution.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/meta/pointer.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/meta/policy.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/meta/random.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/meta/signature.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/meta/value.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/random/
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/random/generator.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/random/include.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/statistics/
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/transformation/
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/transformation/include.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/unscope/
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/unscope/include.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/unscope/log_unnormalized_pdf.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/unscope/os.hpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/libs/
   sandbox/statistics/distribution_toolkit/libs/statistics/
   sandbox/statistics/distribution_toolkit/libs/statistics/detail/
   sandbox/statistics/distribution_toolkit/libs/statistics/detail/distribution_toolkit/
   sandbox/statistics/distribution_toolkit/libs/statistics/detail/distribution_toolkit/doc/
   sandbox/statistics/distribution_toolkit/libs/statistics/detail/distribution_toolkit/doc/readme.txt (contents, props changed)
   sandbox/statistics/distribution_toolkit/libs/statistics/detail/distribution_toolkit/example/
   sandbox/statistics/distribution_toolkit/libs/statistics/detail/distribution_toolkit/example/distribution_function.cpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/libs/statistics/detail/distribution_toolkit/example/distribution_function.h (contents, props changed)
   sandbox/statistics/distribution_toolkit/libs/statistics/detail/distribution_toolkit/example/random.cpp (contents, props changed)
   sandbox/statistics/distribution_toolkit/libs/statistics/detail/distribution_toolkit/example/random.h (contents, props changed)
   sandbox/statistics/distribution_toolkit/libs/statistics/detail/distribution_toolkit/src/
   sandbox/statistics/distribution_toolkit/libs/statistics/detail/distribution_toolkit/src/main.cpp (contents, props changed)

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/concept/cdf.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/concept/cdf.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,49 @@
+//////////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::distributions::concept::cdf.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_CONCEPT_CDF_HPP_ER_2009
+#define BOOST_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_CONCEPT_CDF_HPP_ER_2009
+#include <boost/concept_check.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/value.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+namespace concept{
+
+ // Why would this fail?
+ // If D is in boost::math, you need to bring the function below into the
+ // scope of distribution_toolkit by
+ // a) including (or if necessary creating) the file,
+ // distribution_toolkit/distributions/D/is_math_distribution.hpp
+ // where meta::is_math::distribution<D> specializes to mpl::bool_<true>
+ // b) including the relevant file in distribution_toolkit/fwd_math
+ template<typename D>
+ class Cdf{
+ public:
+
+ BOOST_CONCEPT_USAGE(Cdf){
+ val = cdf(dist,x);
+ }
+
+ private:
+ typedef typename meta::value<D>::type value_;
+ D dist;
+ value_ val;
+ value_ x;
+
+ };
+
+}// concept
+}// distribution_toolkit
+}// statistics
+}// detail
+}// boost
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/concept/derivative_log_unnormalized_pdf.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/concept/derivative_log_unnormalized_pdf.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,46 @@
+/////////////////////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::distributions::concept::derivative_log_unnormalized_pdf.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_CONCEPT_DERIVATIVE_LOG_UNNORMALIZED_PDF_HPP_ER_2009
+#define BOOST_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_CONCEPT_DERIVATIVE_LOG_UNNORMALIZED_PDF_HPP_ER_2009
+#include <boost/concept_check.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/value.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+namespace concept{
+
+ // Why would this fail?
+ // If D is in boost::math, include (or if neccessary create)
+ // distribution_toolkit/distribution/D/is_math_distribution
+ // distribution_toolkit/distribution/D/log_unnormalized_pdf
+ template<typename D>
+ class DerivativeLogUnnormalizedPdf{
+ public:
+
+ BOOST_CONCEPT_USAGE(DerivativeLogUnnormalizedPdf){
+ val = derivative_log_unnormalized_pdf(dist,x);
+ }
+
+ private:
+ typedef typename meta::value<D>::type value_;
+ D dist;
+ value_ val;
+ value_ x;
+
+ };
+
+}// concept
+}// distribution_toolkit
+}// statistics
+}// detail
+}// boost
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/concept/log_unnormalized_pdf.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/concept/log_unnormalized_pdf.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,46 @@
+//////////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::distributions::concept::log_unnormalized_pdf.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_CONCEPT_LOG_UNNORMALIZED_PDF_HPP_ER_2009
+#define BOOST_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_CONCEPT_LOG_UNNORMALIZED_PDF_HPP_ER_2009
+#include <boost/concept_check.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/value.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+namespace concept{
+
+ // Why would this fail?
+ // If D is in boost::math, include (or if neccessary create)
+ // distribution_toolkit/distribution/D/is_math_distribution
+ // distribution_toolkit/distribution/D/log_unnormalized_pdf
+ template<typename D>
+ class LogUnnormalizedPdf{
+ public:
+
+ BOOST_CONCEPT_USAGE(LogUnnormalizedPdf){
+ val = log_unnormalized_pdf(dist,x);
+ }
+
+ private:
+ typedef typename meta::value<D>::type value_;
+ D dist;
+ value_ val;
+ value_ x;
+
+ };
+
+}// concept
+}// distribution_toolkit
+}// statistics
+}// detail
+}// boost
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/concept/mean.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/concept/mean.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,47 @@
+//////////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::distributions::concept::mean.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_CONCEPT_MEAN_HPP_ER_2009
+#define BOOST_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_CONCEPT_MEAN_HPP_ER_2009
+#include <boost/concept_check.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/value.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+namespace concept{
+
+ // Why would this fail?
+ // If D is in boost::math, you need to bring the function below into the
+ // scope of distribution_toolkit by
+ // a) including (or if necessary creating) the file,
+ // distribution_toolkit/distributions/D/is_math_distribution.hpp
+ // where meta::is_math::distribution<D> specializes to mpl::bool_<true>
+ // b) including the relevant file in distribution_toolkit/fwd_math
+ template<typename D>
+ class Mean{
+ public:
+
+ BOOST_CONCEPT_USAGE(Mean){
+ val = mean(dist);
+ }
+
+ private:
+ typedef typename meta::value<D>::type value_;
+ D dist;
+ value_ val;
+ };
+
+}// concept
+}// distribution_toolkit
+}// statistics
+}// detail
+}// boost
+
+#endif

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/concept/normalizing_constant.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/concept/normalizing_constant.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,41 @@
+//////////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::distributions::concept::normalizing_constant.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_CONCEPT_NORMALIZING_CONSTANT_HPP_ER_2009
+#define BOOST_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_CONCEPT_NORMALIZING_CONSTANT_HPP_ER_2009
+#include <boost/concept_check.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/value.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+namespace concept{
+
+ template<typename D>
+ class NormalizingConstant{
+ public:
+
+ BOOST_CONCEPT_USAGE(NormalizingConstant){
+ val = normalizing_constant(dist);
+ }
+
+ private:
+ typedef typename meta::value<D>::type value_;
+ D dist;
+ value_ val;
+
+ };
+
+}// concept
+}// distribution_toolkit
+}// statistics
+}// detail
+}// boost
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/concept/pdf.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/concept/pdf.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,49 @@
+//////////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::distributions::concept::pdf.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_CONCEPT_PDF_HPP_ER_2009
+#define BOOST_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_CONCEPT_PDF_HPP_ER_2009
+#include <boost/concept_check.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/value.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+namespace concept{
+
+ // Why would this fail?
+ // If D is in boost::math, you need to bring the function below into the
+ // scope of distribution_toolkit by
+ // a) including (or if necessary creating) the file,
+ // distribution_toolkit/distributions/D/is_math_distribution.hpp
+ // where meta::is_math::distribution<D> specializes to mpl::bool_<true>
+ // b) including the relevant file in distribution_toolkit/fwd_math
+ template<typename D>
+ class Pdf{
+ public:
+
+ BOOST_CONCEPT_USAGE(Pdf){
+ val = pdf(dist,x);
+ }
+
+ private:
+ typedef typename meta::value<D>::type value_;
+ D dist;
+ value_ val;
+ value_ x;
+
+ };
+
+}// concept
+}// distribution_toolkit
+}// statistics
+}// detail
+}// boost
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/concept/quantile.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/concept/quantile.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,49 @@
+//////////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::distributions::concept::quantile.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_CONCEPT_QUANTILE_HPP_ER_2009
+#define BOOST_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_CONCEPT_QUANTILE_HPP_ER_2009
+#include <boost/concept_check.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/value.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+namespace concept{
+
+ // Why would this fail?
+ // If D is in boost::math, you need to bring the function below into the
+ // scope of distribution_toolkit by
+ // a) including (or if necessary creating) the file,
+ // distribution_toolkit/distributions/D/is_math_distribution.hpp
+ // where meta::is_math::distribution<D> specializes to mpl::bool_<true>
+ // b) including the relevant file in distribution_toolkit/fwd_math
+ template<typename D>
+ class Quantile{
+ public:
+
+ BOOST_CONCEPT_USAGE(Quantile){
+ val = quantile(dist,p);
+ }
+
+ private:
+ typedef typename meta::value<D>::type value_;
+ D dist;
+ value_ val;
+ value_ p;
+
+ };
+
+}// concept
+}// distribution_toolkit
+}// statistics
+}// detail
+}// boost
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/concept/variance.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/concept/variance.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,47 @@
+//////////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::distributions::concept::variance.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_CONCEPT_VARIANCE_HPP_ER_2009
+#define BOOST_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_CONCEPT_VARIANCE_HPP_ER_2009
+#include <boost/concept_check.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/value.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+namespace concept{
+
+ // Why would this fail?
+ // If D is in boost::math, you need to bring the function below into the
+ // scope of distribution_toolkit by
+ // a) including (or if necessary creating) the file,
+ // distribution_toolkit/distributions/D/is_math_distribution.hpp
+ // where meta::is_math::distribution<D> specializes to mpl::bool_<true>
+ // b) including the relevant file in distribution_toolkit/fwd_math
+ template<typename D>
+ class Variance{
+ public:
+
+ BOOST_CONCEPT_USAGE(Variance){
+ val = variance(dist);
+ }
+
+ private:
+ typedef typename meta::value<D>::type value_;
+ D dist;
+ value_ val;
+ };
+
+}// concept
+}// distribution_toolkit
+}// statistics
+}// detail
+}// boost
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/data/sample_cdf.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/data/sample_cdf.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,144 @@
+//////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::data::sample_cdf.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DATA_SAMPLE_CDF_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DATA_SAMPLE_CDF_HPP_ER_2009
+#include <ext/algorithm>
+#include <ostream>
+#include <vector>
+#include <limits>
+#include <boost/format.hpp>
+#include <boost/typeof/typeof.hpp>
+#include <boost/range.hpp>
+#include <boost/fusion/container/map.hpp>
+#include <boost/fusion/include/map.hpp>
+#include <boost/fusion/include/map_fwd.hpp>
+#include <boost/fusion/sequence/intrinsic/at_key.hpp>
+#include <boost/fusion/include/at_key.hpp>
+
+#include <boost/statistics/detail/distribution_toolkit/random/generator.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+
+ // This data structure is useful, for example, to compute the kolmogorov
+ // smirnov statistic at different iterations during the sampling genera-
+ // tion process.
+ template<typename T>
+ class sample_cdf{
+ typedef mpl::int_<1> key1_;
+ typedef mpl::int_<2> key2_;
+
+ typedef fusion::pair<key1_,T> pair1_;
+ typedef fusion::pair<key2_,T> pair2_;
+
+ typedef fusion::map<
+ pair1_,
+ pair2_
+ > map_;
+
+ public:
+ typedef T value_type;
+ typedef key1_ key_observation;
+ typedef key1_ key_cdf;
+
+ typedef std::vector<map_> sample_type;
+ typedef typename range_size<sample_type>::type size_type;
+
+ sample_cdf(){}
+
+ // Update
+ template<typename N>
+ void reserve(N n){ this->sample_.reserve(n); }
+ void clear(){ this->sample_.clear(); }
+ template<typename X,typename D>
+ void operator()(const X& x,const D& dist){
+ map_ map(
+ fusion::make_pair<key1_>(x),
+ fusion::make_pair<key2_>(cdf(dist,x))
+ );
+ this->sample_.push_back(map);
+ }
+
+ template<typename N,typename D,typename U>
+ void generate(N n, U& urng,const D& dist){
+ BOOST_AUTO(vg,boost::make_random_generator(urng,dist));
+ size_type i = 0;
+ while(i<n){
+ (*this)(vg(),dist);
+ ++i;
+ };
+
+ }
+
+ // Access
+ size_type size()const{ return boost::size(this->sample()); }
+ const sample_type& sample()const{ return this->sample_; }
+
+ // Warning :
+ // 1) not correct if combos in the sample (discrete distribution)
+ // 2) sorts the sample by observation value
+ value_type kolmogorov_smirnov_statistic()const{
+ typedef typename range_iterator<const sample_type>::type it_;
+ std::sort(
+ boost::begin(this->sample_),
+ boost::end(this->sample_),
+ less_than()
+ );
+
+ value_type m1 = static_cast<T>(0);
+ size_type i = 1;
+ size_type n = boost::size(this->sample());
+
+ it_ b = boost::begin(this->sample());
+ it_ e = boost::end(this->sample());
+
+ while(b<e){
+ T ecdf = static_cast<T>(i)/static_cast<T>(n);
+ T cdf = boost::fusion::at_key<key2_>(*b);
+ T m2 = (cdf > ecdf)?(cdf - ecdf) : (ecdf - cdf);
+ if(m2 > m1){ m1 = m2; }
+ ++b;
+ ++i;
+ }
+ return m1;
+ }
+
+ private:
+ mutable sample_type sample_;
+ struct less_than{
+ less_than(){}
+ typedef bool result_type;
+ template<typename M>
+ bool operator()(const M& m1,const M& m2)const{
+ return ( boost::fusion::at_key<key1_>(m1)
+ < boost::fusion::at_key<key1_>(m2)
+ );
+ }
+
+ };
+ };
+
+ template<typename T>
+ std::ostream& operator<<(std::ostream& os,const sample_cdf<T>& sc){
+
+ os << (
+ format("(%1%,%2%)")%sc.size()%sc.kolmogorov_smirnov_statistic()
+ ).str();
+ return os;
+ }
+
+
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/chi_squared/derivative_log_unnormalized_pdf.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/chi_squared/derivative_log_unnormalized_pdf.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,58 @@
+///////////////////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::distributions::chi_squared::derivative_log_unnormalized_pdf.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_CHI_SQUARED_DERIVATIVE_LOG_UNNORMALIZED_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_CHI_SQUARED_DERIVATIVE_LOG_UNNORMALIZED_HPP_ER_2009
+#include <boost/math/distributions/chi_squared.hpp>
+#include <boost/math/special_functions/log1p.hpp>
+#include <boost/numeric/conversion/converter.hpp>
+#include <boost/math/policies/policy.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+
+ template<typename T,typename P>
+ T
+ derivative_log_unnormalized_pdf(
+ const boost::math::chi_squared_distribution<T,P>& dist,
+ const T& x
+ ){
+ BOOST_MATH_STD_USING // for ADL of std functions
+ T degrees_of_freedom = dist.degrees_of_freedom();
+ // Error check:
+ T error_result;
+
+ static const char* function =
+"boost::math::log_unnormalized_pdf(const chi_squared_distribution<%1%>&, %1%)";
+
+ if(false == math::detail::check_df(
+ function, degrees_of_freedom, &error_result, P()))
+ return error_result;
+
+ if((x < 0) || !(boost::math::isfinite)(x))
+ {
+ return math::policies::raise_domain_error<T>(
+ function, "Chi Square parameter was %1%, but must be > 0 !",
+ x, P());
+ }
+
+ // Lumped case x == 0 in x<=0 above
+
+ static T one = static_cast<T>(1);
+ static T two = static_cast<T>(2);
+ return (degrees_of_freedom/two-one) / x - one/two;
+ }
+
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/chi_squared/description.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/chi_squared/description.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,35 @@
+//////////////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::distributions::chi_squared::description.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_CHI_SQUARED_DESCRIPTION_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_CHI_SQUARED_DESCRIPTION_HPP_ER_2009
+#include <ostream>
+#include <boost/format.hpp>
+#include <boost/math/distributions/chi_squared.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+
+ template<typename T,typename P>
+ std::string
+ description(const math::chi_squared_distribution<T,P>& dist)
+ {
+ static const char* msg = "chi_squared(%1%)";
+ format f(msg); f % dist.degrees_of_freedom();
+ return f.str();
+ }
+
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/chi_squared/include.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/chi_squared/include.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,20 @@
+//////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::map_pdf::distributions::chi_squared::include.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_CHI_SQUARED_INCLUDE_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_CHI_SQUARED_INCLUDE_HPP_ER_2009
+
+#include <boost/math/distributions/chi_squared.hpp>
+
+#include <boost/statistics/detail/distribution_toolkit/distributions/chi_squared/description.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/chi_squared/derivative_log_unnormalized_pdf.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/chi_squared/is_math_distribution.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/chi_squared/log_unnormalized_pdf.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/chi_squared/random.hpp>
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/chi_squared/is_math_distribution.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/chi_squared/is_math_distribution.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,31 @@
+//////////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::distributions::chi_squared::is_math_distribution.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_CHI_SQUARED_IS_MATH_DISTRIBUTION_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_CHI_SQUARED_IS_MATH_DISTRIBUTION_HPP_ER_2009
+#include <boost/mpl/bool.hpp>
+#include <boost/math/distributions/chi_squared.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/is_math_distribution.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+namespace meta{
+
+ template<typename T,typename P>
+ struct is_math_distribution< math::chi_squared_distribution<T,P> >
+ : mpl::bool_<true>{};
+
+}// meta
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+
+#endif

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/chi_squared/log_unnormalized_pdf.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/chi_squared/log_unnormalized_pdf.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,58 @@
+/////////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::distributions::chi_squared::log_unnormalized_pdf.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_CHI_SQUARED_LOG_UNNORMALIZED_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_CHI_SQUARED_LOG_UNNORMALIZED_HPP_ER_2009
+#include <boost/math/distributions/chi_squared.hpp>
+#include <boost/math/special_functions/log1p.hpp>
+#include <boost/numeric/conversion/converter.hpp>
+#include <boost/math/policies/policy.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+
+ template<typename T,typename P>
+ T
+ log_unnormalized_pdf(
+ const boost::math::chi_squared_distribution<T,P>& dist,
+ const T& x
+ ){
+ BOOST_MATH_STD_USING // for ADL of std functions
+ T degrees_of_freedom = dist.degrees_of_freedom();
+ // Error check:
+ T error_result;
+
+ static const char* function =
+"boost::math::log_unnormalized_pdf(const chi_squared_distribution<%1%>&, %1%)";
+
+ if(false == math::detail::check_df(
+ function, degrees_of_freedom, &error_result, P()))
+ return error_result;
+
+ if((x <= 0) || !(boost::math::isfinite)(x))
+ {
+ return math::policies::raise_domain_error<T>(
+ function, "Chi Square parameter was %1%, but must be > 0 !",
+ x, P());
+ }
+
+ // Lumped case x == 0 in x<=0 above
+
+ static T one = static_cast<T>(1);
+ static T two = static_cast<T>(2);
+ return (degrees_of_freedom/two-one) * log(x) - x/two;
+ }
+
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/chi_squared/random.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/chi_squared/random.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,39 @@
+/////////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::distributions::chi_squared::random.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_CHI_SQUARED_RANDOM_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_CHI_SQUARED_RANDOM_HPP_ER_2009
+#include <boost/math/distributions/chi_squared.hpp>
+#include <boost/random/chi_squared.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/random.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+namespace meta{
+
+ template<typename T,typename P>
+ struct random<
+ boost::math::chi_squared_distribution<T,P>
+ >{
+ typedef math::chi_squared_distribution<T> dist_;
+ typedef boost::random::chi_squared_distribution<T> type;
+
+ static type make(const dist_& d){
+ return type(d.degrees_of_freedom());
+ }
+ };
+
+}// meta
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+
+#endif

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/exponential/derivative_log_unnormalized_pdf.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/exponential/derivative_log_unnormalized_pdf.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,51 @@
+///////////////////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::distributions::exponential::derivative_log_unnormalized_pdf.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_EXPONENTIAL_DERIVATIVE_LOG_UNNORMALIZED_PDF_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_EXPONENTIAL_DERIVATIVE_LOG_UNNORMALIZED_PDF_HPP_ER_2009
+#include <string>
+#include <boost/math/distributions/exponential.hpp>
+#include <boost/math/policies/policy.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+
+ template<typename T,typename P>
+ T
+ derivative_log_unnormalized_pdf(
+ const boost::math::exponential_distribution<T,P>& d,
+ const T& x
+ ){
+
+ BOOST_MATH_STD_USING // for ADL of std functions
+ // to keep width = 80 caracters
+ static const char* function = strcpy(
+ "boost::math::derivative_log_unnormalized_pdf(",
+ "const exponential_distribution<%1%>&,%1%)"
+ );
+
+ T lambda = d.lambda();
+ T result;
+ if(0 == boost::math::detail::verify_lambda(
+ function, lambda, &result, P()))
+ return result;
+ if(0 == boost::math::detail::verify_exp_x(
+ function, x, &result, P()))
+ return result;
+ result = (-lambda);
+ return result;
+ }
+
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/exponential/description.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/exponential/description.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,35 @@
+//////////////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::distributions::exponential::description.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_EXPONENTIAL_DESCRIPTION_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_EXPONENTIAL_DESCRIPTION_HPP_ER_2009
+#include <string>
+#include <boost/format.hpp>
+#include <boost/math/distributions/exponential.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+
+ template<typename T,typename P>
+ std::string
+ description(
+ const math::exponential_distribution<T,P>& dist
+ ){
+ static const char* msg = "exponential(%1%)";
+ format f(msg); f%dist.lambda();
+ return f.str();
+ }
+
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+
+#endif

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/exponential/include.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/exponential/include.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,20 @@
+//////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::map_pdf::distributions::exponential::include.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_EXPONENTIAL_INCLUDE_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_EXPONENTIAL_INCLUDE_HPP_ER_2009
+
+#include <boost/math/distributions/exponential.hpp>
+
+#include <boost/statistics/detail/distribution_toolkit/distributions/exponential/description.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/exponential/derivative_log_unnormalized_pdf.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/exponential/is_math_distribution.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/exponential/log_unnormalized_pdf.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/exponential/random.hpp>
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/exponential/is_math_distribution.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/exponential/is_math_distribution.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,31 @@
+//////////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::distributions::exponential::is_math_distribution.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_EXPONENTIAL_IS_MATH_DISTRIBUTION_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_EXPONENTIAL_IS_MATH_DISTRIBUTION_HPP_ER_2009
+#include <boost/mpl/bool.hpp>
+#include <boost/math/distributions/exponential.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/is_math_distribution.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+namespace meta{
+
+ template<typename T,typename P>
+ struct is_math_distribution< math::exponential_distribution<T,P> >
+ : mpl::bool_<true>{};
+
+}// meta
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+#endif
+

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/exponential/log_unnormalized_pdf.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/exponential/log_unnormalized_pdf.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,51 @@
+////////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::distributions::exponential::log_unnormalized_pdf.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_EXPONENTIAL_LOG_UNNORMALIZED_PDF_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_EXPONENTIAL_LOG_UNNORMALIZED_PDF_HPP_ER_2009
+#include <string>
+#include <boost/math/distributions/exponential.hpp>
+#include <boost/math/policies/policy.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+
+ template<typename T,typename P>
+ T
+ log_unnormalized_pdf(
+ const boost::math::exponential_distribution<T,P>& d,
+ const T& x
+ ){
+
+ typedef std::string str_;
+ BOOST_MATH_STD_USING // for ADL of std functions
+ static const str_ function =
+ str_("boost::math::log_unnormalized_pdf(")+
+ "const exponential_distribution<%1%>&,%1%)"
+ ;
+
+ T lambda = d.lambda();
+ T result;
+ if(0 == boost::math::detail::verify_lambda(
+ function, lambda, &result, P()))
+ return result;
+ if(0 == boost::math::detail::verify_exp_x(
+ function, x, &result, P()))
+ return result;
+ result = (-lambda * x);
+ return result;
+ }
+
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+
+#endif

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/exponential/random.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/exponential/random.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,37 @@
+/////////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::distributions::exponential::random.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_EXPONENTIAL_RANDOM_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_EXPONENTIAL_RANDOM_HPP_ER_2009
+#include <boost/math/distributions/exponential.hpp>
+#include <boost/random/exponential_distribution.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/random.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+namespace meta{
+
+ template<typename T,typename P>
+ struct random<
+ math::exponential_distribution<T,P>
+ >{
+ typedef math::exponential_distribution<T,P> dist_;
+ typedef boost::exponential_distribution<T> type;
+
+ static type make(const dist_& d){ return type(d.lambda()); }
+ };
+
+}// meta
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/gamma/derivative_log_unnormalized_pdf.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/gamma/derivative_log_unnormalized_pdf.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,55 @@
+//////////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::distributions::gamma::derivative::log_unnormalized_pdf //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_GAMMA_DERIVATIVE_LOG_UNNORMALIZED_PDF_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_GAMMA_DERIVATIVE_LOG_UNNORMALIZED_PDF_HPP_ER_2009
+#include <cmath>
+#include <boost/math/distributions/gamma.hpp>
+#include <boost/math/policies/policy.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+
+template <class T, class P>
+inline T derivative_log_unnormalized_pdf(
+ const boost::math::gamma_distribution<T, P>& dist,
+ const T& x
+)
+{
+ BOOST_MATH_STD_USING // for ADL of std functions
+
+ static const char* function
+ = "boost::math::log_unnormalized_pdf(const gamma_distribution<%1%>&, %1%)";
+
+ T shape = dist.shape();
+ T scale = dist.scale();
+
+ T result;
+ if(false == boost::math::detail::check_gamma(
+ function, scale, shape, &result, P()))
+ return result;
+ if(false == boost::math::detail::check_gamma_x(function, x, &result, P()))
+ return result;
+
+ if(x == 0)
+ {
+ return log(0);
+ }
+ static T one_ = static_cast<T>(1);
+ result = (shape - one_) / x - one_ / scale;
+ return result;
+} // derivative_log_unnormalized_pdf
+
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/gamma/description.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/gamma/description.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,34 @@
+//////////////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::distributions::gamma::description.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_GAMMA_DESCRIPTION_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_GAMMA_DESCRIPTION_HPP_ER_2009
+#include <string>
+#include <boost/format.hpp>
+#include <boost/math/distributions/gamma.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+
+ template<typename T,typename P>
+ std::string
+ description(const math::gamma_distribution<T,P>& dist)
+ {
+ static const char* msg = "gamma(%1%,%2%)";
+ format f(msg); f % dist.shape() % dist.scale();
+ return f.str();
+ }
+
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/gamma/include.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/gamma/include.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,21 @@
+//////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::map_pdf::distributions::gamma::include.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_GAMMA_INCLUDE_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_GAMMA_INCLUDE_HPP_ER_2009
+
+#include <boost/math/distributions/gamma.hpp>
+
+#include <boost/statistics/detail/distribution_toolkit/distributions/gamma/derivative_log_unnormalized_pdf.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/gamma/description.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/gamma/is_log_concave.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/gamma/is_math_distribution.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/gamma/log_unnormalized_pdf.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/gamma/random.hpp>
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/gamma/is_log_concave.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/gamma/is_log_concave.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,35 @@
+//////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::distributions::gamma::is_log_concave //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_GAMMA_IS_LOG_CONCAVE_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_GAMMA_IS_LOG_CONCAVE_HPP_ER_2009
+#include <cmath>
+#include <boost/math/distributions/gamma.hpp>
+#include <boost/math/policies/policy.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+
+template <class T, class P>
+inline bool is_log_concave(
+ const boost::math::gamma_distribution<T, P>& dist
+){
+ return ( dist.shape() > static_cast<T>(1) );
+}
+
+
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+
+#endif
+
+

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/gamma/is_math_distribution.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/gamma/is_math_distribution.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,30 @@
+//////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::distributions::gamma::is_math_distribution.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_GAMMA_IS_MATH_DISTRIBUTION_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_GAMMA_IS_MATH_DISTRIBUTION_HPP_ER_2009
+#include <boost/mpl/bool.hpp>
+#include <boost/math/distributions/gamma.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/is_math_distribution.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+namespace meta{
+
+ template<typename T,typename P>
+ struct is_math_distribution< math::gamma_distribution<T,P> >
+ : mpl::bool_<true>{};
+
+}// meta
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+#endif

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/gamma/log_unnormalized_pdf.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/gamma/log_unnormalized_pdf.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,55 @@
+//////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::distributions::gamma::log_unnormalized_pdf //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_GAMMA_LOG_UNNORMALIZED_PDF_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_GAMMA_LOG_UNNORMALIZED_PDF_HPP_ER_2009
+#include <cmath>
+#include <boost/math/distributions/gamma.hpp>
+#include <boost/math/policies/policy.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+
+template <class T, class P>
+inline T log_unnormalized_pdf(
+ const boost::math::gamma_distribution<T, P>& dist,
+ const T& x
+)
+{
+ BOOST_MATH_STD_USING // for ADL of std functions
+
+ static const char* function
+ = "boost::math::log_unnormalized_pdf(const gamma_distribution<%1%>&, %1%)";
+
+ T shape = dist.shape();
+ T scale = dist.scale();
+
+ T result;
+ if(false == boost::math::detail::check_gamma(
+ function, scale, shape, &result, P()))
+ return result;
+ if(false == boost::math::detail::check_gamma_x(function, x, &result, P()))
+ return result;
+
+ if(x == 0)
+ {
+ return log(0);
+ }
+ static T one_ = static_cast<T>(1);
+ result = (shape - one_) * log(x) - x / scale;
+ return result;
+} // log_unnormalized_pdf
+
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+
+#endif

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/gamma/random.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/gamma/random.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,45 @@
+/////////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::distributions::gamma::random.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_GAMMA_RANDOM_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_GAMMA_RANDOM_HPP_ER_2009
+#include <boost/math/distributions/gamma.hpp>
+#include <boost/random/gamma_distribution.hpp>
+#include <boost/random/location_scale.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/random.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+namespace meta{
+
+ template<typename T,typename P>
+ struct random<
+ math::gamma_distribution<T,P>
+ >{
+ typedef math::gamma_distribution<T,P> dist_;
+ typedef boost::gamma_distribution<T> z_;
+ typedef boost::random::location_scale_distribution<z_> type;
+
+ static type make(const dist_& d){
+ return type(
+ 0,
+ d.scale(),
+ z_(d.shape())
+ );
+ }
+ };
+
+}// meta
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/include.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/include.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,20 @@
+//////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::distributions::include.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_INCLUDE_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_INCLUDE_HPP_ER_2009
+
+#include <boost/statistics/detail/distribution_toolkit/distributions/chi_squared.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/exponential.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/gamma.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/location_scale.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/normal.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/students_t.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/uniform.hpp>
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/location_scale/cdf.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/location_scale/cdf.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,41 @@
+//////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::distributions::location_scale::cdf.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_LOCATION_SCALE_CDF_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_LOCATION_SCALE_CDF_HPP_ER_2009
+#include <boost/concept/assert.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/location_scale/location_scale.hpp>
+#include <boost/statistics/detail/distribution_toolkit/concept/cdf.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+
+ template<typename Z>
+ typename location_scale_distribution<Z>::value_type
+ cdf(
+ const location_scale_distribution<Z>& d,
+ const typename location_scale_distribution<Z>::value_type& x
+ ){
+ typedef typename
+ location_scale_distribution<Z>::value_type value_t;
+ value_t z = (x-d.mu())/d.sigma();
+ return cdf(
+ d.z(),
+ z
+ );
+ }
+
+
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/location_scale/description.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/location_scale/description.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,37 @@
+//////////////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::distributions::location_scale::description.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_LOCATION_SCALE_DESCRIPTION_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_LOCATION_SCALE_DESCRIPTION_HPP_ER_2009
+#include <string>
+#include <boost/format.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/location_scale/location_scale.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+
+ template<typename Z>
+ std::string
+ description(
+ const boost::statistics::detail::distribution_toolkit
+ ::location_scale_distribution<Z>& d
+ )
+ {
+ const char* msg = "location_scale_distribution( %1% + %2% %3%)";
+ format f(msg); f % d.mu() % d.sigma() % description(d.z());
+ return f.str();
+ }
+
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/location_scale/include.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/location_scale/include.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,24 @@
+//////////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::distributions::location_scale::include.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_LOCATION_SCALE_INCLUDE_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_LOCATION_SCALE_INCLUDE_HPP_ER_2009
+
+#include <boost/statistics/detail/distribution_toolkit/distributions/location_scale/cdf.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/location_scale/description.hpp>
+//#include <boost/statistics/detail/distribution_toolkit/distributions/location_scale/derivative_log_unnormalized_pdf.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/location_scale/is_scalar_distribution.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/location_scale/location_scale.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/location_scale/log_unnormalized_pdf.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/location_scale/mean.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/location_scale/pdf.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/location_scale/random.hpp>
+//#include <boost/statistics/detail/distribution_toolkit/distributions/location_scale/quantile.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/location_scale/variance.hpp>
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/location_scale/is_scalar_distribution.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/location_scale/is_scalar_distribution.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,31 @@
+//////////////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::distributions::location_scale::is_scalar_distribution.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_LOCATION_SCALE_IS_SCALAR_DISTRIBUTION_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_LOCATION_SCALE_IS_SCALAR_DISTRIBUTION_HPP_ER_2009
+#include <boost/mpl/bool.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/location_scale/location_scale.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/is_scalar_distribution.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+namespace meta{
+
+ template<typename Z>
+ struct is_scalar_distribution< location_scale_distribution<Z> >
+ : mpl::bool_<true>{};
+
+}// meta
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/location_scale/location_scale.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/location_scale/location_scale.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,118 @@
+//////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::distributions::location_scale::location_scale.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_LOCATION_SCALE_LOCATION_SCALE_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_LOCATION_SCALE_LOCATION_SCALE_HPP_ER_2009
+#include <vector>
+#include <algorithm>
+#include <iterator>
+#include <boost/mpl/assert.hpp>
+#include <boost/utility.hpp>
+#include <boost/type_traits.hpp> // remove_reference etc.
+#include <boost/range.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/inherit_policy.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/is_scalar_distribution.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/value.hpp>
+//#include <boost/math/policies/policy.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+
+ // Represents a location scale family
+ //
+ // X = mu + sigma * Z
+ // pdf_X(x) = (1/sigma) pdf_Z((x-mu)/sigma)
+ // cdf_X(x) = cdf_Z((x-mu)/sigma)
+ //
+ // TODO: range and support
+ template<typename Z>
+ class location_scale_distribution : public meta::inherit_policy<Z>{
+ public:
+
+ typedef Z distribution_type;
+
+ BOOST_MPL_ASSERT((
+ meta::is_scalar_distribution<Z>
+ ));
+
+ typedef typename meta::value<distribution_type>::type value_type;
+
+ location_scale_distribution();
+ location_scale_distribution(
+ value_type mu,
+ value_type sigma,
+ const Z& z
+ );
+
+ location_scale_distribution(const location_scale_distribution& that);
+
+ location_scale_distribution&
+ operator=(const location_scale_distribution& that);
+
+ value_type mu()const;
+ value_type sigma()const;
+
+ const Z& z()const;
+
+ private:
+ value_type mu_;
+ value_type sigma_;
+ Z z_;
+ };
+
+ // Implementation //
+
+ template<typename Z>
+ location_scale_distribution<Z>::location_scale_distribution()
+ :mu_(0),sigma_(1),z_(){}
+
+ template<typename Z>
+ location_scale_distribution<Z>::location_scale_distribution(
+ value_type mu,
+ value_type sigma,
+ const Z& z
+ ):mu_(mu),sigma_(sigma),z_(z){}
+
+ template<typename Z>
+ location_scale_distribution<Z>::location_scale_distribution(
+ const location_scale_distribution& that
+ ):mu_(that.mu_),sigma_(that.sigma_),z_(that.z_){}
+
+ template<typename Z>
+ location_scale_distribution<Z>&
+ location_scale_distribution<Z>::operator=(
+ const location_scale_distribution& that
+ ){
+ if(&that!=this){
+ mu_ = that.mu_;
+ sigma_ = that.sigma_;
+ z_ = that.z_;
+ }
+ return *this;
+ }
+
+ template<typename Z>
+ typename location_scale_distribution<Z>::value_type
+ location_scale_distribution<Z>::mu()const{ return this->mu_; }
+
+ template<typename Z>
+ typename location_scale_distribution<Z>::value_type
+ location_scale_distribution<Z>::sigma()const{ return this->sigma_; }
+
+ template<typename Z>
+ const Z&
+ location_scale_distribution<Z>::z()const{ return this->z_; }
+
+
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+#endif

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/location_scale/log_unnormalized_pdf.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/location_scale/log_unnormalized_pdf.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,43 @@
+///////////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::distributions::location_scale::log_unnormalized_pdf.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_LOCATION_SCALE_LOG_UNNORMALIZED_PDF_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_LOCATION_SCALE_LOG_UNNORMALIZED_PDF_HPP_ER_2009
+#include <boost/concept/assert.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/location_scale/location_scale.hpp>
+#include <boost/statistics/detail/distribution_toolkit/concept/log_unnormalized_pdf.hpp>
+
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+
+ template<typename Z>
+ typename location_scale_distribution<Z>::value_type
+ log_unnormalized_pdf(
+ const location_scale_distribution<Z>& d,
+ const typename location_scale_distribution<Z>::value_type& x
+ ){
+ typedef typename location_scale_distribution<Z>::value_type value_t;
+ value_t z = (x-d.mu())/d.sigma();
+ BOOST_CONCEPT_ASSERT((
+ concept::LogUnnormalizedPdf<Z>
+ ));
+ value_t result = log_unnormalized_pdf(d.z(),z);
+ // -log ( sigma ) is a constant so it is ignored
+ return result;
+ }
+
+
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/location_scale/mean.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/location_scale/mean.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,33 @@
+//////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::distributions::location_scale::mean.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_LOCATION_SCALE_MEAN_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_LOCATION_SCALE_MEAN_HPP_ER_2009
+#include <boost/concept/assert.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/location_scale/location_scale.hpp>
+#include <boost/statistics/detail/distribution_toolkit/concept/pdf.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+
+ template<typename Z>
+ typename location_scale_distribution<Z>::value_type
+ mean(
+ const location_scale_distribution<Z>& d
+ ){
+ return mean(d) + mean(d.z());
+ }
+
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+
+#endif

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/location_scale/pdf.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/location_scale/pdf.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,45 @@
+//////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::distributions::location_scale::pdf.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_LOCATION_SCALE_PDF_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_LOCATION_SCALE_PDF_HPP_ER_2009
+#include <boost/concept/assert.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/location_scale/location_scale.hpp>
+#include <boost/statistics/detail/distribution_toolkit/concept/pdf.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+
+ template<typename Z>
+ typename location_scale_distribution<Z>::value_type
+ pdf(
+ const location_scale_distribution<Z>& d,
+ const typename
+ location_scale_distribution<Z>::value_type& x
+ ){
+ typedef typename
+ location_scale_distribution<Z>::value_type value_t;
+ value_t z = (x-d.mu())/d.sigma();
+
+ BOOST_CONCEPT_ASSERT((
+ concept::Pdf<Z>
+ ));
+
+ value_t result = pdf(d.z(),z);
+ result /= d.sigma();
+ return result;
+ }
+
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/location_scale/random.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/location_scale/random.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,46 @@
+/////////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::distributions::location_scale::random.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_LOCATION_SCALE_RANDOM_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_LOCATION_SCALE_RANDOM_HPP_ER_2009
+#include <boost/statistics/detail/distribution_toolkit/distributions/location_scale/location_scale.hpp>
+#include <boost/random/location_scale.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/random.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+namespace meta{
+
+
+ template<typename Z>
+ struct random<
+ location_scale_distribution<Z>
+ >{
+ typedef location_scale_distribution<Z> dist_;
+ typedef typename meta::random<Z>::type z_;
+ typedef boost::random::location_scale_distribution<z_> type;
+
+ static type make(const dist_& d){
+ return type(
+ d.mu(),
+ d.sigma(),
+ make_random(d.z())
+ );
+ }
+ };
+
+
+}// meta
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/location_scale/variance.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/location_scale/variance.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,33 @@
+//////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::distributions::location_scale::variance.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_LOCATION_SCALE_VARIANCE_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_LOCATION_SCALE_VARIANCE_HPP_ER_2009
+#include <boost/concept/assert.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/location_scale/location_scale.hpp>
+#include <boost/statistics/detail/distribution_toolkit/concept/pdf.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+
+ template<typename Z>
+ typename location_scale_distribution<Z>::value_type
+ variance(
+ const location_scale_distribution<Z>& d
+ ){
+ return variance(d.z()) * d.sigma() * d.sigma();
+ }
+
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/normal/derivative_log_unnormalized_pdf.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/normal/derivative_log_unnormalized_pdf.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,40 @@
+//////////////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::distributions::normal::derivative_log_unnormalized_pdf.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_NORMAL_DERIVATIVE_LOG_UNNORMALIZED_PDF_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_NORMAL_DERIVATIVE_LOG_UNNORMALIZED_PDF_HPP_ER_2009
+#include <boost/math/distributions/normal.hpp>
+#include <boost/numeric/conversion/converter.hpp>
+//#include <boost/math/policies/policy.hpp>//TODO
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+
+ template<typename T,typename P>
+ T
+ derivative_log_unnormalized_pdf(
+ const boost::math::normal_distribution<T,P>& d,
+ const T& x
+ ){
+ typedef boost::numeric::converter<T,int> int2real_t;
+ T mu = d.location();
+ T sigma = d.scale();
+
+ T z = (x-mu)/sigma;
+ T dz = int2real_t::convert(1)/sigma;
+ return (- z) * dz;
+ }
+
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/normal/description.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/normal/description.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,34 @@
+//////////////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::distributions::normal::description.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_NORMAL_DESCRIPTION_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_NORMAL_DESCRIPTION_HPP_ER_2009
+#include <ostream>
+#include <boost/format.hpp>
+#include <boost/math/distributions/normal.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+
+ template<typename T,typename P>
+ std::string
+ description(const math::normal_distribution<T,P>& dist)
+ {
+ static const char* msg = "normal(%1%,%2%)";
+ format f(msg); f % dist.location() % dist.scale();
+ return f.str();
+ }
+
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/normal/include.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/normal/include.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,21 @@
+//////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::map_pdf::distributions::normal::include.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_NORMAL_INCLUDE_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_NORMAL_INCLUDE_HPP_ER_2009
+
+#include <boost/math/distributions/normal.hpp>
+
+#include <boost/statistics/detail/distribution_toolkit/distributions/normal/description.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/normal/derivative_log_unnormalized_pdf.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/normal/log_unnormalized_pdf.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/normal/is_math_distribution.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/normal/normalizing_constant.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/normal/random.hpp>
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/normal/is_math_distribution.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/normal/is_math_distribution.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,31 @@
+//////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::distributions::normal::is_math_distribution.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_NORMAL_IS_MATH_DISTRIBUTION_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_NORMAL_IS_MATH_DISTRIBUTION_HPP_ER_2009
+#include <boost/mpl/bool.hpp>
+#include <boost/math/distributions/normal.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/is_math_distribution.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+namespace meta{
+
+ template<typename T,typename P>
+ struct is_math_distribution< math::normal_distribution<T,P> >
+ : mpl::bool_<true>{};
+
+}// meta
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+
+#endif

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/normal/log_unnormalized_pdf.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/normal/log_unnormalized_pdf.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,42 @@
+//////////////////////////////////////////////////////////////////////////////
+// distributions::normal::log_unnormalized_pdf.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_NORMAL_LOG_UNNORMALIZED_PDF_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_NORMAL_LOG_UNNORMALIZED_PDF_HPP_ER_2009
+#include <boost/math/distributions/normal.hpp>
+#include <boost/numeric/conversion/converter.hpp>
+//#include <boost/math/policies/policy.hpp>//TODO
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+
+ // If only the unnormalized_pdf is required, this is supposed to
+ // be faster than log(pdf(D,x))
+
+ template<typename T,typename P>
+ T
+ log_unnormalized_pdf(
+ const boost::math::normal_distribution<T,P>& d,
+ const T& x
+ ){
+ typedef boost::numeric::converter<T,int> int2real_t;
+ T mu = d.location();
+ T sigma = d.scale();
+
+ T z = (x-mu)/sigma;
+ return - z * z / int2real_t::convert(2);
+ }
+
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+
+#endif

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/normal/normalizing_constant.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/normal/normalizing_constant.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,32 @@
+///////////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::detail::distributions::normal::normalizing_constant.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_NORMAL_NORMALIZING_CONSTANT_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_NORMAL_NORMALIZING_CONSTANT_HPP_ER_2009
+#include <cmath>
+#include <boost/math/constants/constants.hpp>
+#include <boost/math/distributions/normal.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+
+template<typename T,typename P>
+T normalizing_constant(const boost::math::normal_distribution<T,P>& d){
+ static T pi = boost::math::constants::pi<T>;
+ static T two = static_cast<T>(2);
+ return sqrt(two * pi) * d.scale();
+}
+
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/normal/random.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/normal/random.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,39 @@
+/////////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::distributions::normal::random.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_NORMAL_RANDOM_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_NORMAL_RANDOM_HPP_ER_2009
+#include <boost/math/distributions/normal.hpp>
+#include <boost/random/normal_distribution.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/random.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+namespace meta{
+
+ template<typename T,typename P>
+ struct random<
+ math::normal_distribution<T,P>
+ >{
+ typedef math::normal_distribution<T,P> dist_;
+ typedef boost::normal_distribution<T> type;
+
+ static type make(const dist_& d){
+ return type(d.location(),d.scale());
+ }
+ };
+
+}// meta
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+
+#endif

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/students_t/derivative_log_unnormalized_pdf.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/students_t/derivative_log_unnormalized_pdf.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,44 @@
+//////////////////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::distributions::students_t::derivative_log_unnormalized_pdf.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_STUDENTS_T_DERIVATIVE_LOG_UNNORMALIZED_PDF_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_STUDENTS_T_DERIVATIVE_LOG_UNNORMALIZED_PDF_HPP_ER_2009
+#include <boost/math/distributions/students_t.hpp>
+#include <boost/math/special_functions/log1p.hpp>
+#include <boost/numeric/conversion/converter.hpp>
+// #include <boost/math/policies/policy.hpp> // TODO
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+
+ template<typename T,typename Policy>
+ T
+ derivative_log_unnormalized_pdf(
+ const boost::math::students_t_distribution<T,Policy>& d,
+ const T& x
+ ){
+ typedef boost::numeric::converter<T,int> int2R_t;
+
+ T r1 = int2R_t::convert(1);
+ T r2 = int2R_t::convert(2);
+ T nu = d.degrees_of_freedom();
+ T m = ( nu + r1 ) / r2;
+ T y = ( x * x ) / nu;
+ T dy = int2R_t::convert(2) * x / nu;
+ T dlog1p = int2R_t::convert(1) / ( 1 + y );
+ return (- m ) * dlog1p * dy;
+ }
+
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/students_t/description.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/students_t/description.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,34 @@
+//////////////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::distributions::students_t::description.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_STUDENTS_T_DESCRIPTION_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_STUDENTS_T_DESCRIPTION_HPP_ER_2009
+#include <string>
+#include <boost/format.hpp>
+#include <boost/math/distributions/students_t.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+
+ template<typename T,typename P>
+ std::string
+ description(const math::students_t_distribution<T,P>& dist)
+ {
+ static const char* msg = "students_t(%1%)";
+ format f(msg); f%dist.degrees_of_freedom();
+ return f.str();
+ }
+
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/students_t/include.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/students_t/include.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,19 @@
+//////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::map_pdf::distributions::students_t::include.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_STUDENTS_T_INCLUDE_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_STUDENTS_T_INCLUDE_HPP_ER_2009
+
+#include <boost/math/distributions/students_t.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/students_t/description.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/students_t/derivative_log_unnormalized_pdf.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/students_t/is_math_distribution.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/students_t/log_unnormalized_pdf.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/students_t/random.hpp>
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/students_t/is_math_distribution.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/students_t/is_math_distribution.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,31 @@
+//////////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::distributions::students_t::is_math_distribution.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_STUDENTS_T_IS_MATH_DISTRIBUTION_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_STUDENTS_T_IS_MATH_DISTRIBUTION_HPP_ER_2009
+#include <boost/mpl/bool.hpp>
+#include <boost/math/distributions/students_t.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/is_scalar_distribution.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+namespace meta{
+
+ template<typename T,typename P>
+ struct is_math_distribution< math::students_t_distribution<T,P> >
+ : mpl::bool_<true>{};
+
+}// meta
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+
+#endif

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/students_t/log_unnormalized_pdf.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/students_t/log_unnormalized_pdf.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,44 @@
+//////////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::distributions::students_t::log_unnormalized_pdf.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_STUDENTS_T_LOG_UNNORMALIZED_PDF_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_STUDENTS_T_LOG_UNNORMALIZED_PDF_HPP_ER_2009
+#include <boost/math/distributions/students_t.hpp>
+#include <boost/math/special_functions/log1p.hpp>
+#include <boost/numeric/conversion/converter.hpp>
+// #include <boost/math/policies/policy.hpp> // TODO
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+
+ template<typename T,typename Policy>
+ T
+ log_unnormalized_pdf(
+ const boost::math::students_t_distribution<T,Policy>& d,
+ const T& x
+ ){
+
+ typedef boost::numeric::converter<T,int> int2R_t;
+
+ T r1 = int2R_t::convert(1);
+ T r2 = int2R_t::convert(2);
+
+ T nu = d.degrees_of_freedom();
+ T m = ( nu + r1 ) / r2;
+ T y = ( x * x ) / nu;
+ return (- m ) * math::log1p(y);
+ }
+
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+
+#endif

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/students_t/random.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/students_t/random.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,39 @@
+/////////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::distributions::students_t::random.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_STUDENTS_T_RANDOM_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_STUDENTS_T_RANDOM_HPP_ER_2009
+#include <boost/math/distributions/students_t.hpp>
+#include <boost/random/students_t.hpp> // sandbox/statistics/random
+#include <boost/statistics/detail/distribution_toolkit/meta/random.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+namespace meta{
+
+ template<typename T,typename P>
+ struct random<
+ boost::math::students_t_distribution<T,P>
+ >{
+ typedef boost::math::students_t_distribution<T,P> dist_;
+ typedef boost::random::students_t_distribution<T> type;
+
+ static type make(const dist_& d){
+ return type(d.degrees_of_freedom());
+ }
+ };
+
+}// meta
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/uniform/derivative_log_unnormalized_pdf.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/uniform/derivative_log_unnormalized_pdf.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,62 @@
+//////////////////////////////////////////////////////////////////////////////
+// distributions::unnormalized_pdf::uniform.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_UNIFORM_DERIVATIVE_LOG_UNNORMALIZED_PDF_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_UNIFORM_DERIVATIVE_LOG_UNNORMALIZED_PDF_HPP_ER_2009
+#include <boost/math/distributions/uniform.hpp>
+#include <boost/math/special_functions/log1p.hpp>
+#include <boost/numeric/conversion/converter.hpp>
+#include <boost/math/policies/policy.hpp>
+#include <boost/math/tools/precision.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+
+
+ template<typename T,typename P>
+ T
+ derivative_log_unnormalized_pdf(
+ const boost::math::uniform_distribution<T,P>& dist,
+ const T& x
+ ){
+ T lower = dist.lower();
+ T upper = dist.upper();
+ T result; // of checks.
+ if(false == math::detail::check_uniform(
+ "boost::math::pdf(const uniform_distribution<%1%>&, %1%)",
+ lower, upper, &result, P()))
+ {
+ return result;
+ }
+ if(false == math::detail::check_uniform_x(
+ "boost::math::pdf(const uniform_distribution<%1%>&, %1%)",
+ x, &result, P()))
+ {
+ return result;
+ }
+
+ if((x < lower) || (x > upper) )
+ {
+ // TODO. Makes sense?
+ static T inf = std::numeric_limits<T>::infinity();
+ return (- inf);
+ }
+ else
+ {
+ return static_cast<T>(0);
+ }
+ }
+
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/uniform/description.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/uniform/description.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,34 @@
+//////////////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::distributions::uniform::description.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_UNIFORM_DESCRIPTION_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_UNIFORM_DESCRIPTION_HPP_ER_2009
+#include <string>
+#include <boost/format.hpp>
+#include <boost/math/distributions/uniform.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+
+ template<typename T,typename P>
+ std::string
+ description(const math::uniform_distribution<T,P>& dist)
+ {
+ static const char* msg = "uniform(%1%,%2%)";
+ format f(msg); f%dist.lower()%dist.upper();
+ return (f.str());
+ }
+
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/uniform/include.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/uniform/include.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,16 @@
+//////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::map_pdf::distributions::uniform::include.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_UNIFORM_INCLUDE_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_UNIFORM_INCLUDE_HPP_ER_2009
+
+#include <boost/math/distributions/uniform.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/uniform/is_math_distribution.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/uniform/log_unnormalized_pdf.hpp>
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/uniform/is_math_distribution.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/uniform/is_math_distribution.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,31 @@
+//////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::distributions::uniform::is_math_distribution.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_UNIFORM_IS_MATH_DISTRIBUTION_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_UNIFORM_IS_MATH_DISTRIBUTION_HPP_ER_2009
+#include <boost/mpl/bool.hpp>
+#include <boost/math/distributions/uniform.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/is_scalar_distribution.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+namespace meta{
+
+ template<typename T,typename P>
+ struct is_math_distribution< math::uniform_distribution<T,P> >
+ : mpl::bool_<true>{};
+
+}// meta
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/uniform/log_unnormalized_pdf.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/uniform/log_unnormalized_pdf.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,61 @@
+//////////////////////////////////////////////////////////////////////////////
+// distributions::unnormalized_pdf::uniform.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_UNIFORM_LOG_UNNORMALIZED_PDF_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_UNIFORM_LOG_UNNORMALIZED_PDF_HPP_ER_2009
+#include <boost/math/distributions/uniform.hpp>
+#include <boost/math/special_functions/log1p.hpp>
+#include <boost/numeric/conversion/converter.hpp>
+#include <boost/math/policies/policy.hpp>
+#include <boost/math/tools/precision.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+
+ template<typename T,typename P>
+ T
+ log_unnormalized_pdf(
+ const boost::math::uniform_distribution<T,P>& dist,
+ const T& x
+ )
+ {
+ T lower = dist.lower();
+ T upper = dist.upper();
+ T result; // of checks.
+ if(false == math::detail::check_uniform(
+ "boost::math::pdf(const uniform_distribution<%1%>&, %1%)",
+ lower, upper, &result, P()))
+ {
+ return result;
+ }
+ if(false == math::detail::check_uniform_x(
+ "boost::math::pdf(const uniform_distribution<%1%>&, %1%)",
+ x, &result, P()))
+ {
+ return result;
+ }
+
+ if((x < lower) || (x > upper) )
+ {
+ static T inf = std::numeric_limits<T>::infinity();
+ return (- inf);
+ }
+ else
+ {
+ return static_cast<T>(0);
+ }
+ }
+
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/wrapper/cdf.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/wrapper/cdf.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,41 @@
+/////////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::distributions::wrapper::cdf.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_WRAPPER_CDF_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_WRAPPER_CDF_HPP_ER_2009
+#include <boost/concept/assert.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/value.hpp>
+#include <boost/statistics/detail/distribution_toolkit/concept/cdf.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/wrapper/wrapper.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+
+ template<typename D>
+ typename meta::value< wrapper<D> >::type
+ cdf(
+ const wrapper<D>& w,
+ typename meta::value< wrapper<D> >::type x
+ ){
+ typedef wrapper<D> w_;
+ typedef typename w_::distribution_type d_;
+ BOOST_CONCEPT_ASSERT((
+ concept::Cdf<d_>
+ ));
+
+ return cdf(w.const_reference(),x);
+ }
+
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/wrapper/derivative_log_unnormalized_pdf.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/wrapper/derivative_log_unnormalized_pdf.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,41 @@
+///////////////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::distributions::wrapper::derivative_log_unnormalized_pdf.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_WRAPPER_DERIVATIVE_LOG_UNNORMALIZED_PDF_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_WRAPPER_DERIVATIVE_LOG_UNNORMALIZED_PDF_HPP_ER_2009
+#include <boost/concept/assert.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/value.hpp>
+#include <boost/statistics/detail/distribution_toolkit/concept/derivative_log_unnormalized_pdf.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/wrapper/wrapper.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+
+ template<typename D>
+ typename meta::value< wrapper<D> >::type
+ derivative_log_unnormalized_pdf(
+ const wrapper<D>& w,
+ typename meta::value< wrapper<D> >::type x
+ ){
+ typedef wrapper<D> w_;
+ typedef typename w_::distribution_type d_;
+ BOOST_CONCEPT_ASSERT((
+ concept::DerivativeLogUnnormalizedPdf<d_>
+ ));
+
+ return derivative_log_unnormalized_pdf(w.const_reference(),x);
+ }
+
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/wrapper/description.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/wrapper/description.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,35 @@
+//////////////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::distributions::wrapper::description.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_WRAPPER_DESCRIPTION_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_WRAPPER_DESCRIPTION_HPP_ER_2009
+#include <string>
+#include <boost/format.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/wrapper/wrapper.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+
+ template<typename D>
+ std::string
+ description(const wrapper<D>& w)
+ {
+ static const char* msg = "wrapper(%1%)";
+ format f(msg); f % description(w.const_reference());
+ return f.str();
+ }
+
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/wrapper/include.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/wrapper/include.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,26 @@
+/////////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::distributions::wrapper::include.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_WRAPPER_INCLUDE_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_WRAPPER_INCLUDE_HPP_ER_2009
+
+#include <boost/statistics/detail/distribution_toolkit/distributions/wrapper/cdf.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/wrapper/derivative_log_unnormalized_pdf.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/wrapper/description.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/wrapper/is_pseudo_scalar_distribution.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/wrapper/is_scalar_distribution.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/wrapper/log_unnormalized_pdf.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/wrapper/mean.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/wrapper/normalizing_constant.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/wrapper/pdf.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/wrapper/quantile.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/wrapper/random.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/wrapper/variance.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/wrapper/wrapper.hpp>
+
+#endif

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/wrapper/is_pseudo_scalar_distribution.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/wrapper/is_pseudo_scalar_distribution.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,36 @@
+/////////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::distributions::wrapper::is_pseudo_scalar_distribution.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_WRAPPER_IS_PSEUDO_SCALAR_DISTRIBUTION_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_WRAPPER_IS_PSEUDO_SCALAR_DISTRIBUTION_HPP_ER_2009
+#include <boost/statistics/detail/distribution_toolkit/meta/is_pseudo_scalar_distribution.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/wrapper/wrapper.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+namespace meta{
+
+ template<typename D>
+ struct is_pseudo_scalar_distribution< wrapper<D> >
+ {
+
+ typedef wrapper<D> w_;
+ typedef typename w_::distribution_type d_;
+ typedef typename is_pseudo_scalar_distribution<d_>::type type;
+
+ };
+
+}// meta
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/wrapper/is_scalar_distribution.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/wrapper/is_scalar_distribution.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,36 @@
+/////////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::distributions::wrapper::is_scalar_distribution.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_WRAPPER_IS_SCALAR_DISTRIBUTION_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_WRAPPER_IS_SCALAR_DISTRIBUTION_HPP_ER_2009
+#include <boost/statistics/detail/distribution_toolkit/meta/is_scalar_distribution.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/wrapper/wrapper.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+namespace meta{
+
+ template<typename D>
+ struct is_scalar_distribution< wrapper<D> >
+ {
+
+ typedef wrapper<D> w_;
+ typedef typename w_::distribution_type d_;
+ typedef typename is_scalar_distribution<d_>::type type;
+
+ };
+
+}// meta
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/wrapper/log_unnormalized_pdf.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/wrapper/log_unnormalized_pdf.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,40 @@
+/////////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::distributions::wrapper::log_unnormalized_pdf.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_WRAPPER_LOG_UNNORMALIZED_PDF_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_WRAPPER_LOG_UNNORMALIZED_PDF_HPP_ER_2009
+#include <boost/concept/assert.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/value.hpp>
+#include <boost/statistics/detail/distribution_toolkit/concept/log_unnormalized_pdf.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/wrapper/wrapper.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+
+ template<typename D>
+ typename meta::value< wrapper<D> >::type
+ log_unnormalized_pdf(
+ const wrapper<D>& w,
+ typename meta::value< wrapper<D> >::type x
+ ){
+ typedef wrapper<D> w_;
+ typedef typename w_::distribution_type d_;
+ BOOST_CONCEPT_ASSERT((
+ concept::LogUnnormalizedPdf<d_>
+ ));
+ return log_unnormalized_pdf(w.const_reference(),x);
+ }
+
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/wrapper/mean.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/wrapper/mean.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,40 @@
+/////////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::distributions::wrapper::mean.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_WRAPPER_MEAN_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_WRAPPER_MEAN_HPP_ER_2009
+#include <boost/concept/assert.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/value.hpp>
+#include <boost/statistics/detail/distribution_toolkit/concept/mean.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/wrapper/wrapper.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+
+ template<typename D>
+ typename meta::value< wrapper<D> >::type
+ mean(
+ const wrapper<D>& w
+ ){
+ typedef wrapper<D> w_;
+ typedef typename w_::distribution_type d_;
+ BOOST_CONCEPT_ASSERT((
+ concept::Mean<d_>
+ ));
+
+ return mean(w.const_reference());
+ }
+
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/wrapper/normalizing_constant.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/wrapper/normalizing_constant.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,40 @@
+/////////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::distributions::wrapper::normalizing_constant.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_WRAPPER_NORMALIZING_CONSTANT_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_WRAPPER_NORMALIZING_CONSTANT_HPP_ER_2009
+#include <boost/concept/assert.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/value.hpp>
+#include <boost/statistics/detail/distribution_toolkit/concept/normalizing_constant.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/wrapper/wrapper.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+
+ template<typename D>
+ typename meta::value< wrapper<D> >::type
+ normalizing_constant(
+ const wrapper<D>& w
+ ){
+ typedef wrapper<D> w_;
+ typedef typename w_::distribution_type d_;
+ BOOST_CONCEPT_ASSERT((
+ concept::NormalizingConstant<d_>
+ ));
+
+ return normalizing_constant(w.const_reference());
+ }
+
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/wrapper/pdf.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/wrapper/pdf.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,41 @@
+/////////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::distributions::wrapper::pdf.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_WRAPPER_PDF_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_WRAPPER_PDF_HPP_ER_2009
+#include <boost/concept/assert.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/value.hpp>
+#include <boost/statistics/detail/distribution_toolkit/concept/pdf.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/wrapper/wrapper.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+
+ template<typename D>
+ typename meta::value< wrapper<D> >::type
+ pdf(
+ const wrapper<D>& w,
+ typename meta::value< wrapper<D> >::type x
+ ){
+ typedef wrapper<D> w_;
+ typedef typename w_::distribution_type d_;
+ BOOST_CONCEPT_ASSERT((
+ concept::Pdf<d_>
+ ));
+
+ return pdf(w.const_reference(),x);
+ }
+
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/wrapper/quantile.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/wrapper/quantile.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,41 @@
+/////////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::distributions::wrapper::quantile.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_WRAPPER_CDF_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_WRAPPER_CDF_HPP_ER_2009
+#include <boost/concept/assert.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/value.hpp>
+#include <boost/statistics/detail/distribution_toolkit/concept/quantile.hpp>
+#include <boost/statistics/detail/distribution_toolkit/wrapper/wrapper.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+
+ template<typename D>
+ typename meta::value< wrapper<D> >::type
+ quantile(
+ const wrapper<D>& w,
+ typename meta::value< wrapper<D> >::type x
+ ){
+ typedef wrapper<D> w_;
+ typedef typename w_::distribution_type d_;
+ BOOST_CONCEPT_ASSERT((
+ concept::Quantile<d_>
+ ));
+
+ return quantile(w.const_reference(),x);
+ }
+
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/wrapper/random.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/wrapper/random.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,41 @@
+/////////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::distributions::wrapper::random.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_WRAPPER_RANDOM_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_WRAPPER_RANDOM_HPP_ER_2009
+#include <boost/statistics/detail/distribution_toolkit/distributions/wrapper/wrapper.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/random.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+namespace meta{
+
+ template<typename D>
+ struct random<
+ wrapper<D>
+ >{
+ typedef wrapper<D> w_;
+ typedef typename w_::distribution_type d_;
+ typedef typename meta::random<d_>::type type;
+
+ static type make(const w_& d){
+ return type(
+ make_random(d.const_reference())
+ );
+ }
+ };
+
+}// meta
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/wrapper/variance.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/wrapper/variance.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,40 @@
+/////////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::distributions::wrapper::variance.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_WRAPPER_VARIANCE_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_WRAPPER_VARIANCE_HPP_ER_2009
+#include <boost/concept/assert.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/value.hpp>
+#include <boost/statistics/detail/distribution_toolkit/concept/variance.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/wrapper/wrapper.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+
+ template<typename D>
+ typename meta::value< wrapper<D> >::type
+ variance(
+ const wrapper<D>& w
+ ){
+ typedef wrapper<D> w_;
+ typedef typename w_::distribution_type d_;
+ BOOST_CONCEPT_ASSERT((
+ concept::Variance<d_>
+ ));
+
+ return variance(w.const_reference());
+ }
+
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/wrapper/wrapper.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/distributions/wrapper/wrapper.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,76 @@
+/////////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::distributions::wrapper::wrapper.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_WRAPPER_WRAPPER_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_WRAPPER_WRAPPER_HPP_ER_2009
+#include <boost/call_traits.hpp>
+#include <boost/type_traits.hpp>
+#include <boost/mpl/assert.hpp>
+#include <boost/mpl/not.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/inherit_policy.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/value.hpp>
+#include <boost/archive/text_oarchive.hpp>
+#include <boost/archive/text_iarchive.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+
+ // Useful for serializing or as a reference wrapper (D = const E&)
+ //
+ // BUG : See example::distribution_function
+ template<typename D>
+ class wrapper : meta::inherit_policy<
+ typename remove_cv<
+ typename remove_reference<D>::type
+ >::type
+ >{
+ public:
+
+ typedef typename remove_cv<
+ typename remove_reference<D>::type
+ >::type distribution_type;
+
+ typedef typename meta::value<distribution_type>::type value_type;
+
+ wrapper(typename call_traits<D>::param_type d):d_(d){}
+
+ typename call_traits<D>::const_reference
+ const_reference()const{ return this->d_; }
+
+ operator distribution_type ()const{ return this->d_; }
+
+ private:
+
+ template<class A>
+ void serialize(
+ A & ar,
+ const unsigned int version
+ )
+ {
+ BOOST_MPL_ASSERT((
+ mpl::not_<
+ is_reference<D>
+ >
+ ));
+
+ ar & d_;
+ }
+
+ typename call_traits<D>::value_type d_;
+ };
+
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+
+#endif
+
+

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/fun_wrap/cdf.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/fun_wrap/cdf.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,32 @@
+//////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::fun_wrap::cdf.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_FUN_WRAP_CDF_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_FUN_WRAP_CDF_HPP_ER_2009
+#include <boost/statistics/detail/distribution_toolkit/fun_wrap/detail/impl.hpp>
+
+namespace boost{
+
+namespace math{
+ template<typename T,typename D> T cdf(const D& d,const T& x);
+}
+
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+namespace fun_wrap{
+ template<typename D> struct cdf_
+ : impl<D,math::cdf>{};
+}
+
+}
+}// detail
+}// statistics
+}// boost
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/fun_wrap/detail/impl.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/fun_wrap/detail/impl.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,35 @@
+//////////////////////////////////////////////////////////////////////////////
+// distribution_toolkitfun_wrap::detail::fun_wrap.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_FUN_WRAP_DETAIL_IMPL_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_FUN_WRAP_DETAIL_IMPL_HPP_ER_2009
+#include <boost/statistics/detail/distribution_toolkit/meta/pointer.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+namespace fun_wrap{
+
+ template<typename D,typename meta::pointer<D>::type f>
+ struct impl{
+ typedef typename meta::pointer<D>::type type;
+ static type instance;
+ };
+
+ template<typename D,typename meta::pointer<D>::type f>
+ typename impl<D,f>::type
+ impl<D,f>::instance = f;
+
+}// fun_wrap
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+
+#endif

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/fun_wrap/include.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/fun_wrap/include.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,18 @@
+//////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::fun_wrap::include.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_FUN_WRAP_INCLUDE_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_FUN_WRAP_INCLUDE_HPP_ER_2009
+
+#include <boost/statistics/detail/distribution_toolkit/fun_wrap/cdf.hpp>
+#include <boost/statistics/detail/distribution_toolkit/fun_wrap/log_unnormalized_pdf.hpp>
+#include <boost/statistics/detail/distribution_toolkit/fun_wrap/pdf.hpp>
+#include <boost/statistics/detail/distribution_toolkit/fun_wrap/quantile.hpp>
+#include <boost/statistics/detail/distribution_toolkit/fun_wrap/unnormalized_pdf.hpp>
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/fun_wrap/log_unnormalized_pdf.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/fun_wrap/log_unnormalized_pdf.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,33 @@
+//////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::fun_wrap::detail::log_unnormalized_pdf.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_FUN_WRAP_LOG_UNNORMALIZED_PDF_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_FUN_WRAP_LOG_UNNORMALIZED_PDF_HPP_ER_2009
+#include <boost/statistics/detail/distribution_toolkit/fun_wrap/detail/impl.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+
+ template<typename T,typename D>
+ T log_unnormalized_pdf(const D& d,const T& x);
+
+namespace fun_wrap{
+
+ template<typename D>
+ struct log_unnormalized_pdf_
+ : impl<D,log_unnormalized_pdf>{};
+
+}// fun_wrap
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+
+#endif

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/fun_wrap/pdf.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/fun_wrap/pdf.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,32 @@
+//////////////////////////////////////////////////////////////////////////////
+// distribution_toolkitfun_wrap::pdf.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_FUN_WRAP_PDF_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_FUN_WRAP_PDF_HPP_ER_2009
+#include <boost/statistics/detail/distribution_toolkit/fun_wrap/detail/impl.hpp>
+
+namespace boost{
+
+namespace math{
+ template<typename T,typename D> T pdf(const D& d,const T& x);
+}
+
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+namespace fun_wrap{
+
+ template<typename D> struct pdf_ : impl<D,math::pdf>{};
+
+}// fun_wrap
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/fun_wrap/quantile.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/fun_wrap/quantile.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,34 @@
+//////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::fun_wrap::quantile.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_FUN_WRAP_QUANTILE_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_FUN_WRAP_QUANTILE_HPP_ER_2009
+#include <boost/statistics/detail/distribution_toolkit/fun_wrap/detail/impl.hpp>
+
+namespace boost{
+namespace math{
+
+ template<typename T,typename D> T quantile(const D& d,const T& x);
+
+}
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+namespace fun_wrap{
+
+ template<typename D>
+ struct quantile_
+ : impl<D,math::quantile>{};
+
+}// fun_wrap
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/fun_wrap/unnormalized_pdf.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/fun_wrap/unnormalized_pdf.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,30 @@
+//////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::fun_wrap::detail::log_unnormalized_pdf.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_FUN_WRAP_UNNORMALIZED_PDF_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_FUN_WRAP_UNNORMALIZED_PDF_HPP_ER_2009
+//#include <boost/standard_distribution/unnormalized_pdf/unnormalized_pdf.hpp>
+//#include <boost/statistics/detail/distribution_toolkit/fun_wrap/detail/impl.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+namespace fun_wrap{
+
+// template<typename D>
+// struct unnormalized_pdf_
+// : impl<D,math::unnormalized_pdf>{};
+
+}// fun_wrap
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+
+#endif

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/fwd_math/cdf.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/fwd_math/cdf.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,36 @@
+//////////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::fwd_math::cdf.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_FWD_MATH_CDF_HPP_ER_2009
+#define BOOST_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_FWD_MATH_CDF_HPP_ER_2009
+#include <boost/utility/enable_if.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/is_math_distribution.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+
+ template<typename D>
+ typename lazy_enable_if<
+ meta::is_math_distribution<D>,
+ meta::value<D>
+ >::type
+ cdf(const D& dist,const typename meta::value<D>::type x)
+ {
+ return boost::math::cdf(dist,x);
+ }
+
+
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/fwd_math/include.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/fwd_math/include.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,18 @@
+//////////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::fwd_math::inlcude.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_FWD_MATH_INCLUDE_HPP_ER_2009
+#define BOOST_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_FWD_MATH_INCLUDE_HPP_ER_2009
+
+#include <boost/statistics/detail/distribution_toolkit/meta/fwd_math/cdf.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/fwd_math/pdf.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/fwd_math/quantile.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/fwd_math/mean.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/fwd_math/variance.hpp>
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/fwd_math/mean.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/fwd_math/mean.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,36 @@
+//////////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::fwd_math::mean.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_FWD_MATH_MEAN_HPP_ER_2009
+#define BOOST_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_FWD_MATH_MEAN_HPP_ER_2009
+#include <boost/utility/enable_if.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/is_math_distribution.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+
+ template<typename D>
+ typename lazy_enable_if<
+ meta::is_math_distribution<D>,
+ meta::value<D>
+ >::type
+ mean(const D& dist)
+ {
+ return boost::math::mean(dist);
+ }
+
+
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/fwd_math/pdf.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/fwd_math/pdf.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,38 @@
+//////////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::fwd_math::pdf.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_FWD_MATH_PDF_HPP_ER_2009
+#define BOOST_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_FWD_MATH_PDF_HPP_ER_2009
+#include <boost/utility/enable_if.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/is_math_distribution.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+
+ template<typename D>
+ typename lazy_enable_if<
+ meta::is_math_distribution<D>,
+ meta::value<D>
+ >::type
+ pdf(const D& dist,const typename meta::value<D>::type x)
+ {
+ return boost::math::pdf(dist,x);
+ }
+
+
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+
+
+#endif
+
+

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/fwd_math/quantile.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/fwd_math/quantile.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,36 @@
+//////////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::fwd_math::quantile.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_FWD_MATH_QUANTILE_HPP_ER_2009
+#define BOOST_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_FWD_MATH_QUANTILE_HPP_ER_2009
+#include <boost/utility/enable_if.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/is_math_distribution.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+
+ template<typename D>
+ typename lazy_enable_if<
+ meta::is_math_distribution<D>,
+ meta::value<D>
+ >::type
+ quantile(const D& dist,const typename meta::value<D>::type x)
+ {
+ return boost::math::quantile(dist,x);
+ }
+
+
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/fwd_math/variance.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/fwd_math/variance.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,36 @@
+//////////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::fwd_math::variance.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_FWD_MATH_VARIANCE_HPP_ER_2009
+#define BOOST_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_FWD_MATH_VARIANCE_HPP_ER_2009
+#include <boost/utility/enable_if.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/is_math_distribution.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+
+ template<typename D>
+ typename lazy_enable_if<
+ meta::is_math_distribution<D>,
+ meta::value<D>
+ >::type
+ variance(const D& dist)
+ {
+ return boost::math::variance(dist);
+ }
+
+
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/include.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/include.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,19 @@
+//////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::include.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_INCLUDE_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_INCLUDE_HPP_ER_2009
+
+#include <boost/statistics/detail/distribution_toolkit/unscope/include.hpp>
+#include <boost/statistics/detail/distribution_toolkit/map_pdf/include.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/include.hpp>
+#include <boost/statistics/detail/distribution_toolkit/iterator/include.hpp>
+#include <boost/statistics/detail/distribution_toolkit/fun_wrap/include.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/include.hpp>
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/iterator/distribution_function.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/iterator/distribution_function.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,68 @@
+//////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::iterator::distribution_function.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_ITERATOR_DISTRIBUTION_FUNCTION_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_ITERATOR_DISTRIBUTION_FUNCTION_HPP_ER_2009
+#include <boost/iterator/transform_iterator.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/bind_delegate.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+namespace iterator{
+
+template<typename D>
+struct meta_distribution_function{
+
+ typedef meta::bind_delegate<D> bind_deleg_;
+ typedef typename bind_deleg_::type unary_;
+
+ template<typename ItX>
+ struct apply{
+ typedef boost::transform_iterator<unary_,ItX> type;
+
+ template<template<typename> class F>
+ static type make(
+ const D& dist,
+ ItX i_x
+ ){
+ return make_transform_iterator(
+ i_x,
+ bind_deleg_::template make<F>(dist)
+ );
+ }
+ };
+};
+
+
+// TODO enable_if<has_pdf>
+template<template<typename> class F,typename D,typename ItX>
+typename meta_distribution_function<D>::template apply<ItX>::type
+make_distribution_function(
+ const D& dist,
+ ItX i_x
+)
+{
+ typedef meta_distribution_function<D> meta_;
+ typedef typename meta_::template apply<ItX> app_;
+
+ return app_::template make<F>(
+ dist,
+ i_x
+ );
+}
+
+}// iterator
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+
+
+#endif

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/iterator/include.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/iterator/include.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,15 @@
+//////////////////////////////////////////////////////////////////////////////
+// distribution_toolkititerator::distribution_function.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_ITERATOR_INCLUDE_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_ITERATOR_INCLUDE_HPP_ER_2009
+
+#include <boost/statistics/detail/distribution_toolkit/iterator/distribution_function.hpp>
+
+#endif
+

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/map_pdf/include.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/map_pdf/include.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,16 @@
+//////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::map_pdf::include.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_MAP_PDF_INCLUDE_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_MAP_PDF_INCLUDE_HPP_ER_2009
+
+#include <boost/statistics/detail/distribution_toolkit/map_pdf/inverse_pdf/include.hpp>
+#include <boost/statistics/detail/distribution_toolkit/map_pdf/product_pdf/include.hpp>
+#include <boost/statistics/detail/distribution_toolkit/map_pdf/ratio_pdf/include.hpp>
+
+#endif

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/map_pdf/inverse_pdf/include.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/map_pdf/inverse_pdf/include.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,16 @@
+//////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::map_pdf::inverse_pdf::include.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_MAP_PDF_INVERSE_PDF_INCLUDE_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_MAP_PDF_INVERSE_PDF_INCLUDE_HPP_ER_2009
+
+#include <boost/statistics/detail/distribution_toolkit/map_pdf/inverse_pdf/inverse_pdf.hpp>
+#include <boost/statistics/detail/distribution_toolkit/map_pdf/inverse_pdf/is_pseudo_scalar_distribution.hpp>
+#include <boost/statistics/detail/distribution_toolkit/map_pdf/inverse_pdf/log_unnormalized_pdf.hpp>
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/map_pdf/inverse_pdf/inverse_pdf.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/map_pdf/inverse_pdf/inverse_pdf.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,61 @@
+//////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::map_pdf::inverse_pdf::inverse_pdf.hp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_MAP_PDF_INVERSE_PDF_INVERSE_PDF_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_MAP_PDF_INVERSE_PDF_INVERSE_PDF_HPP_ER_2009
+#include <boost/statistics/detail/distribution_toolkit/meta/inherit_policy.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/inherit_value.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/is_pseudo_scalar_distribution.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+
+ // Represents the inverse pdf
+ template<typename D>
+ class inverse_pdf : public
+ meta::inherit_policy<
+ D,
+ meta::inherit_value<D>
+ >
+ {
+
+ public:
+ typedef typename meta::value<D>::type value_type;
+
+ inverse_pdf(){}
+ explicit inverse_pdf(const D& d):d_(d){}
+ inverse_pdf(const inverse_pdf& that):d_(that.d_){}
+ inverse_pdf&
+ operator=(const inverse_pdf& that){
+ if(&that!=this){
+ d_ = that.d_;
+ }
+ return *this;
+ }
+
+ const D&
+ distribution()const{ return d_; }
+
+ private:
+ D d_;
+ };
+
+ template<typename D>
+ inverse_pdf<D>
+ make_inverse_pdf(const D& d){ return inverse_pdf<D>(d); }
+
+
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/map_pdf/inverse_pdf/is_pseudo_scalar_distribution.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/map_pdf/inverse_pdf/is_pseudo_scalar_distribution.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,32 @@
+///////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::map_pdf::inverse_pdf::is_pseudo_scalar_distribution.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_MAP_PDF_INVERSE_PDF_IS_PSEUDO_SCALAR_DISTRIBUTION_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_MAP_PDF_INVERSE_PDF_IS_PSEUDO_SCALAR_DISTRIBUTION_HPP_ER_2009
+#include <boost/mpl/bool.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/is_pseudo_scalar_distribution.hpp>
+#include <boost/statistics/detail/distribution_toolkit/map_pdf/inverse_pdf/inverse_pdf.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+namespace meta{
+
+ template<typename D>
+ struct is_pseudo_scalar_distribution<
+ inverse_pdf<D>
+ > : is_pseudo_scalar_distribution<D> {};
+
+}// meta
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/map_pdf/inverse_pdf/log_unnormalized_pdf.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/map_pdf/inverse_pdf/log_unnormalized_pdf.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,40 @@
+//////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::map_pdf::inverse_pdf::log_unnomarlized_pdf.hp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_MAP_PDF_INVERSE_PDF_LOG_UNNORMALIZED_PDF_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_MAP_PDF_INVERSE_PDF_LOG_UNNORMALIZED_PDF_HPP_ER_2009
+#include <boost/mpl/not.hpp>
+#include <boost/utility/enable_if.hpp>
+#include <boost/statistics/detail/distribution_toolkit/map_pdf/inverse_pdf/inverse_pdf.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/value.hpp>
+#include <boost/statistics/detail/distribution_toolkit/concept/log_unnormalized_pdf.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+
+ template<typename D>
+ typename meta::value< inverse_pdf<D> >::type
+ log_unnormalized_pdf(
+ const inverse_pdf<D>& dist,
+ const typename meta::value< inverse_pdf<D> >::type& x
+ ){
+ BOOST_CONCEPT_ASSERT((
+ concept::LogUnnormalizedPdf<D>
+ ));
+ return
+ ( -log_unnormalized_pdf(dist.distribution(),x) );
+ }
+
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/map_pdf/product_pdf/include.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/map_pdf/product_pdf/include.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,16 @@
+//////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::map_pdf::product_pdf::include.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_MAP_PDF_PRODUCT_PDF_INCLUDE_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_MAP_PDF_PRODUCT_PDF_INCLUDE_HPP_ER_2009
+
+#include <boost/statistics/detail/distribution_toolkit/map_pdf/product_pdf/product_pdf.hpp>
+#include <boost/statistics/detail/distribution_toolkit/map_pdf/product_pdf/is_pseudo_scalar_distribution.hpp>
+#include <boost/statistics/detail/distribution_toolkit/map_pdf/product_pdf/log_unnormalized_pdf.hpp>
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/map_pdf/product_pdf/is_pseudo_scalar_distribution.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/map_pdf/product_pdf/is_pseudo_scalar_distribution.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,36 @@
+///////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::map_pdf::product_pdf::is_pseudo_scalar_distribution.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_MAP_PDF_PRODUCT_PDF_IS_PSEUDO_SCALAR_DISTRIBUTION_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_MAP_PDF_PRODUCT_PDF_IS_PSEUDO_SCALAR_DISTRIBUTION_HPP_ER_2009
+#include <boost/mpl/bool.hpp>
+#include <boost/mpl/and.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/is_pseudo_scalar_distribution.hpp>
+#include <boost/statistics/detail/distribution_toolkit/map_pdf/product_pdf/product_pdf.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+namespace meta{
+
+ template<typename A,typename B>
+ struct is_pseudo_scalar_distribution<
+ product_pdf<A,B>
+ > : mpl::and_<
+ is_pseudo_scalar_distribution<A>,
+ is_pseudo_scalar_distribution<B>
+ > {};
+
+}// meta
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/map_pdf/product_pdf/log_unnormalized_pdf.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/map_pdf/product_pdf/log_unnormalized_pdf.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,48 @@
+//////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::map_pdf::product_pdf::log_unnomralized_pdf.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_MAP_PDF_PRODUCT_PDF_LOG_UNNORMALIZED_PDF_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_MAP_PDF_PRODUCT_PDF_LOG_UNNORMALIZED_PDF_HPP_ER_2009
+#include <boost/mpl/not.hpp>
+#include <boost/utility/enable_if.hpp>
+#include <boost/statistics/detail/distribution_toolkit/map_pdf/product_pdf/product_pdf.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/value.hpp>
+#include <boost/statistics/detail/distribution_toolkit/concept/log_unnormalized_pdf.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+
+ template<typename A,typename B>
+ typename meta::value < product_pdf<A,B> >::type
+ log_unnormalized_pdf(
+ const product_pdf<A,B>& dist,
+ const typename meta::value< product_pdf<A,B> >::type& x
+ ){
+
+ BOOST_CONCEPT_ASSERT((
+ concept::LogUnnormalizedPdf<A>
+ ));
+ BOOST_CONCEPT_ASSERT((
+ concept::LogUnnormalizedPdf<A>
+ ));
+
+ return
+ log_unnormalized_pdf(dist.first(),x)
+ + log_unnormalized_pdf(dist.second(),x);
+ }
+
+
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/map_pdf/product_pdf/product_pdf.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/map_pdf/product_pdf/product_pdf.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,67 @@
+//////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::map_pdf::product_pdf::product_pdf.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_MAP_PDF_PRODUCT_PDF_PRODUCT_PDF_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_MAP_PDF_PRODUCT_PDF_PRODUCT_PDF_HPP_ER_2009
+#include <boost/statistics/detail/distribution_toolkit/meta/inherit_policy.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/inherit_value.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/is_pseudo_scalar_distribution.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+
+ // Represents the product of the pdf of two distributions
+ //
+ // A = T or A = T& or A = T*. Likewise for B.
+ template<typename A,typename B>
+ class product_pdf : public meta::inherit_policy<
+ A,
+ meta::inherit_value<A>
+ >{
+
+ public:
+
+ product_pdf(){}
+ explicit product_pdf(
+ const A& a,
+ const B& b
+ ):a_(a),b_(b){}
+
+ product_pdf(const product_pdf& that):a_(that.a_),b_(that.b_){}
+
+ product_pdf&
+ operator=(const product_pdf& that){
+ if(&that!=this){
+ a_ = that.a_;
+ b_ = that.b_;
+ }
+ return *this;
+ }
+
+ const A& first()const{ return a_; }
+ const B& second()const{ return b_; }
+
+ protected:
+ A a_;
+ B b_;
+ };
+
+ template<typename A,typename B>
+ product_pdf<A,B>
+ make_product_pdf(const A& a,const B& b){
+ return product_pdf<A,B>(a,b);
+ }
+
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/map_pdf/ratio_pdf/include.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/map_pdf/ratio_pdf/include.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,14 @@
+//////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::map_pdf::ratio_pdf::include.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_MAP_PDF_RATIO_PDF_INCLUDE_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_MAP_PDF_RATIO_PDF_INCLUDE_HPP_ER_2009
+
+#include <boost/statistics/detail/distribution_toolkit/map_pdf/ratio_pdf/ratio_pdf.hpp>
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/map_pdf/ratio_pdf/ratio_pdf.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/map_pdf/ratio_pdf/ratio_pdf.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,37 @@
+//////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::map_pdf::ratio_pdf::ratio_pdf.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_MAP_PDF_RATIO_PDF_RATIO_PDF_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_MAP_PDF_RATIO_PDF_RATIO_PDF_HPP_ER_2009
+#include <boost/call_traits.hpp>
+#include <boost/statistics/detail/distribution_toolkit/map_pdf/inverse_pdf/inverse_pdf.hpp>
+#include <boost/statistics/detail/distribution_toolkit/map_pdf/product_pdf/product_pdf.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+
+ template<typename A,typename B>
+ struct meta_ratio_pdf{
+ typedef inverse_pdf<B> inv_;
+ typedef product_pdf<A, inv_ > type;
+ static type make(A a,B b){
+ return type(
+ a,
+ inv_(b)
+ );
+ }
+ };
+
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+
+#endif

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/meta/bind_delegate.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/meta/bind_delegate.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,53 @@
+//////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::meta::bind_delegate.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_META_BIND_DELEGATE_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_META_BIND_DELEGATE_HPP_ER_2009
+#include <boost/function.hpp>
+#include <boost/lambda/bind.hpp>
+#include <boost/lambda/lambda.hpp>
+#include <boost/type_traits/function_traits.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/signature.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/delegate.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+namespace meta{
+
+ template<typename D>
+ struct bind_delegate{
+
+ typedef signature<D> sig_;
+ typedef delegate<D> deleg_;
+ typedef function_traits<typename sig_::type> traits_;
+ typedef typename traits_::result_type result_;
+ typedef typename traits_::arg2_type arg2_;
+ typedef result_ sig2_( arg2_ );
+ typedef function<sig2_> type;
+
+ template<template<typename> class F>
+ static type make(const D& dist){
+ return type(
+ boost::lambda::bind(
+ deleg_::template make<F>(),
+ dist,
+ boost::lambda::_1
+ )
+ );
+ }
+ };
+
+}// meta
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/meta/delegate.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/meta/delegate.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,35 @@
+//////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::meta::delegate.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_META_DELEGATE_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_META_DELEGATE_HPP_ER_2009
+#include <boost/function.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/signature.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+namespace meta{
+
+ template<typename D>
+ struct delegate{
+ typedef typename signature<D>::type sig_;
+ typedef boost::function<sig_> type;
+
+ template<template<typename> class F> // F in fun_wrap
+ static type make(){ return type(F<D>::instance); }
+ };
+
+}// meta
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/meta/distribution_base.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/meta/distribution_base.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,30 @@
+//////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::meta::distribution_base.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_META_DISTRIBUTION_BASE_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_META_DISTRIBUTION_BASE_HPP_ER_2009
+#include <boost/mpl/identity.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+namespace meta{
+
+
+ // TODO remove
+ template<typename D>
+ struct distribution_base : mpl::identity<D>{};
+
+}// meta
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/meta/include.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/meta/include.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,19 @@
+//////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::meta::include.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_META_INCLUDE_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_META_INCLUDE_HPP_ER_2009
+
+#include <boost/statistics/detail/distribution_toolkit/meta/delegate.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/distribution_base.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/pointer.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/policy.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/signature.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/value.hpp>
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/meta/inherit_policy.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/meta/inherit_policy.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,40 @@
+///////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::meta::inherit_policy.hpp //
+// //
+// Copyright 2009 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_META_INHERIT_POLICY_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_META_INHERIT_POLICY_HPP_ER_2009
+#include <boost/mpl/assert.hpp>
+#include <boost/mpl/not.hpp>
+#include <boost/type_traits.hpp>
+#include <boost/mpl/empty_base.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/policy.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+namespace meta{
+
+ template<typename D,typename B = mpl::empty_base>
+ struct inherit_policy : B{
+ BOOST_MPL_ASSERT((
+ mpl::not_<
+ is_reference<D>
+ >
+ ));
+ typedef typename policy<D>::type policy_type;
+ };
+
+
+
+}// meta
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+
+#endif

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/meta/inherit_value.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/meta/inherit_value.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,42 @@
+///////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::meta::inherit_value.hpp //
+// //
+// Copyright 2009 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_META_INHERIT_VALUE_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_META_INHERIT_VALUE_HPP_ER_2009
+#include <boost/mpl/assert.hpp>
+#include <boost/mpl/not.hpp>
+#include <boost/type_traits.hpp>
+#include <boost/mpl/empty_base.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/value.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+namespace meta{
+
+ template<typename D,typename B = mpl::empty_base>
+ struct inherit_value : B{
+ BOOST_MPL_ASSERT((
+ mpl::not_<
+ is_reference<D>
+ >
+ ));
+
+ typedef typename value<D>::type value_type;
+
+ };
+
+
+
+}// meta
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+
+#endif

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/meta/is_math_distribution.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/meta/is_math_distribution.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,30 @@
+///////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::meta::is_math_distribution.hpp //
+// //
+// Copyright 2009 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_META_IS_MATH_DISTRIBUTION_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_META_IS_MATH_DISTRIBUTION_HPP_ER_2009
+#include <boost/mpl/bool.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+namespace meta{
+
+ template<typename D>
+ struct is_math_distribution : mpl::bool_<false> {};
+
+ // Specialize to bool_<true> for distribution defined in boost::math only
+
+
+}// meta
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+
+#endif

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/meta/is_pseudo_scalar_distribution.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/meta/is_pseudo_scalar_distribution.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,30 @@
+///////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::meta::is_pseudo_scalar_distribution.hpp //
+// //
+// Copyright 2009 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_META_IS_PSEUDO_DISTRIBUTION_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_META_IS_PSEUDO_DISTRIBUTION_HPP_ER_2009
+#include <boost/statistics/detail/distribution_toolkit/meta/is_scalar_distribution.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+namespace meta{
+
+ // The mapping of a distribution's pdf is not a distribution, but for
+ // practical purposes, it may share its interface such as pdf(dist,x)
+ template<typename D>
+ struct is_pseudo_scalar_distribution
+ : is_scalar_distribution<D> {};
+
+}// meta
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/meta/is_scalar_distribution.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/meta/is_scalar_distribution.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,31 @@
+///////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::meta::is_distribution.hpp //
+// //
+// Copyright 2009 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_META_IS_SCALAR_DISTRIBUTION_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_META_IS_SCALAR_DISTRIBUTION_HPP_ER_2009
+#include <boost/statistics/detail/distribution_toolkit/meta/is_math_distribution.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+namespace meta{
+
+ template<typename D>
+ struct is_scalar_distribution : is_math_distribution<D> {};
+
+ // Specialize to bool_<true> for those distribution defined within
+ // distribution_toolkit, such as location_scale
+
+
+}// meta
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+
+#endif

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/meta/pointer.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/meta/pointer.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,35 @@
+//////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::meta::pointer.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_META_POINTER_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_META_POINTER_HPP_ER_2009
+#include <boost/statistics/detail/distribution_toolkit/meta/signature.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+namespace meta{
+
+ template<typename D>
+ struct pointer{
+ typedef typename signature<D>::type sig_;
+ typedef sig_* type;
+
+ template<template<typename> class F> // F in fun_wrap
+ static type make(){ return F<D>::instance; }
+ };
+
+}// meta
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+
+#endif
+

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/meta/policy.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/meta/policy.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,30 @@
+//////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::meta::policy.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_META_POLICY_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_META_POLICY_HPP_ER_2009
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+namespace meta{
+
+ template<typename D>
+ struct policy{
+ typedef typename D::policy_type type;
+ };
+
+}// meta
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/meta/random.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/meta/random.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,45 @@
+///////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::meta::random.hpp //
+// //
+// Copyright 2009 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_META_RANDOM_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_META_RANDOM_HPP_ER_2009
+#include <boost/utility/enable_if.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/is_scalar_distribution.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+namespace meta{
+
+ template<typename D>
+ struct random{};
+
+ // Specialization for each D has to model RandomDistribution
+ // http://www.boost.org/doc/libs/1_40_0/libs/random/random-concepts.html
+ // and provide static type make(const D& )
+
+}// meta
+}// distribution_toolkit
+}// detail
+}// statistics
+
+
+ template<typename D>
+ typename lazy_enable_if<
+ statistics::detail::distribution_toolkit::meta::
+ is_scalar_distribution<D>,
+ statistics::detail::distribution_toolkit::meta::random<D>
+ >::type
+ make_random(const D& d){
+ typedef statistics::detail::distribution_toolkit::meta::random<D> meta_;
+ return meta_::make(d);
+ }
+
+}// boost
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/meta/signature.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/meta/signature.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,36 @@
+//////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::meta::signature.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_META_SIGNATURE_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_META_SIGNATURE_HPP_ER_2009
+#include <boost/statistics/detail/distribution_toolkit/meta/value.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+namespace meta{
+
+ // Signature for f(dist,x), f = pdf, cdf etc.
+ template<typename D>
+ struct signature{
+ typedef typename value<D>::type value_type;
+
+ typedef value_type type(
+ const D&,
+ const value_type&
+ );
+ };
+
+}// meta
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/meta/value.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/meta/value.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,32 @@
+//////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::meta::value.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_META_VALUE_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_META_VALUE_HPP_ER_2009
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+namespace meta{
+
+ // Type of y and x in y = f(dist,x)
+ template<typename D>
+ struct value{
+ typedef typename D::value_type type;
+ };
+
+}// meta
+}// distribution_toolkit
+}// detail
+}// statistics
+}// boost
+
+
+#endif
+

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/random/generator.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/random/generator.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,60 @@
+//////////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::random::generator.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_RANDOM_GENERATOR_HPP_ER_2009
+#define BOOST_DISTRIBUTION_TOOLKIT_DISTRIBUTIONS_RANDOM_GENERATOR_HPP_ER_2009
+#include <boost/random/variate_generator.hpp>
+#include <boost/utility/enable_if.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/is_scalar_distribution.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/random.hpp>
+
+namespace boost{
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+namespace random{
+namespace meta{
+
+ // U = V or U = V& allowed where V models UniformRandomNumberGenerator
+ template<typename D,typename U>
+ struct generator{
+ typedef distribution_toolkit::meta::random<D> meta_;
+ typedef typename meta_::type r_;;
+ typedef variate_generator<U,r_> type;
+ static type make(U urng,const D& d){
+ return type(
+ urng,
+ make_random(d)
+ );
+ }
+
+ };
+}// meta
+}// random
+}// distribution_toolkit
+}// detail
+}// statistics
+
+
+ template<typename D,typename U>
+ typename lazy_enable_if<
+ statistics::detail::distribution_toolkit
+ ::meta::is_scalar_distribution<D>,
+ statistics::detail::distribution_toolkit::random::meta::generator<D,U&>
+ >::type
+ make_random_generator(U& urng,const D& dist){
+ typedef statistics::detail::distribution_toolkit::random
+ ::meta::generator<D,U&> meta_;
+ return meta_::make(urng,dist);
+ }
+
+
+}// boost
+
+
+#endif

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/random/include.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/random/include.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,14 @@
+//////////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::random::include.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_DISTRIBUTION_TOOLKIT_RANDOM_INCLUDE_HPP_ER_2009
+#define BOOST_DISTRIBUTION_TOOLKIT_RANDOM_INCLUDE_HPP_ER_2009
+
+#include <boost/statistics/detail/distribution_toolkit/random/generator.hpp>
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/transformation/include.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/transformation/include.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,14 @@
+//////////////////////////////////////////////////////////////////////////////
+// distributions::transformation::include.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STANDARD_DISTRIBUTION_TRANSFORMATION_INCLUDE_HPP_ER_2009
+#define BOOST_STANDARD_DISTRIBUTION_TRANSFORMATION_INCLUDE_HPP_ER_2009
+
+#include <boost/standard_distribution/transformation/location_scale.hpp>
+
+#endif

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/unscope/include.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/unscope/include.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,15 @@
+//////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::unscope::include.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_UNSCOPE_INCLUDE_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_UNSCOPE_INCLUDE_HPP_ER_2009
+
+#include <boost/statistics/detail/distribution_toolkit/unscope/log_unnormalized_pdf.hpp>
+#include <boost/statistics/detail/distribution_toolkit/unscope/os.hpp>
+
+#endif

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/unscope/log_unnormalized_pdf.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/unscope/log_unnormalized_pdf.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,46 @@
+//////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::unscope::log_unnormalized_pdf.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_UNSCOPE_LOG_UNNORMALIZED_PDF_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_UNSCOPE_LOG_UNNORMALIZED_PDF_HPP_ER_2009
+#include <boost/utility/enable_if.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/is_scalar_distribution.hpp>
+
+namespace boost{
+
+namespace statistics{
+namespace detail{
+namespace distribution_toolkit{
+
+ template<typename D,typename T>
+ T log_unnormalized_pdf(const D& d,const T& x);
+
+}// detail
+}// distribution_toolkit
+}// detail
+}// statistics
+
+
+ // The reason for unscoping is to have a common interface for
+ // distributions defined in distribution_toolkit and other
+ // libraries, not necessarily restricted to scalars
+
+ template<typename D,typename T>
+ typename boost::enable_if<
+ statistics::detail::distribution_toolkit::meta
+ ::is_pseudo_scalar_distribution_distribution<D>,
+ T // TODO or perhaps meta::value<D>::type, using lazy_enable_if
+ >
+ log_unnormalized_pdf(const D& d,const T& x){
+ return statistics::detail::distribution_toolkit
+ ::log_unnormalized_pdf<D>(d,x);
+ }
+
+}// boost
+
+#endif

Added: sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/unscope/os.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/boost/statistics/detail/distribution_toolkit/unscope/os.hpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,38 @@
+//////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::unscope::log_unnormalized_pdf.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_UNSCOPE_LOG_UNNORMALIZED_PDF_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_UNSCOPE_LOG_UNNORMALIZED_PDF_HPP_ER_2009
+#include <boost/utility/enable_if.hpp>
+#include <boost/mpl/identity.hpp>
+#include <boost/statistics/detail/distribution_toolkit/meta/is_pseudo_scalar_distribution.hpp>
+
+namespace boost{
+
+ template<typename D>
+ typename boost::lazy_enable_if<
+ boost::statistics::detail::distribution_toolkit
+ ::meta::is_pseudo_scalar_distribution<D>,
+ mpl::identity<std::ostream&>
+ >::type
+ operator<<(std::ostream& os,const D& dist){
+ return (
+ os <<
+ statistics::detail::distribution_toolkit::description(dist)
+ );
+ }
+
+
+}
+
+#endif
+
+
+
+
+

Added: sandbox/statistics/distribution_toolkit/libs/statistics/detail/distribution_toolkit/doc/readme.txt
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/libs/statistics/detail/distribution_toolkit/doc/readme.txt 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,96 @@
+//////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::doc::readme //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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) //
+//////////////////////////////////////////////////////////////////////////////
+
+[ Contact ]
+
+erwann.rogard_at_[hidden]
+
+[ Overview ]
+
+These are C++ classes that extend boost/math/distributions. However, it is not
+intrusive. Instead, the distributions in boost::math are brought into the scope
+of distribution_toolkit with forwarding functions.
+
+[ Useful links ]
+
+http://www.boost.org/doc/libs/1_35_0/libs/math/doc/sf_and_dist/html/index.html
+
+[ Directories ]
+
+/data
+/distributions
+
+ Provides extended functionality for distributions in boost::math or adds
+ distributions not available under this scope, such as location_scale
+
+ For example
+ log_unnormalized_pdf(dist,x)
+ What for?
+ - exp( sum{ log_pdf : i=1,...,n } ) is preferable to prod{ pdf : i=1,..,n }
+ - The normalizing constant is either unnecessary (Bayesian) or can be
+ cached
+
+/concept
+/fun_wrap
+
+ Decouples the function, such as pdf, from the distribution D:
+ fun_wrap::cdf_<D>::instance
+
+/fwd_math
+/iterator
+/map_pdf
+
+ e.g. pdf(make_inverse_pdf(dist),x)
+
+ Rationale: the pseudo distribution returned by make_inverse_pdf is more
+ convenient than a hypothetical function inverse_pdf(dist,x). For example,
+ pseudo distributions can be combined (make_ratio_pdf) and the functionality
+ associated with distributions can be reused (e.g. fun_wrap::pdf_).
+
+/meta
+/random
+
+ Maps a distribution to a variate generator
+
+/unscope
+
+ bring some functions in scope boost::statistics::distribution_toolkit to
+ scope boost, but only (via enable_if) for those distributions that verify
+ the predicate distribution_toolkit::meta::is_pseudo_scalar_distribution
+
+ The rationale for this is to have a common interface for the distributions
+ in distribution_toolkit, and others defined throughout boost::statistics
+
+[ Compiler ]
+
+gcc version i686-apple-darwin9-gcc-4.0.1 (GCC) 4.0.1
+
+[ Dependencies ]
+
+boost_1_39_0
+/sandbox/statistics/random/
+
+To use distributions/wrapper,
+libboost_serialization-xgcc42-mt-1_39.a
+
+[ Bugs ]
+
+See distributions/wrapper/wrapper.hpp
+
+[ History ]
+
+Sep 23 2009 : Merged
+ sandbox/statistics/scalar_dist
+ sandbox/statistics/standard_distribution
+ sandbox/statistics/dist_random
+ sandbox/statistics/empirical_cdf
+ into this package, with modifications to simplify the interface.
+Sep 16 2009 : deleted /algorithm and added /iterator
+July 2009 : First version
+

Added: sandbox/statistics/distribution_toolkit/libs/statistics/detail/distribution_toolkit/example/distribution_function.cpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/libs/statistics/detail/distribution_toolkit/example/distribution_function.cpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,200 @@
+//////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::example::location_scale.cpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 <numeric>
+#include <cmath>
+#include <string>
+#include <boost/mpl/apply.hpp>
+#include <boost/bind.hpp>
+#include <boost/function.hpp>
+#include <boost/range.hpp>
+
+#include <boost/math/tools/precision.hpp>
+#include <boost/random/mersenne_twister.hpp>
+#include <boost/random/normal_distribution.hpp>
+#include <boost/random/variate_generator.hpp>
+
+#include <boost/statistics/detail/distribution_toolkit/meta/include.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/normal/include.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/students_t/include.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/location_scale/include.hpp>
+#include <boost/statistics/detail/distribution_toolkit/map_pdf/include.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/wrapper/include.hpp>
+#include <boost/statistics/detail/distribution_toolkit/iterator/include.hpp>
+#include <boost/statistics/detail/distribution_toolkit/fun_wrap/include.hpp>
+
+#include <libs/statistics/detail/distribution_toolkit/example/distribution_function.h>
+
+void example_distribution_function(std::ostream& out){
+ out << "-> example_math_location_scale->" << std::endl;
+
+ // Examples of location_scale + fun_wrap + map_pdf + iterator
+
+ using namespace boost;
+ using namespace math;
+ using namespace statistics::detail;
+ namespace tk = distribution_toolkit;
+ namespace tk_it = tk::iterator;
+
+ // Types
+ typedef double val_;
+ typedef std::vector<val_> vals_;
+ typedef std::string str_;
+ typedef boost::mt19937 urng_;
+ typedef boost::normal_distribution<val_> rnd_;
+ typedef math::students_t_distribution<val_> stud_;
+ typedef tk::location_scale_distribution<stud_> ls_stud_;
+ typedef boost::variate_generator<urng_&,rnd_> vg_;
+
+ // Constants
+ const unsigned df = 10;
+ const val_ mu = 10;
+ const val_ sigma = 2;
+ const unsigned n = 1e1;
+ const val_ x = 2.132;
+
+
+ // Initialization
+ urng_ urng;
+ vals_ range_x;
+
+ stud_ stud(df);
+ ls_stud_ ls_stud(mu, sigma, stud);
+
+ struct float_{
+
+ static bool equal(const val_& a, const val_& b){
+ static val_ e = boost::math::tools::epsilon<val_>();;
+ return fabs(a-b)< e;
+ }
+
+ };
+
+
+ { // fun_wrap
+ typedef tk::meta::delegate<stud_> meta_deleg_;
+ typedef meta_deleg_::type deleg_;
+ deleg_ deleg
+ = meta_deleg_::make<tk::fun_wrap::log_unnormalized_pdf_>();
+ BOOST_ASSERT(
+ float_::equal(
+ deleg(stud,x),
+ tk::log_unnormalized_pdf(stud,x)
+ )
+ );
+
+ // test wrapper
+ // BUG
+ {
+ typedef tk::wrapper<const stud_&> cref_stud_;
+ cref_stud_ cref_stud(stud);
+
+ typedef tk::meta::delegate<cref_stud_> meta_deleg2_;
+ typedef meta_deleg2_::type deleg2_;
+
+ // TODO compile error here:
+ //deleg2_ deleg2
+ // = meta_deleg2_::make<tk::fun_wrap::log_unnormalized_pdf_>();
+
+ BOOST_ASSERT(
+ float_::equal(
+ tk::log_unnormalized_pdf(cref_stud,x),
+ tk::log_unnormalized_pdf(stud,x)
+ )
+ );
+ }
+ }
+ { // fun_wrap + location_scale_distribution
+
+ typedef tk::meta::delegate<ls_stud_> meta_deleg_;
+ typedef meta_deleg_::type deleg_;
+ deleg_ deleg
+ = meta_deleg_::make<tk::fun_wrap::log_unnormalized_pdf_>();
+ BOOST_ASSERT(
+ float_::equal(
+ deleg(ls_stud,x),
+ tk::log_unnormalized_pdf(ls_stud,x)
+ )
+ );
+ }
+ { // make_distribution_function_iterator + fun_wrap
+ // Arbitrary random sample
+ std::generate_n(
+ back_inserter(range_x),
+ n,
+ vg_(urng,rnd_(0,1))
+ );
+ vals_ range_log_pdf;
+ std::copy(
+ tk_it::make_distribution_function<
+ tk::fun_wrap::log_unnormalized_pdf_
+ >(stud,boost::begin(range_x)),
+ tk_it::make_distribution_function<
+ tk::fun_wrap::log_unnormalized_pdf_
+ >(stud,boost::end(range_x)),
+ std::back_inserter(range_log_pdf)
+ );
+ }
+ { // product_pdf + fun_wrap
+ typedef tk::product_pdf<stud_,ls_stud_> prod_dist_;
+
+ typedef tk::meta::delegate<prod_dist_> meta_deleg_;
+ typedef meta_deleg_::type deleg_;
+ deleg_ deleg
+ = meta_deleg_::make<tk::fun_wrap::log_unnormalized_pdf_>();
+
+ prod_dist_ prod_dist(stud,ls_stud);
+ prod_dist_ prod_dist2(stud,ls_stud);
+ prod_dist = prod_dist2; // check assignment
+
+ BOOST_ASSERT(
+ float_::equal(
+ deleg(prod_dist,x),
+ tk::log_unnormalized_pdf(prod_dist,x)
+ )
+ );
+
+ }
+ { // inverse_pdf + fun_wrap
+ typedef tk::inverse_pdf<stud_> inv_dist_;
+ typedef tk::meta::delegate<inv_dist_> meta_deleg_;
+ typedef meta_deleg_::type deleg_;
+ deleg_ deleg
+ = meta_deleg_::make<tk::fun_wrap::log_unnormalized_pdf_>();
+ inv_dist_ inv_dist(stud);
+
+ BOOST_ASSERT(
+ float_::equal(
+ deleg(inv_dist,x),
+ tk::log_unnormalized_pdf(inv_dist,x)
+ )
+ );
+
+ }
+ { // ratio_pdf + fun_wrap
+ typedef tk::meta_ratio_pdf<stud_,ls_stud_> mf_;
+ typedef mf_::type ratio_dist_;
+
+ ratio_dist_ ratio_dist = mf_::make(stud,ls_stud);
+ typedef tk::meta::delegate<ratio_dist_> meta_deleg_;
+ typedef meta_deleg_::type deleg_;
+ deleg_ deleg
+ = meta_deleg_::make<tk::fun_wrap::log_unnormalized_pdf_>();
+
+ BOOST_ASSERT(
+ float_::equal(
+ deleg(ratio_dist,x),
+ tk::log_unnormalized_pdf(ratio_dist,x)
+ )
+ );
+ }
+ out << "<-" << std::endl;
+}

Added: sandbox/statistics/distribution_toolkit/libs/statistics/detail/distribution_toolkit/example/distribution_function.h
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/libs/statistics/detail/distribution_toolkit/example/distribution_function.h 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,15 @@
+//////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::example::distribution_function.h //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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_DISTRIBUTION_TOOLKIT_EXAMPLE_DISTRIBUTION_FUNCTION_H_ER_2009
+#define LIBS_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_EXAMPLE_DISTRIBUTION_FUNCTION__H_ER_2009
+#include <ostream>
+
+void example_distribution_function(std::ostream&);
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/distribution_toolkit/libs/statistics/detail/distribution_toolkit/example/random.cpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/libs/statistics/detail/distribution_toolkit/example/random.cpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,163 @@
+//////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::example::random.cpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 <iterator>
+#include <ext/algorithm>
+#include <boost/range.hpp>
+#include <boost/static_assert.hpp>
+#include <boost/random/mersenne_twister.hpp>
+
+#include <boost/statistics/detail/distribution_toolkit/distributions/chi_squared/include.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/exponential/include.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/gamma/include.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/normal/include.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/students_t/include.hpp>
+#include <boost/statistics/detail/distribution_toolkit/distributions/location_scale/include.hpp>
+//#include <boost/statistics/detail/distribution_toolkit/distributions/uniform/include.hpp>
+
+#include <boost/statistics/detail/distribution_toolkit/random/include.hpp>
+#include <boost/statistics/detail/distribution_toolkit/data/sample_cdf.hpp>
+#include <boost/statistics/detail/distribution_toolkit/unscope/os.hpp>
+
+#include <libs/statistics/detail/distribution_toolkit/example/random.h>
+
+void example_random(std::ostream& os){
+
+ os << "example_random -> " << std::endl;
+ using namespace boost;
+ using namespace statistics;
+ namespace tk = statistics::detail::distribution_toolkit;
+
+ // Types
+ typedef double val_;
+ typedef mt19937 urng_;
+
+ typedef tk::sample_cdf<val_> sample_cdf_;
+ typedef sample_cdf_::size_type size_;
+
+ // Constants
+ const unsigned n_loops = 6;
+ const unsigned n1 = 1e1;
+ const unsigned n2 = 1e1;
+
+ urng_ urng;
+
+ sample_cdf_ sc;
+ os << "kolmogorov statistic for : " << std::endl;
+ {
+ typedef math::chi_squared_distribution<val_> dist_;
+ const val_ df = 10;
+ dist_ dist( df );
+
+
+ os << dist << std::endl;
+ unsigned i = 0;
+ unsigned n_draws = n1;
+ sc.clear();
+ while(i<n_loops){
+ sc.reserve(sc.size()+n_draws);
+ sc.generate(n_draws,urng,dist);
+ os << sc << std::endl;
+ ++i;
+ n_draws *= n2;
+ }
+ }
+ {
+ typedef math::exponential_distribution<val_> dist_;
+ const val_ lambda = 1.0;
+ dist_ dist( lambda );
+
+ os << dist << std::endl;
+ unsigned i = 0;
+ unsigned n_draws = n1;
+ sc.clear();
+ while(i<n_loops){
+ sc.reserve(sc.size()+n_draws);
+ sc.generate(n_draws,urng,dist);
+ os << sc << std::endl;
+ ++i;
+ n_draws *= n2;
+ }
+ }
+ { // TODO ERROR : does not converge
+ typedef math::gamma_distribution<val_> dist_;
+ const val_ shape = 1.0;
+ dist_ dist( shape );
+
+ os << dist << std::endl;
+ unsigned i = 0;
+ unsigned n_draws = n1;
+ sc.clear();
+ while(i<n_loops){
+ sc.reserve(sc.size()+n_draws);
+ sc.generate(n_draws,urng,dist);
+ os << sc << std::endl;
+ ++i;
+ n_draws *= n2;
+ }
+ }
+ {
+ typedef math::normal_distribution<val_> dist_;
+ const val_ m = 1.0;
+ const val_ s = 2.0;
+ dist_ dist( m, s );
+
+ os << dist << std::endl;
+ unsigned i = 0;
+ unsigned n_draws = n1;
+ sc.clear();
+ while(i<n_loops){
+ sc.reserve(sc.size()+n_draws);
+ sc.generate(n_draws,urng,dist);
+ os << sc << std::endl;
+ ++i;
+ n_draws *= n2;
+ }
+ }
+ {
+ typedef math::students_t_distribution<val_> dist_;
+ const val_ df = 4.0;
+ dist_ dist( df );
+
+ os << dist << std::endl;
+ unsigned i = 0;
+ unsigned n_draws = n1;
+ sc.clear();
+ while(i<n_loops){
+ sc.reserve(sc.size()+n_draws);
+ sc.generate(n_draws,urng,dist);
+ os << sc << std::endl;
+ ++i;
+ n_draws *= n2;
+ }
+ }
+ {
+ typedef math::students_t_distribution<val_> dist_z_;
+ typedef tk::location_scale_distribution<dist_z_> dist_;
+ const val_ df = 4.0;
+ const val_ m = 1.0;
+ const val_ s = 2.0;
+ dist_z_ dist_z( df );
+ dist_ dist(m, s, dist_z);
+
+ os << dist << std::endl;
+ unsigned i = 0;
+ unsigned n_draws = n1;
+ sc.clear();
+ while(i<n_loops){
+ sc.reserve(sc.size()+n_draws);
+ sc.generate(n_draws,urng,dist);
+ os << sc << std::endl;
+ ++i;
+ n_draws *= n2;
+ }
+ }
+
+ os << "<-" << std::endl;
+
+}

Added: sandbox/statistics/distribution_toolkit/libs/statistics/detail/distribution_toolkit/example/random.h
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/libs/statistics/detail/distribution_toolkit/example/random.h 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,15 @@
+//////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::example::random.h //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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_DISTRIBUTION_TOOLKIT_EXAMPLE_RANDOM_H_ER_2009
+#define LIBS_STATISTICS_DETAIL_DISTRIBUTION_TOOLKIT_EXAMPLE_RANDOM_H_ER_2009
+#include <ostream>
+
+void example_random(std::ostream&);
+
+#endif

Added: sandbox/statistics/distribution_toolkit/libs/statistics/detail/distribution_toolkit/src/main.cpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/distribution_toolkit/libs/statistics/detail/distribution_toolkit/src/main.cpp 2009-09-26 16:44:26 EDT (Sat, 26 Sep 2009)
@@ -0,0 +1,19 @@
+//////////////////////////////////////////////////////////////////////////////
+// distribution_toolkit::src::main.h //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to 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 <iostream>
+#include <libs/statistics/detail/distribution_toolkit/example/distribution_function.h>
+#include <libs/statistics/detail/distribution_toolkit/example/random.h>
+
+int main(){
+
+ example_distribution_function(std::cout);
+ //example_random(std::cout);
+
+ return 0;
+}
\ No newline at end of file


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