File:Binomial confidence band uk.svg

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

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

Captions

Captions

Add a one-line explanation of what this file represents

Summary

[edit]
Description
English: Illustration of confidence bands using simulated data, labelled in Ukrainian
Українська: Ілюстрація довірчих смуг із застосуванням імітованих даних
Date
Source
Author
Other versions

[edit]

SVG development
InfoField
 
The SVG code is valid.
 
This plot was created with Matplotlib.
 
The file size of this SVG plot may be irrationally large because its text has been converted to paths inhibiting translations.
Source code
InfoField

Python code

import numpy as np
import matplotlib.pyplot as plt
import scipy.special as sp

X = np.arange(18, 81, 2)

P = 1/(1+np.exp(1-0.2*np.sqrt(X-18)))

Y,S,n = [],[],500
for i,x in enumerate(X):
    y = 1*(np.random.uniform(size=n)<P[i])
    p = y.mean()
    Y.append(p)
    S.append(np.sqrt(p*(1-p)/n))
Y = np.array(Y)
S = np.array(S)

## Множник для одночасно 95 %-вої довірчої смуги із застосуванням методу Бонферроні.
f = -sp.ndtri(0.025/len(P))

plt.clf()
plt.plot(X, Y, '-', color='black', label = 'Оцінка')
plt.plot(X, Y+2*S, '-', color='royalblue', label = 'Поточково 95 %-ва ДС')
plt.plot(X, Y-2*S, '-', color='royalblue')
plt.plot(X, Y+f*S, '-', color='orangered', label = 'Одночасно 95 %-ва ДС')
plt.plot(X, Y-f*S, '-', color='orangered')
plt.plot(X, P, '-', color='green', label = "Істинні частки")
plt.ylim(0,1)
plt.xlim(18,80)
plt.legend(frameon=False)
plt.xlabel("Вік")
plt.ylabel("Частка тих, хто підтримує кандидата А")
plt.savefig("binomial_confidence_band_uk.png")
plt.savefig("binomial_confidence_band_uk.svg")

Licensing

[edit]
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.

File history

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

Date/TimeThumbnailDimensionsUserComment
current12:38, 8 March 2021Thumbnail for version as of 12:38, 8 March 2021540 × 360 (42 KB)Olexa Riznyk (talk | contribs)Uploaded a work by * File:Binomial confidence band.svg: {{ut|Skbkekas}} * derivative work: {{Ut|Olexa Riznyk}} from * File:Binomial confidence band.svg with UploadWizard

File usage on other wikis

The following other wikis use this file:

Metadata