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

Definition at line 18 of file pdf1d_mixture.h.
Public Member Functions | |
| pdf1d_mixture () | |
| Dflt ctor. | |
| pdf1d_mixture (const pdf1d_mixture &) | |
| Copy ctor. | |
| pdf1d_mixture & | operator= (const pdf1d_mixture &) |
| Copy operator. | |
| virtual | ~pdf1d_mixture () |
| Destructor. | |
| 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 | nearest_plausible (double x, double log_p_min) const |
| Not Yet Implemented. | |
| void | init (const pdf1d_pdf &comp_type, int n) |
| Initialise to use n components of type comp_type. | |
| virtual pdf1d_sampler * | new_sampler () const |
| Return instance object for this PDF. | |
| unsigned | n_components () const |
| Number of components in mixture. | |
| double | weight (unsigned i) |
| Get ith weight. | |
| const vcl_vector< double > & | weights () const |
| Array of weights. | |
| vcl_vector< double > & | weights () |
| Array of weights. | |
| unsigned | nearest_comp (double x) const |
| Return index of component nearest to x. | |
| void | add_component (const pdf1d_pdf &comp) |
| Add a component to current model. | |
| void | clear () |
| Remove all components cleanly. | |
| const pdf1d_pdf & | component (unsigned i) const |
| Get ith component. | |
| vcl_vector< pdf1d_pdf * > & | components () |
| Access to components - for use by builders. | |
| const vcl_vector< pdf1d_pdf * > & | components () const |
| Access to components - for use by builders. | |
| void | set_mean_and_variance (double m, double v) |
| Set the whole pdf mean and variance values. | |
| virtual bool | is_valid_pdf () const |
| Return true if the object represents a valid PDF. | |
| 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 double | log_prob_thresh (double pass_proportion) const |
| Compute threshold for PDF to pass a given proportion. | |
| 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 Member Functions | |
| void | init () |
| void | delete_stuff () |
Private Attributes | |
| vcl_vector< pdf1d_pdf * > | component_ |
| vcl_vector< double > | weight_ |
|
|
Dflt ctor.
Definition at line 26 of file pdf1d_mixture.cxx. |
|
|
Copy ctor.
Definition at line 31 of file pdf1d_mixture.cxx. |
|
|
Destructor.
Definition at line 68 of file pdf1d_mixture.cxx. |
|
|
Add a component to current model. Clone taken of comp Definition at line 98 of file pdf1d_mixture.cxx. |
|
|
Load class from binary file stream.
Implements pdf1d_pdf. Definition at line 212 of file pdf1d_mixture.cxx. |
|
|
Save class to binary file stream.
Implements pdf1d_pdf. Definition at line 201 of file pdf1d_mixture.cxx. |
|
|
Cumulative Probability (P(x'<x) for x' drawn from the distribution).
Reimplemented from pdf1d_pdf. Definition at line 283 of file pdf1d_mixture.cxx. |
|
|
Return true if cdf() uses an analytic implementation.
Reimplemented from pdf1d_pdf. Definition at line 295 of file pdf1d_mixture.cxx. |
|
|
Remove all components cleanly.
Definition at line 120 of file pdf1d_mixture.cxx. |
|
|
Create a copy on the heap and return base class pointer.
Implements pdf1d_pdf. Definition at line 178 of file pdf1d_mixture.cxx. |
|
|
Get ith component.
Definition at line 96 of file pdf1d_mixture.h. |
|
|
Access to components - for use by builders. Use component(i) where possible Definition at line 105 of file pdf1d_mixture.h. |
|
|
Access to components - for use by builders. Care must be taken to ensure consistency when modifying Use component(i) where possible Definition at line 101 of file pdf1d_mixture.h. |
|
|
Definition at line 59 of file pdf1d_mixture.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 302 of file pdf1d_mixture.cxx. |
|
||||||||||||
|
Initialise to use n components of type comp_type. Clones taken by comp_type Definition at line 84 of file pdf1d_mixture.cxx. |
|
|
Definition at line 22 of file pdf1d_mixture.cxx. |
|
|
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 157 of file pdf1d_mixture.cxx. |
|
|
Does the name of the class match the argument?.
Reimplemented from pdf1d_pdf. Definition at line 164 of file pdf1d_mixture.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 from pdf1d_pdf. Definition at line 130 of file pdf1d_mixture.cxx. |
|
|
Log of probability density at x.
Implements pdf1d_pdf. Definition at line 256 of file pdf1d_mixture.cxx. |
|
|
Compute threshold for PDF to pass a given proportion.
Reimplemented in pdf1d_exponential, pdf1d_flat, and pdf1d_gaussian. Definition at line 67 of file pdf1d_pdf.cxx. |
|
|
Mean of distribution.
Definition at line 42 of file pdf1d_pdf.h. |
|
|
Number of components in mixture.
Definition at line 71 of file pdf1d_mixture.h. |
|
|
Number of peaks of distribution.
Definition at line 48 of file pdf1d_pdf.h. |
|
|
Return index of component nearest to x.
Definition at line 323 of file pdf1d_mixture.cxx. |
|
||||||||||||
|
Not Yet Implemented. Compute nearest point to x which has a density above a threshold If log_p(x)>log_p_min then x unchanged. Otherwise x is moved (typically up the gradient) until log_p(x)>=log_p_min.
Implements pdf1d_pdf. Definition at line 353 of file pdf1d_mixture.cxx. |
|
|
Return instance object for this PDF. Object is created on heap. Caller responsible for deletion. Implements pdf1d_pdf. Definition at line 75 of file pdf1d_mixture.cxx. |
|
|
Probability density at x.
Reimplemented from pdf1d_pdf. Definition at line 249 of file pdf1d_mixture.cxx. |
|
|
Copy operator.
Definition at line 38 of file pdf1d_mixture.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 187 of file pdf1d_mixture.cxx. |
|
|
Reimplemented in pdf1d_gaussian. Definition at line 31 of file pdf1d_pdf.h. |
|
||||||||||||
|
Set the whole pdf mean and variance values. Components and Weights should already be correct so that the error checking can work. define NDEBUG to turn off error checking. Definition at line 148 of file pdf1d_mixture.cxx. |
|
|
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 171 of file pdf1d_mixture.cxx. |
|
|
Get ith weight.
Definition at line 74 of file pdf1d_mixture.h. |
|
|
Array of weights. Warning care must be taken to ensure consistency when modifying weights Warning. Use weight(i) where possible Definition at line 83 of file pdf1d_mixture.h. |
|
|
Array of weights. Use weight(i) where possible Definition at line 78 of file pdf1d_mixture.h. |
|
||||||||||||||||||||
|
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 20 of file pdf1d_mixture.h. |
|
|
Definition at line 21 of file pdf1d_mixture.h. |
1.4.4