파일:Polyreg scheffe.svg

문서 내용이 다른 언어로는 지원되지 않습니다.
위키백과, 우리 모두의 백과사전.

원본 파일(SVG 파일, 실제 크기 540 × 360 픽셀, 파일 크기: 40 KB)

파일 설명

설명
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 발전
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:ko:크리에이티브 커먼즈
저작자표시
이 파일은 크리에이티브 커먼즈 저작자표시 3.0 Unported 라이선스로 배포됩니다.
이용자는 다음의 권리를 갖습니다:
  • 공유 및 이용 – 저작물의 복제, 배포, 전시, 공연 및 공중송신
  • 재창작 – 저작물의 개작, 수정, 2차적저작물 창작
다음과 같은 조건을 따라야 합니다:
  • 저작자표시 – 적절한 저작자 표시를 제공하고, 라이센스에 대한 링크를 제공하고, 변경사항이 있는지를 표시해야 합니다. 당신은 합리적인 방식으로 표시할 수 있지만, 어떤 방식으로든 사용권 허가자가 당신 또는 당신의 사용을 지지하는 방식으로 표시할 수 없습니다.

설명

이 파일이 나타내는 바에 대한 한 줄 설명을 추가합니다

이 파일에 묘사된 항목

다음을 묘사함

image/svg+xml

파일 역사

날짜/시간 링크를 클릭하면 해당 시간의 파일을 볼 수 있습니다.

날짜/시간섬네일크기사용자설명
현재2021년 3월 9일 (화) 00:272021년 3월 9일 (화) 00:27 판의 섬네일540 × 360 (40 KB)Olexa RiznykFixed Confidence band ("CB") label
2009년 4월 10일 (금) 06:002009년 4월 10일 (금) 06:00 판의 섬네일341 × 288 (51 KB)SkbkekasAdded axis labels.
2009년 4월 10일 (금) 05:542009년 4월 10일 (금) 05:54 판의 섬네일341 × 288 (51 KB)Skbkekas{{Information |Description={{en|1=Plot of a cubic polynomial fit using multiple least squares to a simulated data set.}} |Source=Own work by uploader |Author=Skbkekas |Date=April 9, 2009 |Permission= |other_versions= }} <!--{{ImageUploa

다음 문서 1개가 이 파일을 사용하고 있습니다:

이 파일을 사용하고 있는 모든 위키의 문서 목록

다음 위키에서 이 파일을 사용하고 있습니다:

메타데이터