ไฟล์:Polyreg scheffe.svg

จาก testwiki
ไปยังการนำทาง ไปยังการค้นหา
ไฟล์ต้นฉบับ (ไฟล์ SVG ขนาดประมาณ 540 × 360 พิกเซล, ขนาดไฟล์: 40 กิโลไบต์)

ไฟล์นี้มาจาก วิกิมีเดียคอมมอนส์ และอาจมีใช้ในโครงการอื่น คำอธิบายในหน้าคำอธิบายไฟล์แสดงไว้ด้านล่างนี้

ความย่อ

คำอธิบาย
English: Plot of a cubic polynomial fit using multiple least squares to a simulated data set. Along with the point estimate, a 95% simultaneous confidence band (CB) constructed using Scheffe's method is shown.
วันที่
แหล่งที่มา งานของตัว
ผู้สร้างสรรค์ Skbkekas
เวอร์ชันอื่น

[แก้ไข]

SVG genesis
InfoField
 ซอร์สโค้ดของ SVG นี้ตรวจสอบถูกต้องแล้ว
 ไฟล์ภาพกราฟิกส์เวกเตอร์นี้ สร้างขึ้นโดยใช้ Matplotlib
 The file size of this SVG plot may be irrationally large because its text has been converted to paths inhibiting translations.
รหัสต้นฉบับ
InfoField

Python code

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

## Sample size.
n = 100

## Predictor values.
XV = np.random.uniform(low=-4, high=4, size=n)
XV.sort()

## Design matrix.
X = np.ones((n,4))
X[:,1] = XV
X[:,2] = XV**2
X[:,3] = XV**3

## True coefficients.
beta = np.array([0, 0.1, -0.25, -0.25], dtype=np.float64)

## True response values.
EY = np.dot(X, beta)

## Observed response values.
Y = EY + np.random.normal(size=n)*np.sqrt(20)

## Get the coefficient estimates.
u,s,vt = np.linalg.svd(X,0)
v = np.transpose(vt)
bhat = np.dot(v, np.dot(np.transpose(u), Y)/s)

## The fitted values.
Yhat = np.dot(X, bhat)

## The MSE and RMSE.
MSE = ((Y-EY)**2).sum()/(n-X.shape[1])
s = np.sqrt(MSE)

## These multipliers are used in constructing the Scheffe interval.
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)

## The F quantile used in constructing the Scheffe interval.
QF = sp.fdtri(X.shape[1], n-X.shape[1], 0.95)

## The lower and upper bounds of the confidence band.
D = s*np.sqrt(X.shape[1]*QF*V)
LB,UB = Yhat-D,Yhat+D

## Make the plot.
plt.clf()
plt.plot(XV, Y, 'o', ms=3, color='grey')
plt.plot(XV, EY, '-', color='blue', label = "Truth")
plt.plot(XV, Yhat, '-', color='green', label = "Estimate")
plt.plot(XV, LB, '-', color='red', label = "CB")
plt.plot(XV, UB, '-', color='red')
plt.legend(frameon=False)
plt.ylim([-25,20])
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("polyreg_scheffe.pdf")
plt.savefig("polyreg_scheffe.svg")

การอนุญาตใช้สิทธิ

ข้าพเจ้า ในฐานะผู้ถือลิขสิทธิ์ของภาพหรือสื่อนี้ อนุญาตให้ใช้ภาพหรือสื่อนี้ภายใต้เงื่อนไขต่อไปนี้
w:th:ครีเอทีฟคอมมอนส์
แสดงที่มา
ไฟล์นี้อยู่ภายใต้สัญญาอนุญาตครีเอทีฟคอมมอนส์ รุ่น แสดงที่มา 3.0 ต้นฉบับ
คุณสามารถ:
  • ที่จะแบ่งปัน – ที่จะทำสำเนา แจกจ่าย และส่งงานดังกล่าวต่อไป
  • ที่จะเรียบเรียงใหม่ – ที่จะดัดแปลงงานดังกล่าว
ภายใต้เงื่อนไขต่อไปนี้:
  • แสดงที่มา – คุณต้องให้เกียรติเจ้าของงานอย่างเหมาะสม โดยเพิ่มลิงก์ไปยังสัญญาอนุญาต และระบุหากมีการเปลี่ยนแปลง คุณอาจทำเช่นนี้ได้ในรูปแบบใดก็ได้ตามควร แต่ต้องไม่ใช่ในลักษณะที่แนะว่าผู้ให้อนุญาตสนับสนุนคุณหรือการใช้งานของคุณ

คำบรรยายโดยย่อ

เพิ่มคำอธิบายบรรทัดเดียวว่าไฟล์นี้แสดงถึงอะไร

รายการที่แสดงอยู่ในไฟล์นี้

ประกอบด้วย

media type อังกฤษ

image/svg+xml

ประวัติไฟล์

คลิกวันที่/เวลาเพื่อดูไฟล์ที่ปรากฏในขณะนั้น

วันที่/เวลารูปย่อขนาดผู้ใช้ความเห็น
ปัจจุบัน16:27, 8 มีนาคม 2564รูปย่อสำหรับรุ่นเมื่อ 16:27, 8 มีนาคม 2564540 × 360 (40 กิโลไบต์)wikimediacommons>Olexa RiznykFixed Confidence band ("CB") label

1 หน้าต่อไปนี้ใช้ไฟล์นี้: