Thread Subject: In MATLAB how do you compute the cdf of a set of data?

Subject: In MATLAB how do you compute the cdf of a set of data?

From: Viktoria

Date: 21 Mar, 2010 07:40:16

Message: 1 of 4

Hi! I already know how to get the cdf of a known distribution like a normal or poisson, but what if I'm only interested in the cdf of a set of data points whose histogram I already have. Is there a command that would compute it?

Subject: In MATLAB how do you compute the cdf of a set of data?

From: Bruno Luong

Date: 21 Mar, 2010 08:52:14

Message: 2 of 4

"Viktoria " <viktoria56@yahoo.com> wrote in message <ho4ih0$22s$1@fred.mathworks.com>...
> Hi! I already know how to get the cdf of a known distribution like a normal or poisson, but what if I'm only interested in the cdf of a set of data points whose histogram I already have. Is there a command that would compute it?

If the histogram is built on regular sample grid, use CUMSUM on the histogram, then normalize the result to [0,1].

Bruno

Subject: In MATLAB how do you compute the cdf of a set of data?

From: Rune Allnor

Date: 21 Mar, 2010 11:53:26

Message: 3 of 4

On 21 Mar, 08:40, "Viktoria " <viktori...@yahoo.com> wrote:
> Hi! I already know how to get the cdf of a known distribution like a normal or poisson, but what if I'm only interested in the cdf of a set of data points whose histogram I already have. Is there a command that would compute it?

Technically - no. The PDF of the process that generated the data
is usually not known, so there is no way you can compute the CDF.

However, if you accept the claim that the histogram is an estimator
for the PDF, you can use the histogram to come up with an estimate
for the CDF. This can be one in several ways:

- Brute force, non-parametric as a cumulative sum
- By parameter estimation: Postulate a distrbution
  type for the PDF (Gaussian, Rayleigh, Poisson, ...)
  and use the histogram to estimate the parameters for
  the PDF. Then insert the parameters in the corresponding
  analytic expression for the CDF.

Rune

Subject: In MATLAB how do you compute the cdf of a set of data?

From: Wayne King

Date: 21 Mar, 2010 12:31:05

Message: 4 of 4

"Viktoria " <viktoria56@yahoo.com> wrote in message <ho4ih0$22s$1@fred.mathworks.com>...
> Hi! I already know how to get the cdf of a known distribution like a normal or poisson, but what if I'm only interested in the cdf of a set of data points whose histogram I already have. Is there a command that would compute it?

Hi Viktoria, if you have the Statistics Toolbox, you can used ecdf() to get the empirical cumulative distribution function for your set of data.

see

>>doc ecdf

Wayne

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

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.

Tag Activity for This Thread
Tag Applied By Date/Time
matlab Viktoria 21 Mar, 2010 03:44:06
rssFeed for this Thread

Contact us at files@mathworks.com