#include <mathplot.h>
Public Member Functions | |
mpCovarianceEllipse (double cov_00=1, double cov_11=1, double cov_01=0, double quantiles=2, int segments=32, const wxString &layerName=wxT("")) | |
virtual | ~mpCovarianceEllipse () |
double | GetQuantiles () const |
void | SetQuantiles (double q) |
void | SetSegments (int segments) |
int | GetSegments () const |
void | GetCovarianceMatrix (double &cov_00, double &cov_01, double &cov_11) const |
void | SetCovarianceMatrix (double cov_00, double cov_01, double cov_11) |
Protected Member Functions | |
void | RecalculateShape () |
Protected Attributes | |
double | m_cov_00 |
double | m_cov_11 |
double | m_cov_01 |
double | m_quantiles |
int | m_segments |
A 2D ellipse, described by a 2x2 covariance matrix. The relation between the multivariate Gaussian confidence interval and the "quantiles" in this class is:
The ellipse will be always centered at the origin. Use mpMovableObject::SetCoordinateBase to move it.
mpCovarianceEllipse::mpCovarianceEllipse | ( | double | cov_00 = 1 , |
|
double | cov_11 = 1 , |
|||
double | cov_01 = 0 , |
|||
double | quantiles = 2 , |
|||
int | segments = 32 , |
|||
const wxString & | layerName = wxT("") | |||
) | [inline] |
Default constructor. Initializes to a unity diagonal covariance matrix, a 95% confidence interval (2 sigmas), 32 segments, and a continuous plot (m_continuous=true).
References mpLAYER_PLOT.
virtual mpCovarianceEllipse::~mpCovarianceEllipse | ( | ) | [inline, virtual] |
void mpCovarianceEllipse::GetCovarianceMatrix | ( | double & | cov_00, | |
double & | cov_01, | |||
double & | cov_11 | |||
) | const [inline] |
Returns the elements of the current covariance matrix:
double mpCovarianceEllipse::GetQuantiles | ( | ) | const [inline] |
int mpCovarianceEllipse::GetSegments | ( | ) | const [inline] |
void mpCovarianceEllipse::RecalculateShape | ( | ) | [protected] |
Called to update the m_shape_xs, m_shape_ys vectors, whenever a parameter changes.
References m_cov_00, m_cov_01, m_cov_11, m_quantiles, m_segments, mpMovableObject::m_shape_xs, mpMovableObject::m_shape_ys, and mpMovableObject::ShapeUpdated().
void mpCovarianceEllipse::SetCovarianceMatrix | ( | double | cov_00, | |
double | cov_01, | |||
double | cov_11 | |||
) | [inline] |
Changes the covariance matrix:
void mpCovarianceEllipse::SetQuantiles | ( | double | q | ) | [inline] |
Set how many "quantiles" to draw, that is, the confidence interval of the ellipse (see above).
void mpCovarianceEllipse::SetSegments | ( | int | segments | ) | [inline] |
double mpCovarianceEllipse::m_cov_00 [protected] |
The elements of the matrix (only 3 since cov(0,1)=cov(1,0) in any positive definite matrix).
Referenced by RecalculateShape().
double mpCovarianceEllipse::m_cov_01 [protected] |
Referenced by RecalculateShape().
double mpCovarianceEllipse::m_cov_11 [protected] |
Referenced by RecalculateShape().
double mpCovarianceEllipse::m_quantiles [protected] |
Referenced by RecalculateShape().
int mpCovarianceEllipse::m_segments [protected] |
The number of line segments that build up the ellipse.
Referenced by RecalculateShape().