File:Regression confidence band uk.svg
From Wikimedia Commons, the free media repository
Jump to navigation
Jump to search
Size of this PNG preview of this SVG file: 540 × 360 pixels. Other resolutions: 320 × 213 pixels | 640 × 427 pixels | 1,024 × 683 pixels | 1,280 × 853 pixels | 2,560 × 1,707 pixels.
Original file (SVG file, nominally 540 × 360 pixels, file size: 39 KB)
File information
Structured data
Captions
Summary
[edit]DescriptionRegression confidence band uk.svg |
English: Plot showing a regression fit to a simulated data set, along with 95% point-wise and simultaneous confidence bands, labelled in Ukrainian.
Українська: Графік, який показує допасування регресії до імітованого набору даних разом із поточково та одночасно 95 %-вими довірчими смугами. |
Date | |
Source | |
Author |
|
Other versions |
[edit]
|
SVG development InfoField | This plot was created with Matplotlib. |
Source code InfoField | Python codeimport numpy as np
import matplotlib.pyplot as plt
import scipy.special as sp
## Розмір вибірки.
n = 50
## Значення предиктора.
XV = np.random.uniform(low=-4, high=4, size=n)
XV.sort()
## Матриця плану.
X = np.ones((n,2))
X[:,1] = XV
## Істинні коефіцієнти.
beta = np.array([0, 1.], dtype=np.float64)
## Істинні значення відгуку.
EY = np.dot(X, beta)
## Спостережувані значення відгуку.
Y = EY + np.random.normal(size=n)*np.sqrt(20)
## Отримати оцінки коефіцієнтів.
u,s,vt = np.linalg.svd(X,0)
v = np.transpose(vt)
bhat = np.dot(v, np.dot(np.transpose(u), Y)/s)
## Допасовані значення.
Yhat = np.dot(X, bhat)
## СКП та КСКП.
MSE = ((Y-EY)**2).sum()/(n-X.shape[1])
s = np.sqrt(MSE)
## Ці множники використовуються в побудові інтервалів.
XtX = np.dot(np.transpose(X), X)
V = [np.dot(X[i,:], np.linalg.solve(XtX, X[i,:])) for i in range(n)]
V = np.array(V)
## F-квантиль, що використовується в побудові інтервалу Шефе.
QF = sp.fdtri(X.shape[1], n-X.shape[1], 0.95)
## Нижня та верхня межі смуги Шефе.
D = s*np.sqrt(X.shape[1]*QF*V)
LB,UB = Yhat-D,Yhat+D
## Нижня та верхня межі поточкової смуги.
D = s*np.sqrt(2*V)
LBP,UBP = Yhat-D,Yhat+D
## Створити графік.
plt.clf()
plt.plot(XV, Y, 'o', ms=3, color='grey')
plt.plot(XV, EY, '-', color='black', label = "Істина")
plt.plot(XV, Yhat, '-', color='green', label = "Оцінка")
plt.plot(XV, LB, '-', color='red', label = "Одночасно 95 %-ва ДС")
plt.plot(XV, UB, '-', color='red')
plt.plot(XV, LBP, '-', color='blue', label = "Поточково 95 %-ва ДС")
plt.plot(XV, UBP, '-', color='blue')
plt.legend(frameon=False)
plt.ylim([-20,15])
plt.gca().set_yticks([-20,-10,0,10,20])
plt.xlim([-4,4])
plt.gca().set_xticks([-4,-2,0,2,4])
plt.xlabel("X")
plt.ylabel("Y")
plt.savefig("regression_confidence_band_uk.png")
plt.savefig("regression_confidence_band_uk.svg")
|
Licensing
[edit]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/Time | Thumbnail | Dimensions | User | Comment | |
---|---|---|---|---|---|
current | 13:15, 8 March 2021 | 540 × 360 (39 KB) | Olexa Riznyk (talk | contribs) | Legend order changed | |
13:06, 8 March 2021 | 540 × 360 (39 KB) | Olexa Riznyk (talk | contribs) | Uploaded a work by * File:Regression confidence band.svg: {{ut|Skbkekas}} * derivative work: {{Ut|Olexa Riznyk}} from * File:Regression confidence band.svg with UploadWizard |
You cannot overwrite this file.
File usage on Commons
The following 3 pages use this file:
File usage on other wikis
The following other wikis use this file:
- Usage on uk.wikipedia.org
Metadata
This file contains additional information such as Exif metadata which may have been added by the digital camera, scanner, or software program used to create or digitize it. If the file has been modified from its original state, some details such as the timestamp may not fully reflect those of the original file. The timestamp is only as accurate as the clock in the camera, and it may be completely wrong.
Width | 432pt |
---|---|
Height | 288pt |
Structured data
Items portrayed in this file
depicts
8 March 2021
image/svg+xml
40,030 byte
360 pixel
540 pixel
afa8b9e5acddca94afaaf93a5a20296a17cedbe3
Hidden categories: