#include <pdf1d_flat.h>
Inheritance diagram for pdf1d_flat:

In range [lo,hi] p(x)=1/(hi-lo)
Definition at line 16 of file pdf1d_flat.h.
Public Member Functions | |
| pdf1d_flat () | |
| Dflt ctor (creates flat distribution in range [0,1]). | |
| pdf1d_flat (double lo, double hi) | |
| Dflt ctor (creates flat distribution in range [lo,hi]). | |
| virtual | ~pdf1d_flat () |
| Destructor. | |
| double | sd () const |
| Return standard deviation. | |
| void | set (double lo, double hi) |
| Creates flat distribution in range [lo,hi]. | |
| double | lo () const |
| Lower limit of range. | |
| double | hi () const |
| Upper limit of range. | |
| virtual pdf1d_sampler * | new_sampler () const |
| Create a sampler object on the heap. | |
| virtual double | operator() (double x) const |
| Probability density at x. | |
| virtual double | log_p (double x) const |
| Log of probability density at x. | |
| virtual double | cdf (double x) const |
| Cumulative Probability (P(x'<x) for x' drawn from the distribution). | |
| virtual bool | cdf_is_analytic () const |
| Return true if cdf() uses an analytic implementation. | |
| virtual double | gradient (double x, double &p) const |
| Gradient of PDF at x. | |
| virtual double | log_prob_thresh (double pass_proportion) const |
| Compute threshold for PDF to pass a given proportion. | |
| virtual double | nearest_plausible (double x, double log_p_min) const |
| Compute nearest point to x which has a density above a threshold. | |
| short | version_no () const |
| Version number for I/O. | |
| virtual vcl_string | is_a () const |
| Name of the class. | |
| virtual bool | is_class (vcl_string const &s) const |
| Does the name of the class match the argument?. | |
| virtual pdf1d_pdf * | clone () const |
| Create a copy on the heap and return base class pointer. | |
| virtual void | print_summary (vcl_ostream &os) const |
| Print class to os. | |
| virtual void | b_write (vsl_b_ostream &bfs) const |
| Save class to binary file stream. | |
| virtual void | b_read (vsl_b_istream &bfs) |
| Load class from binary file stream. | |
| double | mean () const |
| Mean of distribution. | |
| double | variance () const |
| Variance of each dimension. | |
| virtual int | n_peaks () const |
| Number of peaks of distribution. | |
| virtual double | peak (int) const |
| Position of the i'th peak. | |
| virtual double | inverse_cdf (double P) const |
| The inverse cdf. | |
| virtual bool | is_valid_pdf () const |
| Return true if the object represents a valid PDF. | |
| void | get_samples (vnl_vector< double > &x) const |
| Fill x with samples drawn from distribution. | |
| bool | write_plot_file (const vcl_string &plot_file, double min_x, double max_x, int n) const |
| Write values (x,p(x)) to text file suitable for plotting. | |
Protected Member Functions | |
| void | set_mean (double m) |
| void | set_variance (double v) |
Private Attributes | |
| double | lo_ |
| double | hi_ |
| double | p_ |
| double | log_p_ |
|
|
Dflt ctor (creates flat distribution in range [0,1]).
Definition at line 19 of file pdf1d_flat.cxx. |
|
||||||||||||
|
Dflt ctor (creates flat distribution in range [lo,hi]).
Definition at line 24 of file pdf1d_flat.cxx. |
|
|
Destructor.
Definition at line 31 of file pdf1d_flat.cxx. |
|
|
Load class from binary file stream.
Implements pdf1d_pdf. Definition at line 185 of file pdf1d_flat.cxx. |
|
|
Save class to binary file stream.
Implements pdf1d_pdf. Definition at line 173 of file pdf1d_flat.cxx. |
|
|
Cumulative Probability (P(x'<x) for x' drawn from the distribution).
Reimplemented from pdf1d_pdf. Definition at line 79 of file pdf1d_flat.cxx. |
|
|
Return true if cdf() uses an analytic implementation. Default is false, as the base implementation is to draw samples from the distribution randomly to estimate cdf(x) Reimplemented from pdf1d_pdf. Definition at line 89 of file pdf1d_flat.cxx. |
|
|
Create a copy on the heap and return base class pointer.
Implements pdf1d_pdf. Definition at line 154 of file pdf1d_flat.cxx. |
|
|
Fill x with samples drawn from distribution. Utility function. This calls new_sampler() to do the work, then deletes the sampler again. If you intend calling this repeatedly, create a sampler yourself. Definition at line 131 of file pdf1d_pdf.cxx. |
|
||||||||||||
|
Gradient of PDF at x.
Implements pdf1d_pdf. Definition at line 97 of file pdf1d_flat.cxx. |
|
|
Upper limit of range.
Definition at line 42 of file pdf1d_flat.h. |
|
|
The inverse cdf. The value of x: P(x'<x) = P for x' drawn from distribution pdf. The default version of this algorithm uses sampling if !cdf_is_analytic(), and Newton-Raphson root finding otherwise. Reimplemented in pdf1d_kernel_pdf. Definition at line 287 of file pdf1d_pdf.cxx. |
|
|
Name of the class.
Reimplemented from pdf1d_pdf. Definition at line 126 of file pdf1d_flat.cxx. |
|
|
Does the name of the class match the argument?.
Reimplemented from pdf1d_pdf. Definition at line 136 of file pdf1d_flat.cxx. |
|
|
Return true if the object represents a valid PDF. This will return false, if n_dims() is 0, for example just ofter default construction. Reimplemented in pdf1d_mixture. Definition at line 125 of file pdf1d_pdf.cxx. |
|
|
Lower limit of range.
Definition at line 39 of file pdf1d_flat.h. |
|
|
Log of probability density at x. This value is also the Normalised Mahalanobis distance from the centroid to the given vector. Implements pdf1d_pdf. Definition at line 72 of file pdf1d_flat.cxx. |
|
|
Compute threshold for PDF to pass a given proportion.
Reimplemented from pdf1d_pdf. Definition at line 108 of file pdf1d_flat.cxx. |
|
|
Mean of distribution.
Definition at line 42 of file pdf1d_pdf.h. |
|
|
Number of peaks of distribution.
Definition at line 48 of file pdf1d_pdf.h. |
|
||||||||||||
|
Compute nearest point to x which has a density above a threshold. If log_p(x)>log_p_min then x returned unchanged. Otherwise x is moved (typically up the gradient) until log_p(x)>=log_p_min.
Implements pdf1d_pdf. Definition at line 115 of file pdf1d_flat.cxx. |
|
|
Create a sampler object on the heap. Caller is responsible for deletion. Implements pdf1d_pdf. Definition at line 55 of file pdf1d_flat.cxx. |
|
|
Probability density at x.
Reimplemented from pdf1d_pdf. Definition at line 64 of file pdf1d_flat.cxx. |
|
|
Position of the i'th peak.
Definition at line 51 of file pdf1d_pdf.h. |
|
|
Print class to os.
Implements pdf1d_pdf. Definition at line 164 of file pdf1d_flat.cxx. |
|
|
Return standard deviation.
Definition at line 33 of file pdf1d_flat.h. |
|
||||||||||||
|
Creates flat distribution in range [lo,hi].
Definition at line 38 of file pdf1d_flat.cxx. |
|
|
Reimplemented in pdf1d_gaussian. Definition at line 31 of file pdf1d_pdf.h. |
|
|
Definition at line 32 of file pdf1d_pdf.h. |
|
|
Variance of each dimension.
Definition at line 45 of file pdf1d_pdf.h. |
|
|
Version number for I/O.
Reimplemented from pdf1d_pdf. Definition at line 145 of file pdf1d_flat.cxx. |
|
||||||||||||||||||||
|
Write values (x,p(x)) to text file suitable for plotting. Evaluate pdf at n points in range [min_x,max_x] and write a text file, each line of which is {x p(x)}, suitable for plotting with many graph packages Definition at line 141 of file pdf1d_pdf.cxx. |
|
|
Definition at line 18 of file pdf1d_flat.h. |
|
|
Definition at line 18 of file pdf1d_flat.h. |
|
|
Definition at line 20 of file pdf1d_flat.h. |
|
|
Definition at line 19 of file pdf1d_flat.h. |
1.4.4