{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# Project5 - 2 1 2 ˆ C a a N a N = e Use the MATLAB'polyfit...

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

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
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

{[ snackBarMessage ]}

Ask a homework question - tutors are online