File:T distribution 30df enhanced.svg

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

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


English: Student's t-distribution with 30 degrees of freedom. Enhanced imaging
Source Own work
Author IkamusumeFan
SVG development
Created with Matplotlib-logo.svg
This diagram was created with Matplotlib.
Path text SVG The file size of this SVG diagram may be irrationally large because its text has been converted to paths.

Plot using Python Matplotlib.


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 3.0 Unported 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 alter, transform, or build upon this work, you may distribute the resulting work only under the same or similar license to this one.

Python (Matplotlib)[edit]

import numpy as np
import matplotlib.pyplot as plt
import scipy.special as sp
X = np.arange(-4, 4, 0.01)	# range of the graph                                                                            

Q = []	# No curves at first.

# Draw the previous Student's t-distributions
nu = 30	# freedom degree = 30
for previous_nu in range(1,nu):
	mu = 0	# mean = 0
	A = np.exp(sp.gammaln((previous_nu+1)/2.0));
	B = np.exp(sp.gammaln(previous_nu/2.0))*np.sqrt(previous_nu*np.pi);
	C = (1+X*X/previous_nu)**(-(previous_nu+1)/2.0);
	Y = A*C/B;
	a = plt.plot(X, Y, '-', color='green', lw=1)

# Draw the curve of Normal distribution
mu = 0	# mean = 0
sigma = 1	# variance = 1
A = 1/(sigma*np.sqrt(2*np.pi))
B = np.exp(-(X-mu)*(X-mu)/(2*sigma*sigma));
Y = A*B
a = plt.plot(X, Y, '-', color='blue', lw=2)
# Draw the curve of Student's t-distribution
mu = 0	# mean = 0
A = np.exp(sp.gammaln((nu+1)/2.0));
B = np.exp(sp.gammaln(nu/2.0))*np.sqrt(nu*np.pi);
C = (1+X*X/nu)**(-(nu+1)/2.0);
Y = A*C/B;
a = plt.plot(X, Y, '-', color='red', lw=2)
# Remaining steps to finish drawing the graph. 

# Saving the output.

File history

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

current09:10, 29 April 2016Thumbnail for version as of 09:10, 29 April 2016360 × 360 (67 KB)IkamusumeFan (talk | contribs)revise based on discussions
04:55, 21 July 2013Thumbnail for version as of 04:55, 21 July 2013360 × 360 (86 KB)IkamusumeFan (talk | contribs)The previous edition is wrong on the degrees of freedom.
04:26, 21 July 2013Thumbnail for version as of 04:26, 21 July 2013360 × 360 (86 KB)IkamusumeFan (talk | contribs)Thicker lines for visibility.
04:16, 21 July 2013Thumbnail for version as of 04:16, 21 July 2013360 × 360 (86 KB)IkamusumeFan (talk | contribs)User created page with UploadWizard
  • You cannot overwrite this file.

There are no pages that use this file.

File usage on other wikis

The following other wikis use this file: