A Power Law For Human Heights and Weights Math 2270-2

advertisement
Math 2270-2
Solution Template, part A
Due 2pm Friday March 26, 2004 (Nancy’s office is LCB 333)
A Power Law For Human Heights and Weights
> restart:with(linalg):with(plots):
Warning, the protected names norm and trace have been redefined and unprotected
Warning, the name changecoords has been redefined
> S:=[[28,21.7],[65,127],[70,145],[75,208],[65,121],[71,200],[72,163
],[60,110],[88,500],[86,485],[32,73],[14,9.5],[66,140],[73,200],[6
5,115],[71,167],[66,132],[68,192],[43,35],[57,65],[67,118],[69,160
],[65,125],[63,115],[69,160],[69,165],[48,54],[58,85],[64,120],[74
,225],[68.5,152],[68,145],[73,153],[76,155],[49,52],[39,40],[27,20
],[62.5,117],[60,90],[70,219],[63.8,120],[66.9,140],[60.2,90],[68,
150],[70,164],[68,139],[68.5,134],[76,200],[50,51],[70,170],[61,14
0],[62,115],[68.5,172],[76,190],[74,237],[74,215],[62,140],[66,125
],[72,195],[73,210],[69,145],[74,195],[68,160],[69,185],[73,210],[
71,203],[62,122],[62,112],[72,175],[76,180],[70,190],[64,135],[67,
135],[70,180],[78,175],[70,140],[25,27],[69,190],[67,115],[69,172]
,[74,170],[79,210],[70,130],[69,123],[66,130],[73,210],[68,130],[7
7,205],[74,175],[69,142],[71,244],[20,6.0+10/16],[20,7.0+1/16],[19
,6.0+6/16],[20,7.0+5/16],[19,6.0+2/16],[19.5,8.0+1/16],[21,8.0+13/
16],[20,7.0+11/16],[20,8.0+8/16],[54,70],[43,41],[27,18],[59,84],[
60,82],[48,82],[49,64],[48,79],[59,84],[60,92],[59,95],[57,61],[61
,90],[53,58],[54,69],[50,51],[54,77],[54,60],[52,63],[55,79],[40,3
7.5],[42,41.5],[43,41],[43,43],[44,42.5],[44,38.5],[44,40.5],[45,5
5],[45,46.5],[47,54.5],[48,70.5],[48,43.5],[49,49]]:
> A1:=convert(S,matrix):
1) As in the worked example, find a least squares line fit to the ln-ln data which you obtain from
A1.
> A2:=map(ln,A1):
A3:=map(evalf,A2):
rowdim(A3);
133
> col1:=vector(rowdim(A3),1):
A4:=delcols(A3,2..2):
A:=augment(col1,A4):
b:=delcols(A3,1..1):
> ATA:=evalm(transpose(A)&*A):
ATb:=evalm(transpose(A)&*b):
linsolve(ATA,ATb);
-4.932885919




 2.347870346 
2) Create a plot display which shows the ln-ln data and your least squares line fit.
> lnlnplot:=pointplot({seq([A3[i,1],A3[i,2]],i=1..rowdim(A3))}):
line:=plot(2.347870346*t-4.932885919,t=2.5..4.75):
display({lnlnplot,line});
6
5
4
3
2
1
2.5
3
3.5
4
4.5
t
3) Deduce a power law for our class height-weight data. Create a plot display which shows the
graph of the power function and the pointplot of our original data.
> C:=exp(-4.932885919);
p:=2.347870346;
C := 0.007205678242
p := 2.347870346
> realplot:=pointplot({seq([A1[i,1],A1[i,2]],i=1..rowdim(S))}):
powerplot:=plot(C*h^p,h=0..90,color=black):
display({realplot,powerplot});
500
400
300
200
100
0
20
40
60
80
h
4) What does your power law predict for the weights of "average" people, at heights of 5 feet, 5
1/2 feet, 6 feet, and 6 1/2 feet?
> C*(5*12)^p;
C*(5.5*12)^p;
C*(6*12)^p;
C*(6.5*12)^p;
107.7813098
134.8118645
165.3677268
199.5573255
Download