Vous êtes sur la page 1sur 12

Dataset Name: DanWood

(DanWood.dat)

Description:
These data and model are described in Daniel and Wood
(1980), and originally published in
E.S.Keeping, "Introduction to Statistical Inference," Van Nostrand Company, Princeton, NJ, 1962, p.
354. The response variable is energy radieted from a carbon filament lamp per cm**2 per second,
and the predictor variable is the absolute temperature of the filament in 1000 degrees Kelvin.
Reference:
Daniel, C. and F. S. Wood (1980). Fitting Equations to Data, Second Edition. New York, NY: John
Wiley and Sons, pp. 428-431.

Data:
y
2.138E0
3.421E0
3.597E0
4.340E0
4.882E0
5.660E0

x
1.309E0
1.471E0
1.490E0
1.565E0
1.611E0
1.680E0

Source Code in python


# -*- coding: utf-8 -*"""
Created on Fri Nov 8 14:06:48 2013
@author: dandiwijaya
Linear regression for DanwoodEM Data Set
"""
import matplotlib.pylab as plt
xLst = [1.309, 1.471, 1.490, 1.565, 1.611, 1.680]
yLst = [2.138, 3.421, 3.597, 4.340, 4.882, 5.660]
x1=[];x2=[];x3=[];x4=[];x5=[];x6=[];x7=[];x8=[];x9=[];x10=[]
arX=[x1,x2,x3,x4,x5,x6,x7,x8,x9,x10]
pangkat=2.0
for j in range(0,len(arX)):
for i in range (0,len(xLst)):
arX[j].append((xLst[i]**pangkat))
m,b=plt.polyfit(arX[j],yLst,1)
yp=plt.polyval([m,b],arX[j])
plt.plot(xLst,yLst,'o',xLst,yp,'-r')
plt.title('Data Set DanwoodEM \nLinear Regresion x^%2.2f'%pangkat)
plt.legend(['Data Set','y=%2.4f x^%2.2f + %2.4f'%(m,pangkat,b)],loc='best')
plt.grid(True)
plt.xlabel('x')
plt.ylabel('y')
plt.savefig('DanwoodEM_x^%2.2f.PNG'%pangkat)
plt.show()
pangkat=pangkat+0.25

Page | 1

Page | 2

Page | 3

Page | 4

Page | 5

Page | 6

Dataset Name: Misra1a

(Misra1a.dat)

Description:
These data are the result of a NIST study regarding dental research in monomolecular adsorption.
The response variable is volume, and the predictor variable is pressure.
Data: y
10.07E0
14.73E0
17.94E0
23.93E0
29.61E0
35.18E0
40.02E0
44.82E0
50.76E0
55.05E0
61.01E0
66.40E0
75.47E0
81.78E0

x
77.6E0
114.9E0
141.1E0
190.8E0
239.9E0
289.0E0
332.8E0
378.4E0
434.8E0
477.3E0
536.8E0
593.1E0
689.1E0
760.0E0

Source Code in python


# -*- coding: utf-8 -*"""
Created on Fri Nov 8 14:06:48 2013
@author: dandiwijaya
"""
import matplotlib.pylab as plt
xLst =
593.1,
yLst =
61.01,

[77.6, 114.9, 141.1, 190.8, 239.9, 289.0, 332.8, 378.4, 434.8, 477.3, 536.8,
689.1, 760.0];
[10.07, 14.73, 17.94, 23.93, 29.61, 35.18, 40.02, 44.82, 50.76, 55.05,
66.40, 75.47, 81.78];

x1=[];x2=[];x3=[];x4=[];x5=[];x6=[];x7=[];x8=[];x9=[];x10=[]
arX=[x1,x2,x3,x4,x5,x6,x7,x8,x9,x10]
pangkat=0.6
for j in range(0,len(arX)):
for i in range (0,len(xLst)):
arX[j].append((xLst[i]**pangkat))
m,b=plt.polyfit(arX[j],yLst,1)
yp=plt.polyval([m,b],arX[j])
plt.plot(xLst,yLst,'o',xLst,yp,'-r')
plt.title('Data Set Misra1aEM \nLinear Regresion x^%2.2f'%pangkat)
plt.legend(['Data Set','y=%2.4f x^%2.2f + %2.4f'%(m,pangkat,b)],loc='best')
plt.grid(True)
plt.xlabel('x')
plt.ylabel('y')
plt.savefig('Misra1aEM_x^%2.2f.PNG'%pangkat)
plt.show()
pangkat=pangkat+0.05

Page | 7

Page | 8

Page | 9

Page | 10

Page | 11

Page | 12

Vous aimerez peut-être aussi