npstat is hosted by Hepforge, IPPP Durham
NPStat  5.10.0
LeftCensoredDistribution.hh
Go to the documentation of this file.
1 #ifndef NPSTAT_LEFTCENSOREDDISTRIBUTION_HH_
2 #define NPSTAT_LEFTCENSOREDDISTRIBUTION_HH_
3 
4 /*!
5 // \file LeftCensoredDistribution.hh
6 //
7 // \brief Distribution to represent left-censored data
8 //
9 // Author: I. Volobouev
10 //
11 // March 2013
12 */
13 
15 
16 namespace npstat {
18  {
19  public:
20  /**
21  // Constructor arguments are as follows:
22  //
23  // visiblePart -- the visible right tail of the distribution
24  //
25  // visibleFraction -- fraction of the overall distribution
26  // represented by the right tail
27  //
28  // effectiveNegativeInfinity -- where to place the Dirac delta
29  // function representing the invisible part
30  */
32  double visibleFraction,
33  double effectiveNegativeInfinity);
34 
37 
38  inline virtual LeftCensoredDistribution* clone() const
39  {return new LeftCensoredDistribution(*this);}
40 
41  virtual ~LeftCensoredDistribution();
42 
43  //@{
44  /** Simple inspector of the object properties */
45  inline const AbsDistribution1D& visible() const {return *distro_;}
46  inline double visibleFraction() const {return frac_;}
47  inline double effectiveInfinity() const {return infty_;}
48  //@}
49 
50  /** Distribution density */
51  virtual double density(double x) const;
52 
53  /** Cumulative distribution function */
54  virtual double cdf(double x) const;
55 
56  /** 1 - cdf, avoiding subtractive cancellation */
57  virtual double exceedance(double x) const;
58 
59  /** The quantile function */
60  virtual double quantile(double x) const;
61 
62  //@{
63  /** Method needed for I/O */
64  virtual gs::ClassId classId() const {return gs::ClassId(*this);}
65  virtual bool write(std::ostream& os) const;
66  //@}
67 
68  static inline const char* classname()
69  {return "npstat::LeftCensoredDistribution";}
70  static inline unsigned version() {return 1;}
71  static LeftCensoredDistribution* read(
72  const gs::ClassId& id, std::istream&);
73 
74  protected:
75  virtual bool isEqual(const AbsDistribution1D&) const;
76 
77  private:
79 
80  AbsDistribution1D* distro_;
81  double frac_;
82  double infty_;
83  };
84 }
85 
86 #endif // NPSTAT_LEFTCENSOREDDISTRIBUTION_HH_
Interface definition for 1-d continuous statistical distributions.
Definition: LeftCensoredDistribution.hh:18
virtual double cdf(double x) const
virtual bool isEqual(const AbsDistribution1D &) const
virtual double density(double x) const
virtual double exceedance(double x) const
virtual gs::ClassId classId() const
Definition: LeftCensoredDistribution.hh:64
virtual double quantile(double x) const
const AbsDistribution1D & visible() const
Definition: LeftCensoredDistribution.hh:45
virtual LeftCensoredDistribution * clone() const
Definition: LeftCensoredDistribution.hh:38
LeftCensoredDistribution(const AbsDistribution1D &visiblePart, double visibleFraction, double effectiveNegativeInfinity)
Definition: AbsArrayProjector.hh:14
Definition: AbsDistribution1D.hh:31