Project5 - 2 1 2 ˆ C a a N a N = e Use the MATLAB'polyfit function to find the coefficients 1 a a in the least squares line and 1 2 a a a in the

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
EGN 3420 Project 5 - Regression Sp 07 The total cost C (in dollars) of running a train system with a variable number of wagons N is tabulated below. N (Number of wagons per train) Total Cost, ( ) C N Average Cost, ( ) AC N 1 85 2 110 3 130 4 160 5 210 6 280 7 370 8 480 9 610 10 760 a) Write a MATLAB program to find the coefficients 0 1 , a a in the least squares regression line 0 1 ˆ C a a N = + by solving the normal equations. (Do not use the MATLAB 'polyfit' function.) Display the results. b) Calculate and display SST, SSE, SSR, 2 and . r r c) Plot the data points and the least squares line on the same graph. d) Repeat Parts a), b) and c) for the least squares quadratic
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 2 1 2 ˆ . C a a N a N = + + e) Use the MATLAB 'polyfit' function to find the coefficients 1 , a a in the least squares line and 1 2 , , a a a in the least squares quadratic. Compare your answers to the results obtained by solving the normal equations in Parts a) and d). f) Compute the average cost per wagon, i.e. ( ) ( ) / AC N C N N = and enter the results in the table. Use 'polyfit' to find the least squares quadratic 2 1 2 ˆ AC a a N a N = + + and the least squares cubic 2 3 1 2 3 ˆ . AC a a N a N a N = + + + Plot both and the data points on the same graph....
View Full Document

This note was uploaded on 06/09/2011 for the course EGM 4320 taught by Professor Klee during the Spring '11 term at University of Central Florida.

Ask a homework question - tutors are online