This is a file from the Wikimedia Commons

File:Chi-square distributionCDF.svg

From Wikibooks, open books for an open world
Jump to navigation Jump to search

Original file(SVG file, nominally 360 × 288 pixels, file size: 24 KB)

Summary

Description
English: Plot of the cumulative chi-square distribution for values of k = {1, 2, 3, 4, 5}.
Date
Source Own work
Author Jona
SVG development
InfoField
 
The SVG code is valid.
 
This plot was created with Matplotlib.
Source code
InfoField

Python code

import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import chi2

col = {1: 'black', 2: 'blue', 3: 'green', 4: 'red', 5: 'purple'}

X = np.arange(0, 8, 0.01)

##                                                                              
## PDF                                                                          
##                                                                              

plt.clf()
plt.figure(figsize=(4,3.2))
plt.axes([0.15,0.13,0.79,0.8])
plt.hold(True)

A = []
for k in col.keys():
    plt.plot(X, chi2.pdf(X, k), '-', color=col[k], label="k="+str(k))

plt.xlabel("x")
plt.ylabel("P(x)")

bx = plt.legend(numpoints=1, handletextpad=0.5, loc="upper right")
bx.draw_frame(False)
plt.xlim(0,8)
plt.ylim(0,1)

plt.savefig("chi-square_pdf.svg")

##                                                                              
## CDF                                                                          
##                                                                              

plt.clf()
plt.figure(figsize=(4,3.2))
plt.axes([0.15,0.13,0.79,0.8])
plt.hold(True)

A = []
for k in col.keys():
    a = plt.plot(X, chi2.cdf(X, k), '-', color=col[k], label="k="+str(k))
    A.append(a)

plt.xlabel("x")
plt.ylabel(u"P(X\N{Less-THAN OR EQUAL TO}x)")

bx = plt.legend(numpoints=1, handletextpad=0.5, loc="lower right")
bx.draw_frame(False)
plt.xlim(0,8)
plt.ylim(0,1)

plt.savefig("chi-square_cdf.svg")

Licensing

I, the copyright holder of this work, hereby publish it under the following license:
w:en:Creative Commons
attribution share alike
This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license.
You are free:
  • to share – to copy, distribute and transmit the work
  • to remix – to adapt the work
Under the following conditions:
  • attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
  • share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.

Captions

Add a one-line explanation of what this file represents

Items portrayed in this file

depicts

20 November 2018

image/svg+xml

8b2f17791cb51bdf8b63820659b38af5d81b24ba

24,076 byte

288 pixel

360 pixel

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current21:25, 20 November 2018Thumbnail for version as of 21:25, 20 November 2018360 × 288 (24 KB)JonaUser created page with UploadWizard

There are no pages that use this file.

Global file usage

The following other wikis use this file:

Metadata