Got Questions? Get Answers.
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
plotting joint distribution?

Subject: plotting joint distribution?

From: Gary

Date: 5 Jun, 2011 06:15:07

Message: 1 of 3

Hi,

I am new to matlab and wonder if anyone would be able to help the following:
I now have a group of simulated data shown in a 1000-by-12 matrix, thus 1000 simulations and 12 variables. Does anybody know how to plot the sample joint distribution of these simulated data??? (I have spent days on this but failed to find a clue, I will be very much grateful if someone could give a hint !!!)

Thanks in advance!
Gary

Subject: plotting joint distribution?

From: ImageAnalyst

Date: 5 Jun, 2011 12:46:40

Message: 2 of 3

On Jun 5, 2:15 am, "Gary " <iamtkdk...@hotmail.com> wrote:
> Hi,
>
> I am new to matlab and wonder if anyone would be able to help the following:
> I now have a group of simulated data shown in a 1000-by-12 matrix, thus 1000 simulations and 12 variables. Does anybody know how to plot the sample joint distribution of these simulated data??? (I have spent days on this but failed to find a clue, I will be very much grateful if someone could give a hint !!!)
>
> Thanks in advance!
> Gary

------------------------------------------------
What do you mean by joint distribution? How about scatter() to plot
two variables against each other? Something like
scatter(data(:,3), data(:,7));
to plot variable 3 against variable 7.
Do you then need to find some analytical equation that would fit that
distribution? How about polyfitn by John D'Errico?
http://www.mathworks.com/matlabcentral/fileexchange/10065-polyfitn
There may be other formulas that could be better if you know something
about the expected form of your distribution.

Subject: plotting joint distribution?

From: Roger Stafford

Date: 5 Jun, 2011 13:14:04

Message: 3 of 3

"Gary " <iamtkdking@hotmail.com> wrote in message <isf6tb$boq$1@newscl01ah.mathworks.com>...
> Hi,
>
> I am new to matlab and wonder if anyone would be able to help the following:
> I now have a group of simulated data shown in a 1000-by-12 matrix, thus 1000 simulations and 12 variables. Does anybody know how to plot the sample joint distribution of these simulated data??? (I have spent days on this but failed to find a clue, I will be very much grateful if someone could give a hint !!!)
>
> Thanks in advance!
> Gary
- - - - - - - - -
  Quite aside from the plotting problem, unless you already know something about these variables' joint distribution, such as that they are known to be jointly normal or the like, then having only a 1000 samples is in general far, far too few to gather any reliable information about their joint distribution.

  If they are known to be jointly normal, then of course only their covariance is necessary to determine their joint distribution and a 1000 samples might be adequate.

  Think of it this way. Suppose that all twelve variables are restricted to the values 1 and 0 which are equally likely and are otherwise mutually independent except that they can never all be simultaneously 0. Without this second restriction the odds of being all 0 would be 1/4096. How could you be reasonably sure of such a restriction with only 1000 samples?

  As for plotting, with only two variables you can do a reasonable job of plotting joint distribution using a surface plot. However with twelve variables, even if you had an adequate number of samples, it seems a hopeless task to visualize the joint distribution of all twelve. If each variable could assume 100 different values, you would have to somehow exhibit 10^24 different joint probability values. How could you do this visually with plotting?

Roger Stafford

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us