File:Gamma distribution pdf.svg

From testwiki
Jump to navigation Jump to search
    Original file (SVG file, nominally 800 × 600 pixels, file size: 115 KB)

    This file is from Wikimedia Commons and may be used by other projects. The description on its file description page there is shown below.

    Summary

    Description The probability density function of Gamma distribution for different parameters. See below for the spec and Gnuplot source code.
    Date (UTC)
    Source
    Author

    Spec and Gnuplot Source Code

    For the readers who are interested in Erlang distribution, we have prepared another specific image (see right). Note that in Erlang distribution the shape parameter k must take integers.

    Originally, the pdf of Gamma distribution is

    f(x;k,θ)=xk−1e−xθθkΓ(k).

    Let α = k, and β = 1/θ. Then

    f(x;k,θ)=f(x;α,1/β)=βαxα−1e−βxΓ(α).

    Hence

    ln⁡f(x;k,θ)=αln⁡β+(α−1)ln⁡x−ln⁡Γ(α)−βx

    which directly gives the code below.

     This W3C-unspecified plot was created with Gnuplot.
    # Author: Autopilot, Ika
    # Date: 12/08/2014
    
    set term svg size 800,600 font 'Times, 24' enhanced
    set output 'gamma_dist_pdf.svg'
    set samples 1001
    
    set xtics 0,2
    set ytics 0,0.1
    set mxtics 10
    set mytics 10
    set yrange [0:0.5]
    set key top right Left reverse
    
    # Ln f(x; k, theta)
    # Commonly, we denote a = alpha = k and b = beta = 1/theta.
    ln_f(x, a, b) = a*log(b) - lgamma(a) + (a-1)*log(x) - b*x
    
    # f(x; k, theta)
    f(x, k, theta) = (x<0)? 0 : (x==0)? ((k<1)? 1/0 : (k==1)? theta : 0)\
     : (theta==0)? 0 : exp(ln_f(x, k, 1.0/theta))
    
    plot [0:20] \
        f(x, 1.0, 2.0) t "k = 1.0, {/Symbol q} = 2.0" lw 2 lc rgb "red", \
        f(x, 2.0, 2.0) t "k = 2.0, {/Symbol q} = 2.0" lw 2 lc rgb "orange", \
        f(x, 3.0, 2.0) t "k = 3.0, {/Symbol q} = 2.0" lw 2 lc rgb "yellow", \
        f(x, 5.0, 1.0) t "k = 5.0, {/Symbol q} = 1.0" lw 2 lc rgb "green", \
        f(x, 9.0, 0.5) t "k = 9.0, {/Symbol q} = 0.5" lw 2 lc rgb "black", \
    	f(x, 7.5, 1.0) t "k = 7.5, {/Symbol q} = 1.0" lw 2 lc rgb "blue", \
    	f(x, 0.5, 1.0) t "k = 0.5, {/Symbol q} = 1.0" lw 2 lc rgb "purple"
    
    set term x11
    set output
    


    This is a retouched picture, which means that it has been digitally altered from its original version. Modifications: Recreated as svg with gnuplot. The original can be viewed here: Gamma distribution pdf.png: . Modifications made by Autopilot.

    I, the copyright holder of this work, hereby publish it under the following licenses:
    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.
    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.

    This work is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or any later version. This work is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose. See version 2 and version 3 of the GNU General Public License for more details.

    You may select the license of your choice.

    Original upload log

    This image is a derivative work of the following images:

    • File:Gamma_distribution_pdf.png licensed with Cc-by-sa-3.0-migrated, GFDL, GPL
      • 2005-03-10T20:34:05Z MarkSweep 1300x975 (162472 Bytes) new version of PDF and matching CDF
      • 2005-03-10T17:45:44Z Cburnett 960x720 (138413 Bytes) Probability density function for the Gamma distribution {{GFDL}}

    Uploaded with derivativeFX

    Captions

    Add a one-line explanation of what this file represents

    Items portrayed in this file

    depicts

    26 June 2010

    117,801 byte

    image/svg+xml

    0f9fb498bdae79815e709f01ff300c06af0c7019

    File history

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

    Date/TimeThumbnailDimensionsUserComment
    current00:05, 9 December 2014Thumbnail for version as of 00:05, 9 December 2014800 × 600 (115 KB)wikimediacommons>IkamusumeFanChange curve colors for better display.

    There are no pages that use this file.