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

Covariance matrix is represented by its eigenvectors and values
Definition at line 24 of file vpdfl_gaussian.h.
Public Member Functions | |
| vpdfl_gaussian () | |
| Dflt ctor. | |
| virtual | ~vpdfl_gaussian () |
| Destructor. | |
| void | set (const vnl_vector< double > &mean, const vnl_vector< double > &variance, const vnl_matrix< double > &evecs, const vnl_vector< double > &evals) |
| Initialise. | |
| virtual void | set (const vnl_vector< double > &mean, const vnl_matrix< double > &evecs, const vnl_vector< double > &evals) |
| Initialise safely. | |
| void | set (const vnl_vector< double > &mean, const vnl_matrix< double > &covar, double min_eval=1e-6) |
| Initialise from mean and covariance matrix. | |
| void | set_mean (const vnl_vector< double > &mean) |
| Modify just the mean of the distribution. | |
| const vnl_matrix< double > & | eigenvecs () const |
| Eigenvectors of covariance matrix. | |
| const vnl_vector< double > & | eigenvals () const |
| Eigenvalues of covariance matrix. | |
| vnl_matrix< double > | covariance () const |
| The Covariance matrix of the Gaussian. | |
| double | log_k () const |
| log of normalisation constant for gaussian. | |
| virtual vpdfl_sampler_base * | new_sampler () const |
| Create a sampler object on the heap. | |
| virtual double | log_p (const vnl_vector< double > &x) const |
| Log of probability density at x. | |
| virtual void | gradient (vnl_vector< double > &g, const vnl_vector< 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 void | nearest_plausible (vnl_vector< 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 vpdfl_pdf_base * | 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. | |
| const vnl_vector< double > & | mean () const |
| Mean of distribution. | |
| const vnl_vector< double > & | variance () const |
| Variance of each dimension. | |
| int | n_dims () const |
| Number of dimensions. | |
| virtual int | n_peaks () const |
| Number of peaks of distribution. | |
| virtual const vnl_vector< double > & | peak (int) const |
| Position of the i'th peak. | |
| virtual double | operator() (const vnl_vector< double > &x) const |
| Probability density at x. | |
| virtual void | gradient_logp (vnl_vector< double > &g, const vnl_vector< double > &x) const |
| Gradient and value of log(p(x)) at x. | |
| virtual bool | is_valid_pdf () const |
| Return true if the object represents a valid PDF. | |
Protected Member Functions | |
| void | set_variance (const vnl_vector< double > &v) |
Protected Attributes | |
| vnl_vector< double > | dx_ |
| Workspace. | |
| vnl_vector< double > | b_ |
| Workspace. | |
Private Member Functions | |
| void | calcLogK () |
| double | dx_sigma_dx (const vnl_vector< double > &x) const |
| Calculate (x-mu)' * Sigma^-1 * (x-mu). | |
Private Attributes | |
| vnl_matrix< double > | evecs_ |
| vnl_vector< double > | evals_ |
| double | log_k_ |
|
|
Dflt ctor.
Definition at line 41 of file vpdfl_gaussian.cxx. |
|
|
Destructor.
Definition at line 47 of file vpdfl_gaussian.cxx. |
|
|
Load class from binary file stream.
Implements vpdfl_pdf_base. Reimplemented in vpdfl_pc_gaussian. Definition at line 420 of file vpdfl_gaussian.cxx. |
|
|
Save class to binary file stream.
Implements vpdfl_pdf_base. Reimplemented in vpdfl_pc_gaussian. Definition at line 406 of file vpdfl_gaussian.cxx. |
|
|
Definition at line 53 of file vpdfl_gaussian.cxx. |
|
|
Create a copy on the heap and return base class pointer.
Implements vpdfl_pdf_base. Reimplemented in vpdfl_pc_gaussian. Definition at line 346 of file vpdfl_gaussian.cxx. |
|
|
The Covariance matrix of the Gaussian. This value is calculated on the fly each time so calling this function may not be very efficient Definition at line 186 of file vpdfl_gaussian.cxx. |
|
|
Calculate (x-mu)' * Sigma^-1 * (x-mu). This is the Mahalanobis distance squared from the mean. Definition at line 206 of file vpdfl_gaussian.cxx. |
|
|
Eigenvalues of covariance matrix. The list is ordered - largest Eigenvalues first. Definition at line 89 of file vpdfl_gaussian.h. |
|
|
Eigenvectors of covariance matrix. List ordering corresponds to eVals(); Definition at line 85 of file vpdfl_gaussian.h. |
|
||||||||||||||||
|
Gradient of PDF at x.
Implements vpdfl_pdf_base. Definition at line 248 of file vpdfl_gaussian.cxx. |
|
||||||||||||
|
Gradient and value of log(p(x)) at x. Computes gradient df/dx of f(x)=log(p(x)) at x. Result is vector of same dimensionality as x. Default baseclass implementation uses gradient() to compute grad/p Reimplemented in vpdfl_axis_gaussian. Definition at line 127 of file vpdfl_pdf_base.cxx. |
|
|
Name of the class.
Reimplemented from vpdfl_pdf_base. Reimplemented in vpdfl_pc_gaussian. Definition at line 318 of file vpdfl_gaussian.cxx. |
|
|
Does the name of the class match the argument?.
Reimplemented from vpdfl_pdf_base. Reimplemented in vpdfl_pc_gaussian. Definition at line 328 of file vpdfl_gaussian.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 vpdfl_mixture. Definition at line 141 of file vpdfl_pdf_base.cxx. |
|
|
log of normalisation constant for gaussian.
Definition at line 97 of file vpdfl_gaussian.h. |
|
|
Log of probability density at x. This value is also the Normalised Mahalanobis distance from the centroid to the given vector. Implements vpdfl_pdf_base. Reimplemented in vpdfl_pc_gaussian. Definition at line 241 of file vpdfl_gaussian.cxx. |
|
|
Compute threshold for PDF to pass a given proportion.
Reimplemented from vpdfl_pdf_base. Definition at line 287 of file vpdfl_gaussian.cxx. |
|
|
Mean of distribution.
Definition at line 45 of file vpdfl_pdf_base.h. |
|
|
Number of dimensions.
Definition at line 51 of file vpdfl_pdf_base.h. |
|
|
Number of peaks of distribution.
Definition at line 54 of file vpdfl_pdf_base.h. |
|
||||||||||||
|
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 directly towards the mean (i.e. to the nearest plausible point using a Mahalobis distance) until log_p(x)=log_p_min.
Implements vpdfl_pdf_base. Definition at line 296 of file vpdfl_gaussian.cxx. |
|
|
Create a sampler object on the heap. Caller is responsible for deletion. Implements vpdfl_pdf_base. Definition at line 195 of file vpdfl_gaussian.cxx. |
|
|
Probability density at x.
Reimplemented in vpdfl_gaussian_kernel_pdf, and vpdfl_mixture. Definition at line 34 of file vpdfl_pdf_base.cxx. |
|
|
Position of the i'th peak.
Definition at line 57 of file vpdfl_pdf_base.h. |
|
|
Print class to os.
Implements vpdfl_pdf_base. Reimplemented in vpdfl_pc_gaussian. Definition at line 390 of file vpdfl_gaussian.cxx. |
|
||||||||||||||||
|
Initialise from mean and covariance matrix. Note, eigenvectors computed from covar, and those corresponding to evals smaller than min_eval are truncated This functions should only be used by builders. Definition at line 125 of file vpdfl_gaussian.cxx. |
|
||||||||||||||||
|
Initialise safely. Calculates the variance, and checks that the Eigenvalues are ordered and the Eigenvectors are unit normal Turn off assertions to remove error checking. This functions should only be used by builders. Reimplemented in vpdfl_pc_gaussian. Definition at line 67 of file vpdfl_gaussian.cxx. |
|
||||||||||||||||||||
|
Initialise. WARNING - the error checking for inconsistent parameters is not foolproof. Definition at line 99 of file vpdfl_gaussian.cxx. |
|
|
Modify just the mean of the distribution. This functions should only be used by builders. Reimplemented from vpdfl_pdf_base. Definition at line 115 of file vpdfl_gaussian.cxx. |
|
|
Definition at line 35 of file vpdfl_pdf_base.h. |
|
|
Variance of each dimension.
Definition at line 48 of file vpdfl_pdf_base.h. |
|
|
Version number for I/O.
Reimplemented from vpdfl_pdf_base. Reimplemented in vpdfl_pc_gaussian. Definition at line 337 of file vpdfl_gaussian.cxx. |
|
|
Workspace. Usually the input vector after normalisation. Definition at line 41 of file vpdfl_gaussian.h. |
|
|
Workspace. The difference between an input vector an the mean Definition at line 38 of file vpdfl_gaussian.h. |
|
|
Definition at line 27 of file vpdfl_gaussian.h. |
|
|
Definition at line 26 of file vpdfl_gaussian.h. |
|
|
Definition at line 28 of file vpdfl_gaussian.h. |
1.4.4