Jump to content

File:Generalized normal densities.svg

Page contents not supported in other languages.
This is a file from the Wikimedia Commons
From Wikipedia, the free encyclopedia

Original file (SVG file, nominally 720 × 540 pixels, file size: 110 KB)

Summary

Description
English: Plots of the probability density functions for several members of the generalized normal family of probability distributions.
Date
Source Own work
Author Skbkekas
SVG development
InfoField
 
The SVG code is valid.
 
This plot was created with Matplotlib.
Source code
InfoField

Python code

##
## Python code to generate density and CDF plots for the
## generalized normal distribution (requires matplotlib, numpy,
## and the special functions module of scipy).
##
 
import matplotlib.pyplot as plt
import numpy as np
import scipy.special as sp
 
def dens(X, a, b, mu):
    Y = np.abs(X-mu)/a
    Y = np.exp(-Y**b)
    Y = Y*b/(2*a)
    Y /= np.exp(sp.gammaln(1/float(b)))
    return Y
 
def cdf(X, a, b, mu):
    Y = dens(X, a, b, mu)
    Y = np.cumsum(Y)*(X[1]-X[0])
    return Y
 
w = 1.5
 
X = np.arange(-3, 3, 0.01)
 
plt.clf()
 
colors = ['aqua', 'black', 'lime', 'deeppink', 'darkorange', 'blue']
B = [0.5, 1, 1.5, 2, 3, 8]
 
F = []
for c,b in zip(colors, B):
    Y = dens(X, 1, b, 0)
    f = plt.plot(X, Y, '-', color=c, lw=w)
    F.append(f)
    plt.hold(True)
 
s = ["$\\beta=%s$" % b for b in B]
 
b = plt.legend(tuple(F), tuple(s), 'upper left')
plt.ylabel("Density")
b.draw_frame(False)
 
plt.savefig("generalized_normal_densities.svg")
plt.savefig("generalized_normal_densities.png")
 
plt.clf()
 
F = []
for c,b in zip(colors, B):
    Y = cdf(X, 1, b, 0)
    f = plt.plot(X, Y, '-', color=c, lw=w)
    F.append(f)
    plt.hold(True)
 
b = plt.legend(tuple(F), tuple(s), 'upper left')
plt.ylabel("Cumulative probability")
b.draw_frame(False)
plt.ylim(0,1)
 
plt.savefig("generalized_normal_cdfs.svg")
plt.savefig("generalized_normal_cdfs.png")


Licensing

I, the copyright holder of this work, hereby publish it under the following licenses:
GNU head Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled GNU Free Documentation 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 remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.
This licensing tag was added to this file as part of the GFDL licensing update.
Licence Art Libre Copyleft: This work of art is free; you can redistribute it and/or modify it according to terms of the Free Art License. You will find a specimen of this license on the Copyleft Attitude site as well as on other sites.
You may select the license of your choice.

Captions

Add a one-line explanation of what this file represents

Items portrayed in this file

depicts

27 February 2009

File history

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

Date/TimeThumbnailDimensionsUserComment
current04:03, 28 February 2009Thumbnail for version as of 04:03, 28 February 2009720 × 540 (110 KB)SkbkekasChanged colors and linewidths to match the CDF figure.
23:23, 27 February 2009Thumbnail for version as of 23:23, 27 February 2009720 × 540 (97 KB)Skbkekas{{Information |Description={{en|1=Plot of the densities for several members of the generalized normal family.}} |Source=Own work by uploader |Author=Skbkekas |Date=2009-02-27 |Permission= |other_versions= }} <!--{{ImageUpload|full}}-->

Global file usage

The following other wikis use this file: