w=[1.33,2.67,4,5.33,6.67,8.67,10.67,18.67,20,21.33,22,22.67,23.33,24,24.67,25.33,25.67,26,26.33,26.67];
tr=[1040,1036,999,1017,1049,1000,1007,943,916,944,929,955,931,940,911,785,703,634,326,7];
plot(w,tr,'r*')
hold on %


x1=[1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ]';
x2=[w]';
A=[x1,x2]
B=[tr]'
Z=(A'*A)\(A'*B)
a=1146.44293810102
b=-16.9268482472194
plot(w,a+b*w)

err1 = immse(w,a+b*w)

hold on %
x3=[w.^2]'
A1=[A,x3]
Z1=(A1'*A1)\(A1'*B)

d=830.996304772420
e=57.1552744488379
f=-2.54323192536466

plot(w,d+e*w+f*(w.^2))

err2 = immse(w,d+e*w+f*(w.^2))
hold on %

x4=[exp(w)]'

A2=[A,x4]
Z2=(A2'*A2)\(A2'*B)
g=1025.81386286003
h=-1.95394435224398
i=-2.31414585573872e-09

plot(w,g+h*w+i*(exp(w)))

err3 = immse(w,g+h*w+i*(exp(w)))

errt =(err1+err2+err3)/3


