Index: trunk/tests/test_ContOrthoPoly1D.cc
===================================================================
--- trunk/tests/test_ContOrthoPoly1D.cc (revision 715)
+++ trunk/tests/test_ContOrthoPoly1D.cc (revision 716)
@@ -1,365 +1,367 @@
#include "UnitTest++.h"
#include "test_utils.hh"
#include "npstat/nm/ContOrthoPoly1D.hh"
#include "npstat/nm/ClassicalOrthoPolys1D.hh"
#include "npstat/nm/FejerQuadrature.hh"
#include "npstat/nm/StorablePolySeries1D.hh"
#include "npstat/rng/MersenneTwister.hh"
using namespace npstat;
using namespace std;
inline static int kdelta(const unsigned i, const unsigned j)
{
return i == j ? 1 : 0;
}
namespace {
TEST(ContOrthoPoly1D_orthonormalization)
{
const double eps = 1.0e-15;
const OrthoPolyMethod method[] = {OPOLY_STIELTJES, OPOLY_LANCZOS};
const unsigned nMethods = sizeof(method)/sizeof(method[0]);
const unsigned npoints = 64;
const unsigned maxdeg = 10;
const unsigned ntries = 10;
std::vector points(2U*npoints);
std::vector measure;
measure.reserve(npoints);
std::vector coeffs(maxdeg + 1);
MersenneTwister rng;
for (unsigned imeth=0; imeth(kdelta(i, j)), d, eps);
}
measure.clear();
for (unsigned i=0; i(kdelta(i, 0)), coeffs[i], eps);
}
}
#ifdef USE_LAPACK_QUAD
TEST(ContOrthoPoly1D_orthonormalization_quad_STIELTJES)
{
const lapack_double eps = FLT128_EPSILON*100.0;
const OrthoPolyMethod method = OPOLY_STIELTJES;
const unsigned npoints = 64;
const unsigned maxdeg = 10;
const unsigned ntries = 5;
const double xmin = -1.0;
const double xmax = 1.0;
const double range = xmax - xmin;
std::vector points(2U*npoints);
std::vector measure;
measure.reserve(npoints);
MersenneTwister rng;
for (unsigned itry=0; itry(kdelta(i, j)), d, eps);
}
}
}
TEST(ContOrthoPoly1D_orthonormalization_quad_LANCZOS)
{
const lapack_double eps = FLT128_EPSILON*100.0;
const OrthoPolyMethod method = OPOLY_LANCZOS;
const unsigned npoints = 64;
const unsigned maxdeg = 10;
const unsigned ntries = 5;
const double xmin = -1.0;
const double xmax = 1.0;
const double range = xmax - xmin;
std::vector points(2U*npoints);
std::vector measure;
measure.reserve(npoints);
MersenneTwister rng;
for (unsigned itry=0; itry(kdelta(i, j)), d, eps);
}
}
}
#endif
TEST(ContOrthoPoly1D_weightCoeffs)
{
const double eps = 1.0e-7;
const unsigned maxdeg = 10;
const unsigned ntries = 10;
const unsigned npoints = maxdeg + 1U;
std::vector points(2U*npoints);
std::vector measure;
measure.reserve(npoints);
std::vector coeffs(maxdeg + 1);
MersenneTwister rng;
for (unsigned itry=0; itry poly2(
poly.makeStorablePolySeries(xmin, xmax));
for (unsigned deg=0; deg<=maxdeg; ++deg)
for (unsigned ipow=0; ipow<4; ++ipow)
{
const double i1 = poly.integratePoly(deg, ipow, xmin, xmax);
const double i2 = poly2->integratePoly(deg, ipow);
if (fabs(i2) > 1.0e-10)
CHECK_CLOSE(1.0, i1/i2, 1.0e-10);
}
for (unsigned i=0; iseries(&coeffs[0], maxdeg, x);
CHECK_CLOSE(w, fvalue, 1000*eps);
CHECK_CLOSE(fvalue, f2, eps);
}
}
}
TEST(ContOrthoPoly1D_cov8)
{
const double eps = 1.0e-12;
MersenneTwister rng;
const unsigned npoints = 64;
const unsigned maxdeg = 6;
const unsigned ntries = 5;
const unsigned degtries = 100;
std::vector points(npoints);
for (unsigned itry=0; itry points(npoints);
for (unsigned itry=0; itry r(nrandom);
for (unsigned i=0; i result(maxdeg + 1);
poly.sampleAverages(&r[0], r.size(), &result[0], maxdeg);
Matrix mat(maxdeg + 1, maxdeg + 1, 0);
std::vector acc(maxdeg + 1, 0.0L);
std::vector tmp(maxdeg + 1);
for (unsigned i=0; i(acc[deg]), result[deg], eps);
}
// Test "pairwiseSampleAverages" method
mat /= nrandom;
Matrix averages = poly.sampleProductAverages(
&r[0], r.size(), maxdeg);
Matrix refmat(mat);
CHECK((averages - refmat).maxAbsValue() < eps);
}
TEST(ContOrthoPoly1D_jacobi_2)
{
typedef ContOrthoPoly1D::PreciseQuadrature Quadrature;
const double eps = 1.0e-13;
const unsigned alpha = 3;
const unsigned beta = 4;
const unsigned maxdeg = 5;
const unsigned npoints = 64;
JacobiOrthoPoly1D jac(alpha, beta);
OrthoPoly1DWeight weight(jac);
const unsigned npt = Quadrature::minimalExactRule(2*maxdeg+alpha+beta);
Quadrature glq(npt);
ContOrthoPoly1D poly(maxdeg, glq.weightedIntegrationPoints(weight, -1.0, 1.0), OPOLY_LANCZOS);
for (unsigned i=0; i
#include
#include
#include
+#include
#include "geners/CPP11_auto_ptr.hh"
#include "npstat/nm/Matrix.hh"
#include "npstat/nm/SimpleFunctors.hh"
namespace npstat {
class StorablePolySeries1D;
class AbsClassicalOrthoPoly1D
{
public:
inline virtual ~AbsClassicalOrthoPoly1D() {}
/** Virtual copy constructor */
virtual AbsClassicalOrthoPoly1D* clone() const = 0;
/** The weight function should be normalized */
virtual long double weight(long double x) const = 0;
//@{
/** Support of the polynomial */
virtual double xmin() const = 0;
virtual double xmax() const = 0;
//@}
/** Maximum polynomial degree supported */
inline virtual unsigned maxDegree() const {return UINT_MAX - 1U;}
/** Polynomial values */
long double poly(unsigned deg, long double x) const;
/**
// Values of two orthonormal polynomials.
// Faster than calling "poly" two times.
*/
std::pair twopoly(
unsigned deg1, unsigned deg2, long double x) const;
/**
// Values of all orthonormal polynomials up to some degree.
// Faster than calling "poly" multiple times. The size of
// the "values" array should be at least maxdeg + 1.
*/
void allpoly(long double x, long double* values, unsigned maxdeg) const;
/** Polynomial series */
double series(const double* coeffs, unsigned maxdeg, double x) const;
/** Integral of the series */
double integrateSeries(const double* coeffs, unsigned maxdeg) const;
/**
// Build the coefficients of the orthogonal polynomial series
// for the given function. The length of the array "coeffs"
// should be at least maxdeg + 1. Note that the coefficients
// are returned in the order of increasing degree (same order
// is used by the "series" function).
*/
template
void calculateCoeffs(const Functor& fcn, const Quadrature& quad,
double* coeffs, unsigned maxdeg) const;
/**
// Build the coefficients of the orthogonal polynomial series
// for the given sample of points (empirical density function).
// The length of the array "coeffs" should be at least maxdeg + 1.
// Note that the coefficients are returned in the order of
// increasing degree (same order is used by the "series" function).
*/
template
void sampleCoeffs(const Numeric* coords, unsigned long lenCoords,
double* coeffs, unsigned maxdeg) const;
/**
// Estimate the variances of the coefficients returned by
// the "sampleCoeffs" function. The "coeffs" array should be
// at least maxdeg + 1 elements long and should be filled
// by a previous call to "sampleCoeffs". The "variances" array
// should have at least maxdeg + 1 elements. It will contain
// the respective variances upon return.
*/
template
void sampleCoeffVars(const Numeric* coords, unsigned long lenCoords,
const double* coeffs, unsigned maxdeg,
double* variances) const;
/**
// Estimate the covariances of the coefficients returned by
// the "sampleCoeffs" function. The "coeffs" array should be
// at least maxdeg + 1 elements long and should be filled
// by a previous call to "sampleCoeffs". The returned matrix
// will be dimensioned (maxdeg + 1) x (maxdeg + 1).
*/
template
npstat::Matrix
sampleCoeffCovariance(const Numeric* coords, unsigned long lenCoords,
const double* coeffs, unsigned maxdeg) const;
/**
// Build the coefficients of the orthogonal polynomial series
// for the given sample of points (empirical density function).
// The length of the array "coeffs" should be at least maxdeg + 1.
// Note that the coefficients are returned in the order of
// increasing degree (same order is used by the "series" function).
// Before calculating the coefficients, the coordinates are shifted
// and scaled according to x_new = (x_original - location)/scale.
// The resulting coefficients are also divided by scale.
*/
template
void sampleCoeffs(const Numeric* coords, unsigned long lenCoords,
Numeric location, Numeric scale,
double* coeffs, unsigned maxdeg) const;
/**
// Estimate the variances of the coefficients returned by
// the "sampleCoeffs" function. The "coeffs" array should be
// at least maxdeg + 1 elements long and should be filled
// by a previous call to "sampleCoeffs" with the same location
// and scale. The "variances" array should have at least maxdeg + 1
// elements. It will contain the respective variances upon return.
*/
template
void sampleCoeffVars(const Numeric* coords, unsigned long lenCoords,
Numeric location, Numeric scale,
const double* coeffs, unsigned maxdeg,
double* variances) const;
/**
// Estimate the covariances of the coefficients returned by
// the "sampleCoeffs" function. The "coeffs" array should be
// at least maxdeg + 1 elements long and should be filled
// by a previous call to "sampleCoeffs" with the same location
// and scale. The returned matrix will be dimensioned
// (maxdeg + 1) x (maxdeg + 1).
*/
template
npstat::Matrix
sampleCoeffCovariance(const Numeric* coords, unsigned long lenCoords,
Numeric location, Numeric scale,
const double* coeffs, unsigned maxdeg) const;
/**
// Build the coefficients of the orthogonal polynomial series for
// the given sample of weighted points (empirical density function).
// The first element of the pair will be treated as the coordinate
// and the second element will be treated as weight. Weights must
// not be negative. The length of the array "coeffs" should be
// at least maxdeg + 1. Note that the coefficients are returned
// in the order of increasing degree (same order is used by the
// "series" function).
*/
template
void weightedSampleCoeffs(const Pair* points, unsigned long numPoints,
double* coeffs, unsigned maxdeg) const;
/**
// Estimate the variances of the coefficients returned by the
// "weightedSampleCoeffs" function. The "coeffs" array should
// be at least maxdeg + 1 elements long and should be filled
// by a previous call to "weightedSampleCoeffs". The "variances"
// array should have at least maxdeg + 1 elements. It will contain
// the respective variances upon return. This code assumes that
// weights and coordinates are statistically independent from
// each other.
*/
template
void weightedSampleCoeffVars(const Pair* points, unsigned long nPoints,
const double* coeffs, unsigned maxdeg,
double* variances) const;
/**
// Estimate the covariances of the coefficients returned by the
// "weightedSampleCoeffs" function. The "coeffs" array should
// be at least maxdeg + 1 elements long and should be filled
// by a previous call to "weightedSampleCoeffs". The returned
// matrix will be dimensioned (maxdeg + 1) x (maxdeg + 1). This
// code assumes that weights and coordinates are statistically
// independent from each other.
*/
template
npstat::Matrix
weightedSampleCoeffCovariance(const Pair* points, unsigned long nPoints,
const double* coeffs, unsigned maxdeg) const;
/**
// Build the coefficients of the orthogonal polynomial series for
// the given sample of weighted points (empirical density function).
// The first element of the pair will be treated as the coordinate
// and the second element will be treated as weight. Weights must
// not be negative. The length of the array "coeffs" should be
// at least maxdeg + 1. Note that the coefficients are returned
// in the order of increasing degree (same order is used by the
// "series" function). Before calculating the coefficients, the
// coordinates are shifted and scaled according to
// x_new = (x_original - location)/scale. The resulting coefficients
// are also divided by scale.
*/
template
void weightedSampleCoeffs(const Pair* points, unsigned long numPoints,
typename Pair::first_type location,
typename Pair::first_type scale,
double* coeffs, unsigned maxdeg) const;
/**
// Estimate the variances of the coefficients returned by the
// "weightedSampleCoeffs" function. The "coeffs" array should
// be at least maxdeg + 1 elements long and should be filled
// by a previous call to "weightedSampleCoeffs" with the same
// location and scale. The "variances" array should have at least
// maxdeg + 1 elements. It will contain the respective variances
// upon return. This code assumes that weights and coordinates
// are statistically independent from each other.
*/
template
void weightedSampleCoeffVars(const Pair* points, unsigned long nPoints,
typename Pair::first_type location,
typename Pair::first_type scale,
const double* coeffs, unsigned maxdeg,
double* variances) const;
/**
// Estimate the covariances of the coefficients returned by the
// "weightedSampleCoeffs" function. The "coeffs" array should
// be at least maxdeg + 1 elements long and should be filled
// by a previous call to "weightedSampleCoeffs" with the same
// location and scale. The returned matrix will be dimensioned
// (maxdeg + 1) x (maxdeg + 1). This code assumes that weights
// and coordinates are statistically independent from each other.
*/
template
npstat::Matrix
weightedSampleCoeffCovariance(const Pair* points, unsigned long nPoints,
typename Pair::first_type location,
typename Pair::first_type scale,
const double* coeffs, unsigned maxdeg) const;
/**
// This method is useful for testing the numerical precision
// of the orthonormalization procedure. It returns the scalar
// products between various polynomials.
*/
template
double empiricalKroneckerDelta(const Quadrature& quad,
unsigned deg1, unsigned deg2) const;
/**
// A measure-weighted average of a product of four orthonormal
// poly values
*/
template
double jointAverage(const Quadrature& q, unsigned deg1, unsigned deg2,
unsigned deg3, unsigned deg4) const;
/**
// A measure-weighted average of a product of multiple orthonormal
// poly values. "checkedForZeros" argument should be set to "true"
// if we are sure that there are no zero elements in the "degrees"
// array.
*/
template
double jointAverage(const Quadrature& q,
const unsigned* degrees, unsigned nDegrees,
bool checkedForZeros = false) const;
/**
// An unweighted integral of the orthonormal polynomial with the
// given degree to some power. For this method, it is assumed
// that the polynomials are supported on a closed interval (without
// such an assumption unweighted integrals do not make much sense)
// and that Gauss-Legendre quadratures can be used.
*/
double integratePoly(unsigned degree, unsigned power) const;
/**
// An unweighted integral of a product of multiple orthonormal
// polynomials. For this method, it is assumed that the polynomials
// are supported on a closed interval (without such an assumption
// unweighted integrals do not make much sense) and that Gauss-Legendre
// quadratures can be used.
*/
double jointIntegral(const unsigned* degrees, unsigned nDegrees) const;
/**
// Unweighted averages of the polynomial values for the given sample.
// The length of array "averages" should be at least maxdeg + 1.
*/
template
void sampleAverages(const Numeric* coords, unsigned long lenCoords,
double* averages, unsigned maxdeg) const;
/**
// Unweighted averages of the pairwise products of the polynomial
// values for the given sample. The returned matrix will be symmetric
// and will have the dimensions (maxdeg + 1) x (maxdeg + 1).
*/
template
Matrix sampleProductAverages(const Numeric* coords,
unsigned long lenCoords,
unsigned maxdeg) const;
/**
// Unweighted average of a product of polynomial values for the
// given sample. "degrees" is the collection of polynomial degrees.
// Polynomials of these degrees will be included in the product.
*/
template
double jointSampleAverage(const Numeric* coords,
unsigned long lenCoords,
const unsigned* degrees,
unsigned lenDegrees) const;
// Similar to the previous method but calculates two averages
// simultaneously
template
std::pair twoJointSampleAverages(
const Numeric* coords, unsigned long lenCoords,
const unsigned* degrees1, unsigned lenDegrees1,
const unsigned* degrees2, unsigned lenDegrees2) const;
CPP11_auto_ptr makeStorablePolySeries(
unsigned maxPolyDeg,
const double *coeffs=0, unsigned maxdeg=0) const;
protected:
inline static int kdelta(const unsigned i, const unsigned j)
{return i == j ? 1 : 0;}
// Recurrence relationship function should return alpha
// as the first element of the pair and the square root
// of beta as the second
virtual std::pair
recurrenceCoeffs(unsigned deg) const = 0;
private:
// Helper classes
class ProdFcn : public Functor1
{
public:
inline ProdFcn(const AbsClassicalOrthoPoly1D& p,
const unsigned d1,
const unsigned d2)
: poly(p), deg1(d1), deg2(d2) {}
inline long double operator()(const long double& x) const
{
const std::pair& p =
poly.twopoly(deg1, deg2, x);
return p.first*p.second*poly.weight(x);
}
private:
const AbsClassicalOrthoPoly1D& poly;
unsigned deg1;
unsigned deg2;
};
class MultiProdFcn;
friend class MultiProdFcn;
class MultiProdFcn : public Functor1
{
public:
inline MultiProdFcn(const AbsClassicalOrthoPoly1D& p,
const unsigned* degrees, unsigned lenDegrees,
const bool includeWeight=true)
: poly(p),
degs(degrees, degrees+lenDegrees),
maxdeg(0),
weighted(includeWeight)
{
if (lenDegrees)
maxdeg = *std::max_element(degrees, degrees+lenDegrees);
}
inline long double operator()(const long double& x) const
{
long double w = 1.0L, p = 1.0L;
if (weighted)
w = poly.weight(x);
if (maxdeg)
p = poly.normpolyprod(°s[0], degs.size(), maxdeg, x);
return w*p;
}
private:
const AbsClassicalOrthoPoly1D& poly;
std::vector degs;
unsigned maxdeg;
bool weighted;
};
// For calling the function below, maxdeg should be calculated as
// *std::max_element(degrees, degrees+nDegrees)
long double normpolyprod(const unsigned* degrees, unsigned nDegrees,
unsigned maxdeg, long double x) const;
#ifdef SWIG
public:
inline double weight2(const double x) const
{return weight(x);}
inline double poly2(const unsigned deg, const double x) const
{return poly(deg, x);}
inline std::vector allpoly2(const unsigned maxdeg, const double x) const
{
std::vector p(maxdeg+1);
allpoly(x, &p[0], p.size());
return std::vector(p.begin(), p.end());
}
inline StorablePolySeries1D* makeStorablePolySeries_2(
unsigned maxPolyDeg, const std::vector& coeffs) const
{
CPP11_auto_ptr ptr;
if (coeffs.empty())
ptr = this->makeStorablePolySeries(maxPolyDeg);
else
ptr = this->makeStorablePolySeries(maxPolyDeg, &coeffs[0],
coeffs.size() - 1);
return ptr.release();
}
#endif // SWIG
};
/**
// A functor for the weight function of the given ortho poly system.
// The poly system is not copied, only a reference is used. It is
// a responsibility of the user to make sure that the lifetime of
// the poly system object exceeds the lifetime of the functor.
*/
class OrthoPoly1DWeight : public Functor1
{
public:
inline explicit OrthoPoly1DWeight(const AbsClassicalOrthoPoly1D& fcn,
const long double normfactor=1.0L)
: fcn_(fcn), norm_(normfactor) {}
inline virtual ~OrthoPoly1DWeight() {}
inline virtual long double operator()(const long double& a) const
{return norm_*fcn_.weight(a);}
private:
OrthoPoly1DWeight();
+
+ const AbsClassicalOrthoPoly1D& fcn_;
+ long double norm_;
+ };
+
+ /**
+ // A functor for a particular degree polynomial of the given ortho
+ // poly system. The poly system is not copied, only a reference is used.
+ // It is a responsibility of the user to make sure that the lifetime of
+ // the poly system object exceeds the lifetime of the functor.
+ */
+ class OrthoPoly1DDeg : public Functor1
+ {
+ public:
+ inline OrthoPoly1DDeg(const AbsClassicalOrthoPoly1D& fcn,
+ const unsigned degree,
+ const long double normfactor=1.0L)
+ : fcn_(fcn), norm_(normfactor), deg_(degree)
+ {
+ if (deg_ > fcn_.maxDegree()) throw std::invalid_argument(
+ "In npstat::OrthoPoly1DDeg::constructor: "
+ "degree argument is out of range");
+ }
+
+ inline virtual ~OrthoPoly1DDeg() {}
+
+ inline virtual long double operator()(const long double& a) const
+ {return norm_*fcn_.poly(deg_, a);}
+
+ private:
+ OrthoPoly1DDeg();
+
const AbsClassicalOrthoPoly1D& fcn_;
- const long double norm_;
+ long double norm_;
+ unsigned deg_;
};
}
#include "npstat/nm/AbsClassicalOrthoPoly1D.icc"
#endif // NPSTAT_ABSCLASSICALORTHOPOLY1D_HH_
Index: trunk/NEWS
===================================================================
--- trunk/NEWS (revision 715)
+++ trunk/NEWS (revision 716)
@@ -1,804 +1,806 @@
Version 5.3.0 - development
* Added some facilities for quadruple precision calculations. They
mostly rely on the __float128 type (gcc extension, libquadmath) and
on compiling the LAPACK/BLAS libraries with the "-freal-8-real-16"
switch.
* Added the "GaussLegendreQuadratureQ" class capable of performing
Gauss-Legendre quadratures in quadruple precision.
* Added the "GaussLegendreQuadrature2D" class capable of performing
tensor-product Gauss-Legendre quadratures in two dimensions.
+* Added OrthoPoly1DDeg functor.
+
Version 5.2.0 - July 20 2020, by I. Volobouev
* Added a number of .i files.
* Added classes "DiscreteGauss1DBuilder" and "DiscreteGaussCopulaSmoother".
* Added class "MatrixFilter1DBuilder".
* Added facilities for saddlepoint approximations: classes AbsCGF1D and
SeriesCGF1D, function saddlepointDistribution1D, as well as class
ExpTiltedDistribution1D which can be useful in saddlepoint approximation
precision studies.
* Added class "DensityOrthoPoly1D" for building orthonormal polynomial
systems using (almost) arbitrary 1-d densities as weights.
* Added "empiricalMoment" method to the AbsDistribution1D class.
* Added class "HeatEq1DNeumannBoundary".
* Added methods "sampleAverages" and "sampleProductAverages" to the
ContOrthoPoly1D class.
* Added method "expectation" to the AbsDistribution1D class.
Version 5.1.0 - Nov 17 2019, by I. Volobouev
* Started using python-specific features (pythonprepend, etc) in the
SWIG .i files.
* Added function "scannedKSDistance".
* Added Python API for persistence of several classes.
Version 5.0.0 - Oct 17 2019, by I. Volobouev
* C++11 support is now mandatory.
* Added more classes and functions to Python API. Overhauled some of
the existing interfaces. Updated everything to python3.
* Increased the maximum order of "classical" Edgeworth expansions to 14.
* Increased the maximum order of conversions between 1-d central moments
and cumulants to 20.
* Added "histoQuantiles" function.
* Added "correctDensityEstimateGHU" function.
* Added "randomHistoFill1D" utility function.
* Added ComparisonDistribution1D class.
* Added classes GaussND, LinTransformedDistroND, and DistributionMixND.
* Added a lot of SWIG .i files
Version 4.11.0 - July 22 2019, by I. Volobouev
* Added support for cumulant calculations for various Wald statistics
in the Poisson process model.
* Added functions convertCumulantsToCentralMoments and
convertCentralMomentsToCumulants (header file cumulantConversion.hh).
* Added function "cumulantUncertainties".
Version 4.10.0 - July 11 2019, by I. Volobouev
* Added SemiInfGaussianQuadrature class.
* Added functions arrayMoment, arrayMoments, and arrayCentralMoments.
* Added enum EdgeworthSeriesMethod and class EdgeworthSeries1D.
* Added DeltaMixture1D class.
* Added enum LikelihoodStatisticType.
* Added functions "mixtureModelCumulants" and "poissonProcessCumulants"
in the header likelihoodStatisticCumulants.hh.
Version 4.9.0 - Dec 18 2018, by I. Volobouev
* Added "integratePoly" and "jointIntegral" methods to the
AbsClassicalOrthoPoly1D class.
* Added utility functions "truncatedInverseSqrt" and "matrixIndexPairs".
* Added a number of functions to "orthoPoly1DVProducts.hh".
* Added classes ChebyshevOrthoPoly1st and ChebyshevOrthoPoly2nd inheriting
from AbsClassicalOrthoPoly1D.
* Added class HermiteProbOrthoPoly1D.
* Added FejerQuadrature class.
* Added classe IsoscelesTriangle1D and Logistic1D.
* Added classes AbsKDE1DKernel and KDE1DHOSymbetaKernel.
* Added static function "optimalDegreeHart" to OSDE1D class.
Version 4.8.0 - Jul 9 2018, by I. Volobouev
* Added ShiftedLegendreOrthoPoly1D class.
* Added Lanczos method to generate recurrence coefficients for the
ContOrthoPoly1D class.
* Added npstat/stat/orthoPoly1DVProducts.hh file with various utilities
for statistical analyis of chaos polynomials.
Version 4.7.0 - Jan 13 2018, by I. Volobouev
* Added "UniPareto1D" distribution (uniform with Pareto tail to the right).
* More coordinate/weight cases for the GaussLegendreQuadrature class.
* Added ContOrthoPoly1D class -- continuous orthogonal polynomials with
discrete measure.
* Added functions "linearLeastSquares" and "tdSymEigen" to the Matrix class.
* Added OSDE1D class.
* Added classes LocationScaleFamily1D and SinhAsinhTransform1D.
* Added new functors (CdfFunctor1D, etc) as AbsDistribution1D helpers.
* Small fix in StatAccumulatorArr.cc.
Version 4.6.0 - Jan 23 2017, by I. Volobouev
* Updated 1-d LOrPE cross validation code (classes AbsBandwidthCV,
BandwidthCVLeastSquares1D, BandwidthCVPseudoLogli1D) for use with
weighted samples in the case the sample itself is available at the
point cross validation is run.
Version 4.5.0 - Aug 01 2016, by I. Volobouev
* A small fix in OrthoPolyND.icc (switched from cycling over unsigned to
unsigned long in the scalar product function).
* Implemented Gauss-Hermite quadrature with Gaussian density weight.
* Changed the meaning of Quadratic1D and LogQuadratic1D parameters to be
consistent with Legendre polynomial coefficients on [-1, 1] (new
parameters are 1/2 of old).
* Added class MinuitUnbinnedFitFcn1D (to interfaces).
* Added function "findRootNewtonRaphson".
* Added "statUncertainties" header with various functions.
Version 4.4.0 - May 9 2016, by I. Volobouev
* Added "timestamp" function.
* Improved implementation of BinnedDensity1D::unscaledQuantile function.
Certain problems caused by round-off errors are now fixed.
* Added the capability to use the single closest parameter cells (thus
disabling actual interpolation between parameter values, for speed)
to "GridInterpolatedDistribution".
Version 4.3.0 - March 19 2016, by I. Volobouev
* Put additional assert statements inside OrthoPolyND.icc to prevent
phony "array subscript is above array bounds" messages in g++ 4.9.2.
* Improved CmdLine.hh.
* Additional methods in CopulaInterpolationND and GridInterpolatedDistribution.
* Added function "volumeDensityFromBinnedRadial".
* Added convenience method "globalFilter" to the OrthoPoly1D class.
* Initiated the transition of the Python API from Python 2 to Python 3.
Version 4.2.0 - October 29 2015, by I. Volobouev
* Added interpolation methods for the marginals to classes
"CopulaInterpolationND" and "GridInterpolatedDistribution".
* Removed assert on underflow in the "igamc" function. Now
in such cases this function simply returns 0.0.
Version 4.1.0 - July 27 2015, by I. Volobouev
* Made a few additional methods virtual in AbsNtuple.
* Declared methods "columnIndices" of AbsNtuple const (as they should be).
* Added function "weightedCopulaHisto" to build copulas for samples of
weighted points.
* Added function "weightedVariableBandwidthSmooth1D" to use variable
bandwidth smoothing with weighted histograms.
* Added "AbsWeightedMarginalSmoother" interface class for smoothing samples
of weighted points. Modified classes ConstantBandwidthSmoother1D,
JohnsonKDESmoother, and LOrPEMarginalSmoother to support this interface.
* Added class "VariableBandwidthSmoother1D" which implements both
AbsMarginalSmoother and AbsWeightedMarginalSmoother interfaces.
* Implemented cross-validation for weighted samples.
* Implemented "buildInterpolatedCompositeDistroND" for generic construction
of multivariate transfer functions.
* Implemented "buildInterpolatedDistro1DNP" for generic construction
of univariate transfer functions.
Version 4.0.1 - June 17 2015, by I. Volobouev
* Added "dump_qmc" example executable.
Version 4.0.0 - June 10 2015, by I. Volobouev
* Complete overhaul of 1-d filter-building code. Addition of new boundary
methods is a lot easier now. The user API for choosing a LOrPE boundary
method is encapsulated in the new "BoundaryHandling" class.
* Implemented a number of new filter builders with different boundary
treatments.
* Updated the "LocalPolyFilter1D" class so that it holds the local
bandwidth factors derived by the filter builders.
Version 3.8.0 - June 1 2015, by I. Volobouev
* Implemented class ConstSqFilter1DBuilder (declared in the header file
npstat/stat/Filter1DBuilders.hh). The "BoundaryMethod" enum has been
extended accordingly. Other files using this enum have been updated.
* Implemented class FoldingSqFilter1DBuilder. Similar to ConstSqFilter1DBuilder
but it also folds the kernel in addition to stretching it.
* Added virtual destructors to a number of classes.
* Added "externalMemArrayND" with various signatures to allow the use of
ArrayND with memory not managed by ArrayND.
* Added move constructors and move assignment operators to ArrayND and
Matrix classes.
Version 3.7.0 - May 10 2015, by I. Volobouev
* Better numerical derivative calculation in InterpolatedDistribution1D.cc.
* Added class "LocalMultiFilter1D" for fast generation of filters which
correspond to each orthogonal polynomial separately.
* Added a function calculating the area of n-dimensional sphere.
* Added I/O capabilities to the RadialProfileND class.
* Added class "LogRatioTransform1D".
* Added utility function "multiFill1DHistoWithCDFWeights" (header file
histoUtils.hh).
* Avoiding underflow of the incomplete gamma in "convertToSphericalRandom".
Version 3.6.0 - April 6 2015, by I. Volobouev
* Fixed Marsaglia's code calculating the Anderson-Darling statistics
(it was breaking down for large values of z).
* Added high-level driver function "simpleVariableBandwidthSmooth1D" to
automatically build the pilot estimate for "variableBandwidthSmooth1D".
* Swithched to log of sigma as Minuit parameter in "minuitFitJohnsonCurves"
instead of sigma (linear sigma would sometimes break the fit when Minuit
would come up with 0 or negative trial value for it).
* Extended "MinuitDensityFitFcn1D" class so that it could be used to fit
non-uniformly binned histograms.
* Adapted "minuitFitJohnsonCurves" function so that it could be used with
histograms templated upon DualHistoAxis.
* Added functions "fillArrayCentersPreservingAreas" and
"canFillArrayCentersPreservingAreas".
* Implemented an interface to monotonous coordinate transformations with
the intent of using them in constructing densities. Implemented a number
of transforms.
* Implemented class "TransformedDistribution1D".
* Added class "VerticallyInterpolatedDistro1D1P".
* Added utility function "fill1DHistoWithCDFWeights".
Version 3.5.0 - February 21 2015, by I. Volobouev
* Added "symPDEigenInv" method to the Matrix class.
* Added "variableCount" method to unfolding bandwidth scanner classes.
* Increased the tolerance parameters in JohnsonSu::initialize and in
JohnsonFit constructor.
* Bug fix in function "fillHistoFromText".
Version 3.4.4 - January 13 2015, by I. Volobouev
* Corrected handling of some "assert" statements so that the code compiles
correctly with the -DNDEBUG option.
Version 3.4.3 - January 5 2015, by I. Volobouev
* Implemented class MirroredGauss1D.
* Added method "getOracleData" to class UnfoldingBandwidthScanner1D.
* Bug fix in FoldingFilter1DBuilder::makeOrthoPoly.
Version 3.4.2 - December 15 2014, by I. Volobouev
* Implemented InterpolatedDistro1D1P class.
Version 3.4.1 - November 07 2014, by I. Volobouev
* Implemented "divideTransforms" function for deconvolutions.
* Implemented the Moyal distribution.
* Added "fillHistoFromText" utility function.
* Added "apply_lorpe_1d" example.
Version 3.4.0 - October 01 2014, by I. Volobouev
* Implemented Hadamard product and Hadamard ratio for matrices.
* Bug fix in the "solve_linear_system" lapack interface function.
Version 3.3.1 - August 08 2014, by I. Volobouev
* Terminate iterative refinement of the unfolding error propagation
matrix early in case the solution does not seem to improve.
Version 3.3.0 - August 05 2014, by I. Volobouev
* Added correction factors to the determination of the number of fitted
parameters in various unfolding procedures.
Version 3.2.0 - July 25 2014, by I. Volobouev
* Added "gaussianResponseMatrix" function for non-uniform binning.
* Added Pareto distribution.
* Implemented EMS unfolding with sparse matrices.
* Added methods "getObservedShape" and "getUnfoldedShape" to the AbsUnfoldND
class.
* Bug fix in the assignment operator of ProductDistributionND class. Made
class ProductDistributionND persistent.
* Bug fix in the error propagation for unfolding, in the code which takes
into account the extra normalization constant.
* Added "productResponseMatrix" function to assist in making sparse response
matrices.
* Bug fix in the factory constructor of the Cauchy1D class.
* Completed implementation of the "RatioOfNormals" class.
Version 3.1.0 - June 29 2014, by I. Volobouev
* Improved (again) random number generator for the 1-d Gaussian distribution.
Something about expectation values of normalized Hermite polynomials over
random numbers made by this generator is still not fully understood. The
standard deviation of these expectations decreases with the polynomial
order (while it should stay constant). It is possible that the numbers
of points used are simply insufficient to sample the tails correctly.
* Implemented smoothed expectation-maximization (a.k.a. D'Agostini) unfolding
for 1-d distributions in classes SmoothedEMUnfold1D and MultiscaleEMUnfold1D.
In certain usage scenarios, MultiscaleEMUnfold1D can be more efficient than
SmoothedEMUnfold1D.
* Implemented smoothed expectation-maximization unfolding for multivariate
distributions in a class SmoothedEMUnfoldND.
* Added class "UnfoldingBandwidthScanner1D" to study 1-d unfolding behavior
as a function of filter bandwidth.
* Added class "UnfoldingBandwidthScannerND" to study multivariate unfolding
behavior as a function of provided bandwidth values.
* Added DummyLocalPolyFilter1D class useful when a filter is needed which
does not smooth anything.
* Added function "poissonLogLikelihood" (header file npstat/stat/arrayStats.hh).
* Added function "pooledDiscreteTabulated1D" (header file
npstat/stat/DiscreteDistributions1D.hh).
* Implemented class UGaussConvolution1D (convolution of uniform distribution
with a Gaussian).
* Implemented gamma distribution (class Gamma1D).
* Defined interface for comparing binned distributions, AbsBinnedComparison1D.
* Implemented several comparison classes for comparing binned distributions:
PearsonsChiSquared, BinnedKSTest1D, BinnedADTest1D. Class BinnedKSTest1D
pulled in dependence on the "kstest" package.
* Made classes LocalPolyFilter1D, LocalPolyFilterND, and SequentialPolyFilterND
persistent.
* Added code generating dense filter matrices to LocalPolyFilterND and
SequentialPolyFilterND (as needed for unfolding).
* Made class MemoizingSymbetaFilterProvider persistent.
* Implemented function goldenSectionSearchOnAGrid (header file
npstat/nm/goldenSectionSearch.hh).
* Implemented function parabolicExtremum (header npstat/nm/MathUtils.hh).
* Added class DistributionMix1D (header npstat/stat/DistributionMix1D.hh).
* Added interface to solving A*X = B, with matrices X and B, to the Matrix
class (method "solveLinearSystems").
* Added "reshape" methods to the ArrayND class.
* Added "gaussianResponseMatrix" function.
* Added a section on unfolding to the documentation.
* Added "ems_unfold_1d" example program.
Version 3.0.0 - March 14 2014, by I. Volobouev
* Added interface to the LAPACK SVD routines.
* Added function "lorpeMise1D" to calculate MISE for arbitrary distributions.
* Added FoldingFilter1DBuilder class.
* Changed interfaces for several high-level functions to use
FoldingFilter1DBuilder. The major version number got bumped up.
* Split DensityScan1D.hh away from AbsDistribution1D.hh.
Version 2.7.0 - March 10 2014, by I. Volobouev
* Added code to optimize operations with diagonal matrices.
* Added discretizedDistance.hh file for simple L1 and L2 distance calculations
with numeric arrays.
* Added base class for future unfolding code.
* The "reset" method of the Matrix class was renamed into "uninitialize"
in order to be consistent with ArrayND.
* Added function "multinomialCovariance1D".
* Added "polyTimesWeight" method to the OrthoPoly1D class.
* Added methods "TtimesThis" and "timesT" to the Matrix class. These
methods are more efficient than transpose followed by multiplication.
Version 2.6.0 - January 30 2014, by I. Volobouev
* Added function "lorpeBackgroundCVDensity1D" which linearizes calculation
of the cross validation likelihood in semiparametric fits. Argument
"linearizeCrossValidation" was added to MinuitSemiparametricFitFcn1D
constructor, "lorpeBackground1D" function, etc.
* Added the ability to build filters with center point removed to classes
WeightTableFilter1DBuilder and StretchingFilter1DBuilder. The function
"symbetaLOrPEFilter1D" now has an appropriate switch.
* Added "removeRowAndColumn" method to the Matrix class.
* Added CircularBuffer class.
* Added various plugin bandwidth functions which work with non-integer
polynomial degrees.
* Switched to the Legendre polynomial basis for calculating all 1-d
orthogonal polynomials (instead of monomial basis).
* Added MemoizingSymbetaFilterProvider class.
* Added "operator+=" method to the MultivariateSumAccumulator class.
* Simplified implementation of the PolyFilterCollection1D class.
File PolyFilterCollection1D.icc is removed.
* Added "RatioOfNormals" 1-d distribution function. Only the density is
currently implemented but not the CDF.
* Added ExpMapper1d class.
Version 2.5.0 - October 15 2013, by I. Volobouev
* Added "getFilterMatrix" method to the LocalPolyFilter1D class.
* Added "genEigen" method to the Matrix class (for determination of
eigenvalues and eigenvectors of general real matrices).
* Refactored the LAPACK interface so that interface functions to floats
are automatically generated from interface functions to doubles. See
the comment at the end of the "lapack_interface.icc" file for the shell
commands to do this.
Version 2.4.0 - October 6 2013, by I. Volobouev
* Added functions "lorpeBackground1D", "lorpeBgCVPseudoLogli1D", and
"lorpeBgLogli1D".
* Added minuit interface classes "MinuitLOrPEBgCVFcn1D" and
"MinuitSemiparametricFitFcn1D".
* Added "ScalableDensityConstructor1D" class for use with Minuit interface
functions.
* Added classes AbsSymbetaFilterProvider and SymbetaPolyCollection1D.
Version 2.3.0 - October 1 2013, by I. Volobouev
* Allowed point dimensionality to be larger than the histogram dimensionality
in the "empiricalCopulaHisto" function.
* Added "keepAllFilters" method to AbsFilter1DBuilder and all derived classes.
* Implemented exclusion regions for WeightTableFilter1DBuilder and
StretchingFilter1DBuilder.
* "symbetaLOrPEFilter1D" function (in the header LocalPolyFilter1D.hh)
is updated to take the exclusion mask argument.
* Added "continuousDegreeTaper" function which can do something meaningful
with the continuous LOrPE degree parameter.
Version 2.2.0 - June 30 2013, by I. Volobouev
* Added classes DiscreteBernsteinPoly1D and BernsteinFilter1DBuilder.
* Added classes DiscreteBeta1D and BetaFilter1DBuilder.
* Added BifurcatedGauss1D class to model Gaussian-like distributions with
different sigmas on the left and right sides.
* Added virtual destructors to the classes declared in the Filter1DBuilders.hh
header.
* Added a method to the Matrix template to calculate Frobenius norm.
* Added methods to the Matrix template to calculate row and column sums.
* Added "directSum" method to the Matrix template.
* Added constructor from a subrange of another matrix to the Matrix template.
* Added code to the LocalPolyFilter1D class that generates a doubly
stochastic filter out of an arbitrary filter.
* Added "npstat/nm/definiteIntegrals.hh" header and corresponding .cc file
for various infrequently used integrals.
* Added "betaKernelsBandwidth" function.
Version 2.1.0 - June 20 2013, by I. Volobouev
* Fixed couple problems which showed up in the robust regression code
due to compiler update.
* Fixed CensoredQuantileRegressionOnKDTree::process method (needed this->
dereference for some member).
Version 2.0.0 - June 15 2013, by I. Volobouev
* Updated to use "Geners" version 1.3.0. A few interfaces were changed
(API for the string archives was removed because Geners own string archive
facilities are now adequate) so the major version number was bumped up.
Version 1.6.0 - June 12 2013, by I. Volobouev
* Updated some documentation.
* Updated fitCompositeJohnson.icc to use simplified histogram constructors.
* Bug fix in the "minuitLocalQuantileRegression1D" function.
* Changed the "quantileBinFromCdf" function to use unsigned long type for
array indices.
* Added "weightedLocalQuantileRegression1D" function (namespace npsi) for
local regression with single predictor on weighted points.
Version 1.5.0 - May 23 2013, by I. Volobouev
* Added interfaces to LAPACK routines DSYEVD, DSYEVR, and corresponding
single precision versions.
* Added the "symPSDefEffectiveRank" method to the Matrix class for
calculating effective ranks of symmetric positive semidefinite matrices.
* Added converting constructor and assignment operator to the Matrix class.
* Run the Gram-Schmidt procedure twice when orthogonal polynomials are
derived in order to improve orthogonality.
Version 1.4.0 - May 20 2013, by I. Volobouev
* Added the "append" method to the AbsNtuple class.
Version 1.3.0 - May 10 2013, by I. Volobouev
* Added the code for Hermite polynomial series.
* Improved random number generator for the 1-d Gaussian distribution.
* Added a framework for discrete 1-d distributions as well as two
concrete distribution classes (Poisson1D, DiscreteTabulated1D).
* Added functions "readCompressedStringArchiveExt" and
"writeCompressedStringArchiveExt" which can read/write either compressed
or uncompressed string archives, distinguished by file extension.
Version 1.2.1 - March 22 2013, by I. Volobouev
* Improved CmdLine.hh in the "examples/C++" directory.
* Added class QuantileTable1D.
* Added classes LeftCensoredDistribution and RightCensoredDistribution.
Version 1.2.0 - March 13 2013, by I. Volobouev
* Added convenience "fill" methods to work with the ntuples which have
small number of columns (up to 10).
* Fixed a bug in AbsRandomGenerator for univariate generators making
multivariate points.
* Added LOrPEMarginalSmoother class.
Version 1.1.1 - March 11 2013, by I. Volobouev
* Added utility function "symbetaLOrPEFilter1D" which creates 1-d LOrPE
filters using kernels from the symmetric beta family (and the Gaussian).
* Added high level driver function "lorpeSmooth1D".
* Allowed variables with zero variances for calculation of correlation
coefficients in "MultivariateSumsqAccumulator". Such variables will
have zero correlation coefficients with all other variables.
* Added rebinning constructor to the HistoND class.
Version 1.1.0 - March 8 2013, by I. Volobouev
* Changed NUHistoAxis::fltBinNumber method to produce correct results
with interpolation degree 0. It is not yet obvious which method would
work best for higher interpolation degrees.
* Added functions for converting between StringArchive and python bytearray.
They have been placed in a new header: wrap/stringArchiveToBinary.hh.
* Added methods "exportMemSlice" and "importMemSlice" to ArrayND. These
methods allow for filling array slices from unstructured memory buffers
and for exporting array slices to such memory buffers.
* Added "simpleColumnNames" function (header file AbsNtuple.hh) to generate
trivial column names when ntuple column names are not important.
* Added functions "neymanPearsonWindow1D" and "signalToBgMaximum1D".
They are declared in a new header npstat/neymanPearsonWindow1D.hh.
Version 1.0.5 - December 17 2012, by I. Volobouev
* Flush string archives before writing them out in stringArchiveIO.cc.
* Added class TruncatedDistribution1D.
Version 1.0.4 - November 14 2012, by I. Volobouev
* Added utilities for reading/writing Geners string archives to files.
* Added BinSummary class.
* Doxygen documentation improved. Every header file in stat, nm, rng,
and interfaces now has a brief description.
Version 1.0.3 - September 27 2012, by I. Volobouev
* Fixed some bugs related to moving StorableMultivariateFunctor code
from "nm" to "stat".
Version 1.0.2 - August 6 2012, by I. Volobouev
* Added converting copy constructor to the "LinInterpolatedTableND" class.
* Added StorableMultivariateFunctor class (together with the corresponding
reader class).
* Added StorableInterpolationFunctor class which inherits from the above
and can be used with interpolation tables.
* Added StorableHistoNDFunctor class which inherits from
StorableMultivariateFunctor and can be used to interpolate histogram bins.
* Added "transpose" method to HistoND class.
* Created DualAxis class.
* Created DualHistoAxis class.
* Added conversion functions between histogram and grid axes.
* Added "mergeTwoHistos" function for smooth merging of two histograms.
* Added "ProductSymmetricBetaNDCdf" functor to be used as weight in
merging histograms.
* Added CoordinateSelector class.
Version 1.0.1 - June 29 2012, by I. Volobouev
* Implemented class LinInterpolatedTableND with related supporting code.