File:T-k-quantile-function.svg
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 | |
Source code | 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:
![]() ![]() |
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.
|