<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Computer vision for dummies &#187; Chi-Square distribution</title>
	<atom:link href="https://www.visiondummy.com/tag/chi-square-distribution/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.visiondummy.com</link>
	<description>A blog about intelligent algorithms, machine learning, computer vision, datamining and more.</description>
	<lastBuildDate>Tue, 04 May 2021 14:17:31 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=3.8.39</generator>
	<item>
		<title>How to draw a covariance error ellipse?</title>
		<link>https://www.visiondummy.com/2014/04/draw-error-ellipse-representing-covariance-matrix/</link>
		<comments>https://www.visiondummy.com/2014/04/draw-error-ellipse-representing-covariance-matrix/#comments</comments>
		<pubDate>Thu, 03 Apr 2014 16:42:10 +0000</pubDate>
		<dc:creator><![CDATA[Vincent Spruyt]]></dc:creator>
				<category><![CDATA[Statistics]]></category>
		<category><![CDATA[Chi-Square distribution]]></category>
		<category><![CDATA[Confidence Ellipse]]></category>
		<category><![CDATA[Confidence Interval]]></category>
		<category><![CDATA[Error ellipse]]></category>
		<category><![CDATA[Matlab]]></category>

		<guid isPermaLink="false">http://www.visiondummy.com/?p=288</guid>
		<description><![CDATA[<p>In this post, I will show how to draw an error ellipse, a.k.a. confidence ellipse, for 2D normally distributed data. The error ellipse represents an iso-contour of the Gaussian distribution, and allows you to visualize a 2D confidence interval. The following figure shows a 95% confidence ellipse for a set of 2D normally distributed data [...]</p>
<p>The post <a rel="nofollow" href="https://www.visiondummy.com/2014/04/draw-error-ellipse-representing-covariance-matrix/">How to draw a covariance error ellipse?</a> appeared first on <a rel="nofollow" href="https://www.visiondummy.com">Computer vision for dummies</a>.</p>
]]></description>
				<content:encoded><![CDATA[<h2>Introduction</h2>
<p>In this post, I will show how to draw an error ellipse, a.k.a. confidence ellipse, for 2D normally distributed data. The error ellipse represents an iso-contour of the Gaussian distribution, and allows you to visualize a 2D confidence interval. The following figure shows a 95% confidence ellipse for a set of 2D normally distributed data samples. This confidence ellipse defines the region that contains 95% of all samples that can be drawn from the underlying Gaussian distribution.</p>
<div id="attachment_291" style="width: 381px" class="wp-caption aligncenter"><a href="http://www.visiondummy.com/wp-content/uploads/2014/04/error_ellipse1.png"><img class="size-full wp-image-291 " style="margin: 0px;" title="Error elipse" alt="Error ellipse" src="http://www.visiondummy.com/wp-content/uploads/2014/04/error_ellipse1.png" width="371" height="366" /></a><p class="wp-caption-text"><b>Figure 1.</b> 2D confidence ellipse for normally distributed data</p></div>
<p>In the next sections we will discuss how to obtain confidence ellipses for different confidence values (e.g. 99% confidence interval), and we will show how to plot these ellipses using Matlab or C++ code.</p>
<h2>Axis-aligned confidence ellipses</h2>
<p>Before deriving a general methodology to obtain an error ellipse, let&#8217;s have a look at the special case where the major axis of the ellipse is aligned with the X-axis, as shown by the following figure:</p>
<div id="attachment_294" style="width: 387px" class="wp-caption aligncenter"><a href="http://www.visiondummy.com/wp-content/uploads/2014/04/error_ellipse_axisaligned.png"><img class="size-full wp-image-294 " style="margin: 0px;" title="Confidence ellipse" alt="Confidence ellipse" src="http://www.visiondummy.com/wp-content/uploads/2014/04/error_ellipse_axisaligned.png" width="377" height="366" /></a><p class="wp-caption-text"><b>Figure 2.</b> Confidence ellipse for uncorrelated Gaussian data</p></div>
<p>The above figure illustrates that the angle of the ellipse is determined by the covariance of the data. In this case, the covariance is zero, such that the data is uncorrelated, resulting in an axis-aligned error ellipse.</p>
<table style="width: 40%;">
<caption><b>Table 1.</b><b></b> Covariance matrix of the data shown in Figure 2</caption>
<tbody>
<tr>
<td>8.4213</td>
<td>0</td>
</tr>
<tr>
<td>0</td>
<td>0.9387</td>
</tr>
</tbody>
</table>
<p>Furthermore, it is clear that the magnitudes of the ellipse axes depend on the <a title="Why divide the sample variance by N-1?" href="http://www.visiondummy.com/2014/03/divide-variance-n-1/" target="_blank">variance</a> of the data. In our case, the largest variance is in the direction of the X-axis, whereas the smallest variance lies in the direction of the Y-axis.</p>
<p>In general, the equation of an axis-aligned ellipse with a major axis of length <img src="https://www.visiondummy.com/wp-content/ql-cache/quicklatex.com-114c887a638080e42379627755bea35c_l3.png" class="ql-img-inline-formula " alt="&#50;&#97;" title="Rendered by QuickLaTeX.com" height="15" width="21" style="vertical-align: 0px;"/> and a minor axis of length <img src="https://www.visiondummy.com/wp-content/ql-cache/quicklatex.com-ce5a354033b63af80b370b364b6ea30f_l3.png" class="ql-img-inline-formula " alt="&#50;&#98;" title="Rendered by QuickLaTeX.com" height="15" width="19" style="vertical-align: 0px;"/>, centered at the origin, is defined by the following equation:</p>
<p class="ql-center-displayed-equation" style="line-height: 43px;"><span class="ql-right-eqno"> (1) </span><span class="ql-left-eqno"> &nbsp; </span><img src="https://www.visiondummy.com/wp-content/ql-cache/quicklatex.com-6850b78a0311e2035fc2fa6e6495aea5_l3.png" height="43" width="161" class="ql-img-displayed-equation " alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#101;&#113;&#117;&#97;&#116;&#105;&#111;&#110;&#42;&#125; &#92;&#108;&#101;&#102;&#116;&#40;&#92;&#102;&#114;&#97;&#99;&#123;&#32;&#120;&#32;&#125;&#32;&#123;&#32;&#97;&#32;&#125;&#92;&#114;&#105;&#103;&#104;&#116;&#41;&#94;&#50;&#32;&#43;&#32;&#92;&#108;&#101;&#102;&#116;&#40;&#92;&#102;&#114;&#97;&#99;&#123;&#32;&#121;&#32;&#125;&#32;&#123;&#32;&#98;&#32;&#125;&#92;&#114;&#105;&#103;&#104;&#116;&#41;&#94;&#50;&#32;&#61;&#32;&#49; &#92;&#101;&#110;&#100;&#123;&#101;&#113;&#117;&#97;&#116;&#105;&#111;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<p>In our case, the length of the axes are defined by the standard deviations <img src="https://www.visiondummy.com/wp-content/ql-cache/quicklatex.com-e46681c2f6f854fa4dc3c745549a1ee3_l3.png" class="ql-img-inline-formula " alt="&#92;&#115;&#105;&#103;&#109;&#97;&#95;&#120;" title="Rendered by QuickLaTeX.com" height="12" width="21" style="vertical-align: -3px;"/> and <img src="https://www.visiondummy.com/wp-content/ql-cache/quicklatex.com-5c4c0c8d35cf7a1cb2958466ec04703c_l3.png" class="ql-img-inline-formula " alt="&#92;&#115;&#105;&#103;&#109;&#97;&#95;&#121;" title="Rendered by QuickLaTeX.com" height="15" width="21" style="vertical-align: -6px;"/> of the data such that the equation of the error ellipse becomes:<br />
<a name="id2631188439"></a>
<p class="ql-center-displayed-equation" style="line-height: 56px;"><span class="ql-right-eqno"> (2) </span><span class="ql-left-eqno"> &nbsp; </span><img src="https://www.visiondummy.com/wp-content/ql-cache/quicklatex.com-656e7d98ea1acbbe34c29195714a84af_l3.png" height="56" width="192" class="ql-img-displayed-equation " alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#101;&#113;&#117;&#97;&#116;&#105;&#111;&#110;&#42;&#125;&#32; &#92;&#108;&#101;&#102;&#116;&#40;&#92;&#102;&#114;&#97;&#99;&#123;&#32;&#120;&#32;&#125;&#32;&#123;&#32;&#92;&#115;&#105;&#103;&#109;&#97;&#95;&#120;&#32;&#125;&#92;&#114;&#105;&#103;&#104;&#116;&#41;&#94;&#50;&#32;&#43;&#32;&#92;&#108;&#101;&#102;&#116;&#40;&#92;&#102;&#114;&#97;&#99;&#123;&#32;&#121;&#32;&#125;&#32;&#123;&#32;&#92;&#115;&#105;&#103;&#109;&#97;&#95;&#121;&#32;&#125;&#92;&#114;&#105;&#103;&#104;&#116;&#41;&#94;&#50;&#32;&#61;&#32;&#115; &#92;&#101;&#110;&#100;&#123;&#101;&#113;&#117;&#97;&#116;&#105;&#111;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<p>where <img src="https://www.visiondummy.com/wp-content/ql-cache/quicklatex.com-d6ac8b2d308970b24dda8f9063f56d28_l3.png" class="ql-img-inline-formula " alt="&#115;" title="Rendered by QuickLaTeX.com" height="9" width="8" style="vertical-align: 0px;"/> defines the scale of the ellipse and could be any arbitrary number (e.g. s=1). The question is now how to choose <img src="https://www.visiondummy.com/wp-content/ql-cache/quicklatex.com-d6ac8b2d308970b24dda8f9063f56d28_l3.png" class="ql-img-inline-formula " alt="&#115;" title="Rendered by QuickLaTeX.com" height="9" width="8" style="vertical-align: 0px;"/>, such that the scale of the resulting ellipse represents a chosen confidence level (e.g. a 95% confidence level corresponds to s=5.991).</p>
<p>Our 2D data is sampled from a multivariate Gaussian with zero covariance. This means that both the x-values and the y-values are normally distributed too. Therefore, the left hand side of equation (<a href="#id2631188439">2</a>) actually represents the sum of squares of independent normally distributed data samples. The sum of squared Gaussian data points is known to be distributed according to a so called <a title="Chi-Square distribution" href="https://en.wikipedia.org/wiki/Chi-squared_distribution" target="_blank">Chi-Square distribution</a>. A Chi-Square distribution is defined in terms of &#8216;degrees of freedom&#8217;, which represent the number of unknowns. In our case there are two unknowns, and therefore two degrees of freedom.</p>
<p>Therefore, we can easily obtain the probability that the above sum, and thus <img src="https://www.visiondummy.com/wp-content/ql-cache/quicklatex.com-d6ac8b2d308970b24dda8f9063f56d28_l3.png" class="ql-img-inline-formula " alt="&#115;" title="Rendered by QuickLaTeX.com" height="9" width="8" style="vertical-align: 0px;"/> equals a specific value by calculating the Chi-Square likelihood. In fact, since we are interested in a confidence interval, we are looking for the probability that <img src="https://www.visiondummy.com/wp-content/ql-cache/quicklatex.com-d6ac8b2d308970b24dda8f9063f56d28_l3.png" class="ql-img-inline-formula " alt="&#115;" title="Rendered by QuickLaTeX.com" height="9" width="8" style="vertical-align: 0px;"/> is less then or equal to a specific value which can easily be obtained using the cumulative Chi-Square distribution. As statisticians are lazy people, we usually don&#8217;t try to calculate this probability, but simply look it up in a probability table: <a title="Chi-Square probability table" href="https://people.richland.edu/james/lecture/m170/tbl-chi.html" target="_blank">https://people.richland.edu/james/lecture/m170/tbl-chi.html</a>.</p>
<p>For example, using this probability table we can easily find that, in the 2-degrees of freedom case:</p>
<p class="ql-center-displayed-equation" style="line-height: 23px;"><span class="ql-right-eqno"> &nbsp; </span><span class="ql-left-eqno"> &nbsp; </span><img src="https://www.visiondummy.com/wp-content/ql-cache/quicklatex.com-e29659250cca77e3164bab2cc48a73fd_l3.png" height="23" width="287" class="ql-img-displayed-equation " alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#101;&#113;&#117;&#97;&#116;&#105;&#111;&#110;&#42;&#125; &#80;&#40;&#115;&#32;&#60;&#32;&#53;&#46;&#57;&#57;&#49;&#41;&#32;&#61;&#32;&#49;&#45;&#48;&#46;&#48;&#53;&#32;&#61;&#32;&#48;&#46;&#57;&#53; &#92;&#101;&#110;&#100;&#123;&#101;&#113;&#117;&#97;&#116;&#105;&#111;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<p>Therefore, a 95% confidence interval corresponds to s=5.991. In other words, 95% of the data will fall inside the ellipse defined as:</p>
<p class="ql-center-displayed-equation" style="line-height: 56px;"><span class="ql-right-eqno"> (3) </span><span class="ql-left-eqno"> &nbsp; </span><img src="https://www.visiondummy.com/wp-content/ql-cache/quicklatex.com-2eec7893f6348d4dce5f005a5ee00338_l3.png" height="56" width="231" class="ql-img-displayed-equation " alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#101;&#113;&#117;&#97;&#116;&#105;&#111;&#110;&#42;&#125; &#92;&#108;&#101;&#102;&#116;&#40;&#92;&#102;&#114;&#97;&#99;&#123;&#32;&#120;&#32;&#125;&#32;&#123;&#32;&#92;&#115;&#105;&#103;&#109;&#97;&#95;&#120;&#32;&#125;&#92;&#114;&#105;&#103;&#104;&#116;&#41;&#94;&#50;&#32;&#43;&#32;&#92;&#108;&#101;&#102;&#116;&#40;&#92;&#102;&#114;&#97;&#99;&#123;&#32;&#121;&#32;&#125;&#32;&#123;&#32;&#92;&#115;&#105;&#103;&#109;&#97;&#95;&#121;&#32;&#125;&#92;&#114;&#105;&#103;&#104;&#116;&#41;&#94;&#50;&#32;&#61;&#32;&#53;&#46;&#57;&#57;&#49; &#92;&#101;&#110;&#100;&#123;&#101;&#113;&#117;&#97;&#116;&#105;&#111;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<p>Similarly, a 99% confidence interval corresponds to s=9.210 and a 90% confidence interval corresponds to s=4.605.</p>
<p>The error ellipse show by figure 2 can therefore be drawn as an ellipse with a major axis length equal to <img src="https://www.visiondummy.com/wp-content/ql-cache/quicklatex.com-31abae3b75123c073ad6a6e4d4c118a7_l3.png" class="ql-img-inline-formula " alt="&#50;&#92;&#115;&#105;&#103;&#109;&#97;&#95;&#120;&#32;&#92;&#115;&#113;&#114;&#116;&#123;&#53;&#46;&#57;&#57;&#49;&#125;" title="Rendered by QuickLaTeX.com" height="22" width="97" style="vertical-align: -4px;"/> and the minor axis length to <img src="https://www.visiondummy.com/wp-content/ql-cache/quicklatex.com-b9b8bf9a4f958430d7d298658d35b32b_l3.png" class="ql-img-inline-formula " alt="&#50;&#92;&#115;&#105;&#103;&#109;&#97;&#95;&#121;&#32;&#92;&#115;&#113;&#114;&#116;&#123;&#53;&#46;&#57;&#57;&#49;&#125;" title="Rendered by QuickLaTeX.com" height="24" width="97" style="vertical-align: -6px;"/>.</p>
<h2>Arbitrary confidence ellipses</h2>
<p>In cases where the data is not uncorrelated, such that a covariance exists, the resulting error ellipse will not be axis aligned. In this case, the reasoning of the above paragraph only holds if we temporarily define a new coordinate system such that the ellipse becomes axis-aligned, and then rotate the resulting ellipse afterwards.</p>
<p>In other words, whereas we calculated the variances <img src="https://www.visiondummy.com/wp-content/ql-cache/quicklatex.com-e46681c2f6f854fa4dc3c745549a1ee3_l3.png" class="ql-img-inline-formula " alt="&#92;&#115;&#105;&#103;&#109;&#97;&#95;&#120;" title="Rendered by QuickLaTeX.com" height="12" width="21" style="vertical-align: -3px;"/> and <img src="https://www.visiondummy.com/wp-content/ql-cache/quicklatex.com-5c4c0c8d35cf7a1cb2958466ec04703c_l3.png" class="ql-img-inline-formula " alt="&#92;&#115;&#105;&#103;&#109;&#97;&#95;&#121;" title="Rendered by QuickLaTeX.com" height="15" width="21" style="vertical-align: -6px;"/> parallel to the x-axis and y-axis earlier, we now need to calculate these variances parallel to what will become the major and minor axis of the confidence ellipse. The directions in which these variances need to be calculated are illustrated by a pink and a green arrow in figure 1.</p>
<div id="attachment_291" style="width: 381px" class="wp-caption aligncenter"><a href="http://www.visiondummy.com/wp-content/uploads/2014/04/error_ellipse1.png"><img class="size-full wp-image-291 " style="margin: 0px;" title="Error elipse" alt="Error ellipse" src="http://www.visiondummy.com/wp-content/uploads/2014/04/error_ellipse1.png" width="371" height="366" /></a><p class="wp-caption-text"><b>Figure 1.</b> 2D confidence ellipse for normally distributed data</p></div>
<p>These directions are actually the directions in which the data varies the most, and are defined by the covariance matrix. The covariance matrix can be considered as a matrix that linearly transformed some original data to obtain the currently observed data. In a previous article about <a title="What are eigenvectors and eigenvalues?" href="http://www.visiondummy.com/2014/03/eigenvalues-eigenvectors/" target="_blank">eigenvectors and eigenvalues</a> we showed that the direction vectors along such a linear transformation are the eigenvectors of the transformation matrix. Indeed, the vectors shown by pink and green arrows in figure 1, are the eigenvectors of the covariance matrix of the data, whereas the length of the vectors corresponds to the eigenvalues.</p>
<div id="amzn-assoc-ad-b3cb92d7-7679-4d6e-9628-99f6459b00ca"></div>
<p><script async src="//z-na.amazon-adsystem.com/widgets/onejs?MarketPlace=US&#038;adInstanceId=b3cb92d7-7679-4d6e-9628-99f6459b00ca"></script><br />
The eigenvalues therefore represent the spread of the data in the direction of the eigenvectors. In other words, the eigenvalues represent the variance of the data in the direction of the eigenvectors. In the case of axis aligned error ellipses, i.e. when the covariance equals zero, the eigenvalues equal the variances of the covariance matrix and the eigenvectors are equal to the definition of the x-axis and y-axis. In the case of arbitrary correlated data, the eigenvectors represent the direction of the largest spread of the data, whereas the eigenvalues define how large this spread really is.</p>
<p>Thus, the 95% confidence ellipse can be defined similarly to the axis-aligned case, with the major axis of length <img src="https://www.visiondummy.com/wp-content/ql-cache/quicklatex.com-7b3725c66b1e67b1c3fbd8a245f30f72_l3.png" class="ql-img-inline-formula " alt="&#50;&#92;&#115;&#113;&#114;&#116;&#123;&#53;&#46;&#57;&#57;&#49;&#32;&#92;&#108;&#97;&#109;&#98;&#100;&#97;&#95;&#49;&#125;" title="Rendered by QuickLaTeX.com" height="22" width="97" style="vertical-align: -5px;"/> and the minor axis of length <img src="https://www.visiondummy.com/wp-content/ql-cache/quicklatex.com-f3e7e21b4b145fbea61d5bd543d8cd22_l3.png" class="ql-img-inline-formula " alt="&#50;&#92;&#115;&#113;&#114;&#116;&#123;&#53;&#46;&#57;&#57;&#49;&#32;&#92;&#108;&#97;&#109;&#98;&#100;&#97;&#95;&#50;&#125;" title="Rendered by QuickLaTeX.com" height="22" width="97" style="vertical-align: -5px;"/>, where <img src="https://www.visiondummy.com/wp-content/ql-cache/quicklatex.com-d28b7f27106b804ac9311012dd46d840_l3.png" class="ql-img-inline-formula " alt="&#92;&#108;&#97;&#109;&#98;&#100;&#97;&#95;&#49;" title="Rendered by QuickLaTeX.com" height="18" width="18" style="vertical-align: -4px;"/> and <img src="https://www.visiondummy.com/wp-content/ql-cache/quicklatex.com-a90de865b721b1827da7f6e7155ccb3f_l3.png" class="ql-img-inline-formula " alt="&#92;&#108;&#97;&#109;&#98;&#100;&#97;&#95;&#50;" title="Rendered by QuickLaTeX.com" height="17" width="19" style="vertical-align: -3px;"/> represent the eigenvalues of the covariance matrix.</p>
<p>To obtain the orientation of the ellipse, we simply calculate the angle of the largest eigenvector towards the x-axis:</p>
<p class="ql-center-displayed-equation" style="line-height: 52px;"><span class="ql-right-eqno"> (4) </span><span class="ql-left-eqno"> &nbsp; </span><img src="https://www.visiondummy.com/wp-content/ql-cache/quicklatex.com-d7a007de26db486da1f5fb18a3293e2b_l3.png" height="52" width="157" class="ql-img-displayed-equation " alt="&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#101;&#113;&#117;&#97;&#116;&#105;&#111;&#110;&#42;&#125; &#92;&#97;&#108;&#112;&#104;&#97;&#32;&#61;&#32;&#92;&#97;&#114;&#99;&#116;&#97;&#110;&#32;&#92;&#102;&#114;&#97;&#99;&#123;&#92;&#109;&#97;&#116;&#104;&#98;&#102;&#123;&#118;&#125;&#95;&#49;&#40;&#121;&#41;&#125;&#123;&#92;&#109;&#97;&#116;&#104;&#98;&#102;&#123;&#118;&#125;&#95;&#49;&#40;&#120;&#41;&#125; &#92;&#101;&#110;&#100;&#123;&#101;&#113;&#117;&#97;&#116;&#105;&#111;&#110;&#42;&#125;" title="Rendered by QuickLaTeX.com"/></p>
<p>where <img src="https://www.visiondummy.com/wp-content/ql-cache/quicklatex.com-8571972b1a5be238454cbaecd3353721_l3.png" class="ql-img-inline-formula " alt="&#92;&#109;&#97;&#116;&#104;&#98;&#102;&#123;&#118;&#125;&#95;&#49;" title="Rendered by QuickLaTeX.com" height="15" width="20" style="vertical-align: -4px;"/> is the eigenvector of the covariance matrix that corresponds to the largest eigenvalue.</p>
<p>Based on the minor and major axis lengths and the angle <img src="https://www.visiondummy.com/wp-content/ql-cache/quicklatex.com-8970b282c5cfe9620d567cfec85d40d1_l3.png" class="ql-img-inline-formula " alt="&#92;&#97;&#108;&#112;&#104;&#97;" title="Rendered by QuickLaTeX.com" height="9" width="13" style="vertical-align: 0px;"/> between the major axis and the x-axis, it becomes trivial to plot the confidence ellipse. Figure 3 shows error ellipses for several confidence values:</p>
<div id="attachment_310" style="width: 387px" class="wp-caption aligncenter"><a href="http://www.visiondummy.com/wp-content/uploads/2014/04/error_ellipse_isocontours.png"><img class="size-full wp-image-310 " style="margin: 0px;" title="Error ellipses" alt="Error ellipses" src="http://www.visiondummy.com/wp-content/uploads/2014/04/error_ellipse_isocontours.png" width="377" height="366" /></a><p class="wp-caption-text">Confidence ellipses for normally distributed data</p></div>
<h2>Source Code</h2>
<p><a href="http://www.visiondummy.com/wp-content/uploads/2014/04/error_ellipse.m">Matlab source code</a><br />
<a href="http://www.visiondummy.com/wp-content/uploads/2014/04/error_ellipse.cpp">C++ source code (uses OpenCV)</a></p>
<h2>Conclusion</h2>
<p>In this article we showed how to obtain the error ellipse for 2D normally distributed data, according to a chosen confidence value. This is often useful when visualizing or analyzing data and will be of interest in a future article about <a href="http://www.visiondummy.com/2014/05/feature-extraction-using-pca/" title="Feature extraction using PCA">PCA</a>.</p>
<p>Furthermore, source code samples were provided for Matlab and C++.</p>
<p><strong>If you&#8217;re new to this blog, don&#8217;t forget to subscribe, or <a href="https://twitter.com/vincent_spruyt" title="Follow me on Twitter!" target="_blank">follow me on twitter</a>!</strong><br />


<!-- Form created by Optin Forms plugin by Codeleon: create beautiful optin forms with ease! -->
<!-- http://codeleon.com/products/optin-forms/ -->
<div id="optinforms-form5-container" ><form method="post" target="_blank" action="http://visiondummy.us10.list-manage.com/subscribe/post?u=c435905e10ead915f3917d694&id=bbdfb33a9f"><div id="optinforms-form5" style="background:#ffffff;"><div id="optinforms-form5-container-left"><div id="optinforms-form5-title" style="font-family:News Cycle; font-size:24px; line-height:24px; color:#fd4326">JOIN MY NEWSLETTER</div><!--optinforms-form5-title--><input type="text" id="optinforms-form5-name-field" name="FNAME" placeholder="Enter Your Name" style="font-family:Arial, Helvetica, sans-serif; font-size:12px; color:#000000" /><input type="text" id="optinforms-form5-email-field" name="EMAIL" placeholder="Enter Your Email" style="font-family:Arial, Helvetica, sans-serif; font-size:12px; color:#000000" /><input type="submit" name="submit" id="optinforms-form5-button" value="SUBSCRIBE" style="font-family:Arial, Helvetica, sans-serif; font-size:16px; color:#FFFFFF; background-color:#fd4326" /></div><!--optinforms-form5-container-left--><div id="optinforms-form5-container-right"><div id="optinforms-form5-subtitle" style="font-family:Georgia; font-size:16px; color:#444444">Receive my newsletter to get notified when new articles and code snippets become available on my blog!</div><!--optinforms-form5-subtitle--><div id="optinforms-form5-disclaimer" style="font-family:Georgia, Times New Roman, Times, serif; font-size:14px; color:#727272">We all hate spam. Your email address will not be sold or shared with anyone else.</div><!--optinforms-form5-disclaimer--></div><!--optinforms-form5-container-right--><div class="clear"></div></div><!--optinforms-form5--><div class="clear"></div></form></div><!--optinforms-form5-container--><div class="clear"></div>
<!-- / Optin Forms -->

<style type='text/css'></style></p>
<p>The post <a rel="nofollow" href="https://www.visiondummy.com/2014/04/draw-error-ellipse-representing-covariance-matrix/">How to draw a covariance error ellipse?</a> appeared first on <a rel="nofollow" href="https://www.visiondummy.com">Computer vision for dummies</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.visiondummy.com/2014/04/draw-error-ellipse-representing-covariance-matrix/feed/</wfw:commentRss>
		<slash:comments>62</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk: enhanced
Database Caching using disk
Object Caching 827/829 objects using disk

 Served from: www.visiondummy.com @ 2026-04-29 21:17:47 by W3 Total Cache -->