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:
probability based on trials of 2 variables

Subject: probability based on trials of 2 variables

From: Roze Rozengard

Date: 29 Apr, 2010 16:10:22

Message: 1 of 3

There are 2 variables:
X, that has values in range Xr,
Y, that generally can have values in some other range Yr, but for given X has more chances to be in some narrow (confidence) interval.
There is also a set of measurments of couples (X, Y). It can include couples with same X and different Ys.

The question is: given additional pair of values (xx, yy), how can I know the probability to receive a this yy for this xx? Is there a Matlab function that can calculate mean and variance for given xx? I can't find it!
If the function does not exist, it can be implemented like this:
  Collect pairs (X, Y) with xx-eps <X< xx+eps, with some small eps
  Calculate probability distribution for those Ys, maybe giving more weight to Ys whose X is closer to xx.
I just do not want to implement something that already exists.

Subject: probability based on trials of 2 variables

From: Bruno Luong

Date: 29 Apr, 2010 17:17:04

Message: 2 of 3

You should look at

regression
data fitting
polyfit
incertitude estimation
correlation
conditional probability
Bayesian

The difficulty is not really find an existing canned tool, but find the right tool to your specific need.

Bruno

Subject: probability based on trials of 2 variables

From: Roger Stafford

Date: 29 Apr, 2010 18:00:23

Message: 3 of 3

"Roze Rozengard" <iritrozen@gmail.com> wrote in message <hrcb1e$2ue$1@fred.mathworks.com>...
> There are 2 variables:
> X, that has values in range Xr,
> Y, that generally can have values in some other range Yr, but for given X has more chances to be in some narrow (confidence) interval.
> There is also a set of measurments of couples (X, Y). It can include couples with same X and different Ys.
>
> The question is: given additional pair of values (xx, yy), how can I know the probability to receive a this yy for this xx? Is there a Matlab function that can calculate mean and variance for given xx? I can't find it!
> If the function does not exist, it can be implemented like this:
> Collect pairs (X, Y) with xx-eps <X< xx+eps, with some small eps
> Calculate probability distribution for those Ys, maybe giving more weight to Ys whose X is closer to xx.
> I just do not want to implement something that already exists.
---------
  If you have no a priori knowledge of your variables' joint distribution, there is nothing very sophisticated about your problem. It will of course require an immense number of pair samples to do your task with any reasonable accuracy.

  Divide up each range into discrete intervals, the fineness of these depending on the total number of samples available, and count the number of occurrences in each possible pairing. You could put these counts in a matrix. From these counts you can directly calculate the discrete conditional probabilities in the matrix. It is a simple matter of dividing each element by its corresponding column-sum or row-sum.

  Assuming there is some reasonable underlying joint density continuity, you could then attempt to fit a smooth function to these discrete conditional probabilities, taking into account of course the interval sizes.

  The role played here by matlab would be minimal as compared with the task of gathering the necessary voluminous data and putting counts into a matrix.

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