Pic2, the cumulative distribution function and quantile plot

Source: Internet
Author: User

Defination:

Cumulative distribution function: the cumulative distribution function (CDF) does just that. The CDF at point X tells us what
Fraction of events has occurred "to the left" of X. In other words, the CDF is the fraction
All points XI with Xi ≤ x.

Http://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.stats.cumfreq.html#scipy.stats.cumfreq
# -*- coding: utf-8 -*-"""Created on Thu Oct 23 20:29:33 2014@author: dell"""from scipy import statsimport matplotlib.pyplot as pltimport numpy as npimport randomif __name__ == ‘__main__‘:    ax1 = plt.subplot(211)    x = [random.gauss(0, 1) for i in range(1000)]    #res = stats.probplot(x, plot=plt)    mylist = stats.cumfreq(x, numbins = 100)    ax1.plot(mylist[0])        ax2 = plt.subplot(212)    mylist1 = stats.cumfreq(x, numbins = 100, defaultreallimits = [0,1])    ax2.plot(mylist1[0])    plt.show()

Defaultreallimits still does not quite understand what the definition is.

 

Bitmap: A Quantile plot is just the plot of a CDF in which the X and Y axes have been switched.

 

Probability diagram: the inverse function of probability plot Gaussian distribution will fall into the same line.

Http://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.stats.probplot.html

# -*- coding: utf-8 -*-"""Created on Thu Oct 23 20:06:03 2014@author: dell"""from scipy import statsimport matplotlib.pyplot as pltimport numpy as npimport randomif __name__ == ‘__main__‘:    nsample = 100    np.random.seed(7654321)        #A t distribution with small degrees of freedom:    ax = plt.subplot(321)    x = stats.t.rvs(3, size=nsample)    res = stats.probplot(x, plot=plt)        #A t distribution with larger degrees of freedom:        ax2 = plt.subplot(322)    x = stats.t.rvs(25, size=nsample)    res = stats.probplot(x, plot=plt)        #A mixture of two normal distributions with broadcasting:    ax3 = plt.subplot(323)    x = stats.norm.rvs(loc=[0,5], scale=[1,1.5], size=(nsample/2.,2)).ravel()    res = stats.probplot(x, plot=plt)        #A standard normal distribution:    ax4 = plt.subplot(324)    x = stats.norm.rvs(loc=0, scale=1, size=nsample)    res = stats.probplot(x, plot=plt)        # my test     ax5 = plt.subplot(325)    x = [random.gauss(0, 1) for i in range(100)]    res = stats.probplot(x, plot=plt)        #my test    ax6 = plt.subplot(326)    x = np.random.rand(100) * 100    res = stats.probplot(x, plot=plt)    plt.show()

 

Pic2, the cumulative distribution function and quantile plot

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.