mpCovarianceEllipse Class Reference

#include <mathplot.h>

Inheritance diagram for mpCovarianceEllipse:
mpMovableObject mpLayer

List of all members.

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

Detailed Description

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.


Constructor & Destructor Documentation

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]

Member Function Documentation

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]

Member Data Documentation

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().

Referenced by RecalculateShape().

The number of line segments that build up the ellipse.

Referenced by RecalculateShape().


The documentation for this class was generated from the following files:

© 2003 David Schalig, 2007-2008 Davide Rondini. Generated on Sun Dec 13 12:39:25 2009 for wxMathPlot with Doxygen. Hosted on SourceForge.net Logo