File:Binomial confidence band.svg
From Wikimedia Commons, the free media repository
Binomial_confidence_band.svg (SVG file, nominally 720 × 540 pixels, file size: 43 KB)
[edit] Summary
| Description |
English: Illustration of confidence bands using simulated data.
|
|---|---|
| Date |
11 April 2009 |
| Source |
Own work |
| Author | |
| Permission (Reusing this image) |
See below. |
[edit] Licensing
|
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) ## Multiplier for 95% simultaneous confidence band using Bonferroni method. f = -sp.ndtri(0.025/len(P)) plt.clf() a = plt.plot(X, Y, '-', color='black') plt.hold(True) b = plt.plot(X, Y+2*S, '-', color='royalblue') plt.plot(X, Y-2*S, '-', color='royalblue') c = plt.plot(X, Y+f*S, '-', color='orangered') plt.plot(X, Y-f*S, '-', color='orangered') d = plt.plot(X, P, '-', color='green') plt.ylim(0,1) plt.xlim(18,80) B = plt.legend((a,b,c,d), ('Estimate', '95% point-wise CB',\ '95% simultaneous CB', "True proportions"),\ 'upper left') B.draw_frame(False) plt.xlabel("Age") plt.ylabel("Proportion supporting candidate A") plt.savefig("binomial_confidence_band.png") plt.savefig("binomial_confidence_band.svg")
- Remove redundant categories and try to put this image in the most specific category/categories
- Remove this template
Afrikaans | Alemannisch | Català | Česky | Dansk | Deutsch | Deutsch (Sie-Form) | English | Español | Eesti | Suomi | Français | עברית | Հայերեն | Italiano | 日本語 | Magyar | Македонски | Malti | Plattdüütsch | Nederlands | Polski | Português | Română | Русский | Slovenčina | ไทย | Vèneto | 中文 | +/−
Usage:
File history
Click on a date/time to view the file as it appeared at that time.
| Date/Time | Thumbnail | Dimensions | User | Comment | |
|---|---|---|---|---|---|
| current | 04:11, 11 April 2009 | 720×540 (43 KB) | Skbkekas (Talk | contribs) | (Added the line for true proportions.) | |
| 04:02, 11 April 2009 | 720×540 (41 KB) | Skbkekas (Talk | contribs) | ({{Information |Description={{en|1=Illustration of confidence bands using simulated data.}} |Source=Own work by uploader |Author=Skbkekas |Date=April 11, 2009 |Permission= |other_versions= }} <!--{{ImageUpload|full}}-->) |
- Edit this file using an external application (See the setup instructions for more information)
File links
There are no pages that link to this file.
Global file usage
The following other wikis use this file:
- Usage of Binomial confidence band.svg on enwiki