How to find PDF, CDF and the probability at a certain point from histogram ?

2 vues (au cours des 30 derniers jours)
may
may le 18 Sep 2013
Suppose that I have an array of random numbers, e.g.
X=randn(1,1000);
hist(X,100);
Using the histogram ,I want to find and plot the PDF and CDF of X, and for a constant value a, I also want to find the probabilities P(X=a) and P(X<=a).
Any help would be appreciated. Thank you.

Réponse acceptée

Image Analyst
Image Analyst le 18 Sep 2013
Is this homework? Hint: just take the counts return argument from hist() and normalize the counts array by the total number of counts. Then get cdf by using cumsum() on the normalized counts.
  7 commentaires
may
may le 18 Sep 2013
thanks a lot!
may
may le 25 Sep 2013
Modifié(e) : may le 25 Sep 2013
just a question; when I change the number of bins in hist function, I get different PDF's, the shape is the same but the numbers on Y axis are different! any help would be appreciated.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Descriptive Statistics dans Help Center et File Exchange

Produits

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by