npstat is hosted by Hepforge, IPPP Durham
NPStat  5.10.0
JohnsonOrthoPoly1D.hh
Go to the documentation of this file.
1 #ifndef NPSTAT_JOHNSONORTHOPOLY1D_HH_
2 #define NPSTAT_JOHNSONORTHOPOLY1D_HH_
3 
4 /*!
5 // \file JohnsonOrthoPoly1D.hh
6 //
7 // \brief Continuous orthonormal polynomial series in one dimension
8 // generated for a Johnson curve used as the weight
9 //
10 // Author: I. Volobouev
11 //
12 // November 2022
13 */
14 
15 #include <vector>
16 
17 #include "geners/CPP11_auto_ptr.hh"
18 
20 #include "npstat/nm/Recurrence.hh"
22 
24 
25 namespace npstat {
27  {
28  public:
29  /**
30  // "nIntegPoints" parameter is the number of integration points
31  // for the Gauss-Hermite quadrature.
32  */
34  unsigned maxDegree,
35  unsigned nIntegPoints = 256U,
36  OrthoPolyMethod m = OPOLY_STIELTJES);
37 
39  JohnsonOrthoPoly1D& operator=(const JohnsonOrthoPoly1D&);
40 
41  inline virtual ~JohnsonOrthoPoly1D() {}
42 
43  inline virtual JohnsonOrthoPoly1D* clone() const
44  {return new JohnsonOrthoPoly1D(*this);}
45 
46  inline virtual long double weight(const long double x) const
47  {return distro_->density(x);}
48  inline virtual double xmin() const {return distro_->quantile(0.0);}
49  inline virtual double xmax() const {return distro_->quantile(1.0);}
50  inline virtual unsigned maxDegree() const {return maxdeg_;}
51 
52  virtual std::pair<long double,long double>
53  monicRecurrenceCoeffs(unsigned deg) const;
54 
55  virtual std::pair<long double,long double>
56  recurrenceCoeffs(unsigned deg) const;
57 
58  private:
59  void initialize(unsigned nIntegPoints, OrthoPolyMethod m);
60 
61  CPP11_auto_ptr<AbsDistribution1D> distro_;
62  std::vector<Private::Recurrence> rCoeffs_;
63  unsigned maxdeg_;
64  };
65 }
66 
67 #endif // NPSTAT_JOHNSONORTHOPOLY1D_HH_
Base class for classical continuous orthonormal polynomials.
Interface definition for 1-d continuous statistical distributions.
Enumeration of methods used to create orthogonal polynomials with discrete weights.
Definition: AbsClassicalOrthoPoly1D.hh:32
Definition: JohnsonOrthoPoly1D.hh:27
virtual double xmin() const
Definition: JohnsonOrthoPoly1D.hh:48
virtual unsigned maxDegree() const
Definition: JohnsonOrthoPoly1D.hh:50
JohnsonOrthoPoly1D(const AbsDistribution1D &distro, unsigned maxDegree, unsigned nIntegPoints=256U, OrthoPolyMethod m=OPOLY_STIELTJES)
virtual long double weight(const long double x) const
Definition: JohnsonOrthoPoly1D.hh:46
virtual JohnsonOrthoPoly1D * clone() const
Definition: JohnsonOrthoPoly1D.hh:43
Definition: AbsArrayProjector.hh:14
OrthoPolyMethod
Definition: OrthoPolyMethod.hh:20
Definition: AbsDistribution1D.hh:31