Regression Analysis
MME 523
The goal this week
and next is to explore the numerical considerations behind regression analysis,
linear and other.
Assignment
1:
1) please review the derivations
from lecture as you will need them to extend this work.
2) we will use Maple
for computational and graphical purposes for learni
3) generate some somewhat linear data of your choice – say at least 6 data points
usi
now have another student make a
guess as to a straight line that fits it and use maple to
plot both your data and their straight line on the
same plot (see Maple notes for help)
4) next set up a 2x3 augmented matrix with the
system of equations in it that yields the best fit straight line (see lecture
notes for details). We want Maple to
solve the system with linear algebra techniques. Code which is helpful might be modifications
of:
>with(linalg); to open the library
>A:=matrix(2,3,[ ]); create blank 2x3 matrix A
>A[1,2]:= 728; store 728 in the row
1, column 2 entry
and also code for
summi
array):
>
x_val:=[0 , 1,
2, 3, 5 ];
![]()
>
tot:=0;
![]()
>
for i from 1 to 5 do tot:=tot + x_val[i]^2 od;
Now, putti
5. Next we want to get
Maple to solve the system.
This is easy!! Just issue
>gaussjord(A);
and you invoke the
Gauss-Jordan algorithm for solvi
6. Next plot
·
your data
·
your
guesstimate fit
·
the
optimal fit
on the same
plot.
Assignment
2:
OK – you understand the concept and the
linear derivations, right?? So prove
it by doi
Steps:
1. seek a best fit of the form y = ax2 + bx + c
2. pick some parabolic looki
3. set up the error
expression (see lecture notes)
4. take 3 derivatives,
set all to 0 for optimality
5. do some algebra and get 3 linear equations, 3
unknowns
6. set up a 3x4 matrix in Maple and have it
reduce them
7. have Maple plot your data and your parabola
on the same graph.
8. pat yourself on the
back!
Assignment
3:
Get out your calculator and find out how to
do linear regression on it! You want to then run the same data as you used in
Assignment 1 (and get the same results!).
Jot down what it took to get it to work for you. If you don't have the
manual, TI has them all on line. If you
do have the manual, READ IT! Can your
calculator do any more than
just linear?? Please report!
Assignment
4:
What can you find for data on the price of
housing in