COMPGROUPS.NET | Search | Post Question | Groups | Stream | About | Register

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

• Email
• Follow

```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?
```
 0

See related articles to this posting

```"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
```
 0

```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
```
 0

```"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
```
 0