File:T-k-quantile-function.svg

Uploaded by MartinThoma
Upload date 2017-02-26T12:29:29Z
MIME type image/svg+xml
Dimensions 720 × 541 px
File size 85.8 KB

Summary

Description
English: Quantile function of students distribution . It's visible that .
Deutsch: Quantilfunktion der Student-Verteilung . Es ist zu erkennen, dass gilt. ist also punktsymmetrisch.
Date
Source Own work
Author MartinThoma
SVG development
InfoField
 The SVG code is valid.
 This plot was created with Matplotlib.
Source code
InfoField

Python code

#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""Visualize the percentile function of the t_k distribution."""

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


def g(k, alphas):
    """Calculate the percentile values of a t_k distribution."""
    # Create a variable representing the distribution
    rv = scipy.stats.t(k)

    values = [rv.ppf(alpha) for alpha in alphas]
    return values


def main(xmin=0.01, xmax=0.99, samples=200):
    """Create plot."""
    font = {'size': 20}
    plt.rc('font', **font)

    alphas = np.linspace(xmin, xmax, samples)
    for k, color in [(1, '#000000'), (2, '#ff0000'), (5, '#00ff00')]:
        plt.plot(alphas, g(k, alphas),
                 color=color,
                 label=r"$t_%i(\alpha)$" % k)
    plt.title(u"Quantile function of $t_k$")
    plt.xlabel(r"""$\alpha$""")
    plt.ylabel(r"""$t_{k;\alpha}$""")
    plt.legend()
    # plt.show()
    plt.savefig("t-k-quantile-function.svg")


if __name__ == '__main__':
    main()

Licensing

I, the copyright holder of this work, hereby publish it under the following license:
Creative Commons CC-Zero This file is made available under the Creative Commons CC0 1.0 Universal Public Domain Dedication.
The person who associated a work with this deed has dedicated the work to the public domain by waiving all of their rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law. You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission.

Captions

Add a one-line explanation of what this file represents

Items portrayed in this file

depicts

26 February 2017

87,837 byte

image/svg+xml

6c41091c13fe90b984c287232d2fc25806de8777

Category:CC-Zero Category:Images by Martin Thoma/Mathematics Category:Plots Category:Self-published work Category:Student's t-distribution Category:Valid SVG created with Matplotlib code