Solved

How to plot Isocontour of a covariance matrix of a gaussian distribution?

Posted on 2013-06-06
5
1,949 Views
Last Modified: 2016-03-02
Hi Experts,
I just want to ask how you can plot the Isocontour of covariance of a Gaussian, say covariance of the code in
The covariance i am talking about is in the following code:
Here. The line of code in question are
mu = mean(top_x);     % mean vector calculation
  
Sigma = cov(top_x);   % Covariance calculation

Open in new window


i am trying to use the example:Click
but
g = gaussdens('m',[1;2],'var',[4 1;1 2]);

Open in new window

does not exist in my matlab version(Ver R2008b). The
show(g)

Open in new window

also does not work. Any idea of any function that does this job in matlab?
g = gaussdens('m',[1;2],'var',[4 1;1 2]);

Open in new window

show(g) 

Open in new window

0
Comment
Question by:wish_C
  • 3
  • 2
5 Comments
 
LVL 15

Expert Comment

by:yuk99
ID: 39227990
This tutorial is for their specific toolbox - Statlearn. You can find it on the main page: http://statlearn.free.fr/
Download and properly install the toolbox (you will need to add the toolbox path to MATLAB with setpath), then you can follow the tutorial.

You can also do similar staff with MATLAB's Statistical toolbox. See http://www.mathworks.com/help/stats/multivariate-normal-distribution.html for details.
0
 

Accepted Solution

by:
wish_C earned 0 total points
ID: 39229397
Thanks all, I managed to get it working. I use a third party function called, plot_gaussian_ellipsoid.
0
 

Author Comment

by:wish_C
ID: 39229440
Thanks yuk99, i did not try your suggestion, but i believe it may work since it is also a third party function. I actually downloaded the matlab functionm when i posted this question, but found a third party which works for me, so i did not bother to continue. Just one more question. Am trying to plot the selection in This code and the code for selecting the  top individuals in the population is this:

 top_x  = pop(b(1:options.topSize),:)

Open in new window


but anytime i look at the plot of the initial population and the selected population, they look different. The position of the selected ones are different from their position in the initial population. Why is this happening. The concern code is in ID: 39196865.
0
 
LVL 15

Expert Comment

by:yuk99
ID: 39229745
I think you are asking completely different question than was in the original question. If you have solved the original problem (running through the tutorial of Statlearn or doing the same by other tools) you should close the question and open a new one.

In the new question please show some figures to illustrate your problem? If possible show a code that simplify the problem and can be reproduced (all variables and functions are defined). It will help me to answer quicker. Actually, believe it or not, in many cases when people do this, they can find the solution by themselves.
0
 

Author Closing Comment

by:wish_C
ID: 39240433
I figured it out myself.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
squareUp  challenge 22 105
Quadratic Equation 5 57
algorithm 15 74
Energy conservation - Edward Leedskalnin 20 71
The greatest common divisor (gcd) of two positive integers is their largest common divisor. Let's consider two numbers 12 and 20. The divisors of 12 are 1, 2, 3, 4, 6, 12 The divisors of 20 are 1, 2, 4, 5, 10 20 The highest number among the c…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now