Question: Solve it for SAS Programming Language NAME: 1 Objective: Least squares curve fitting procedure for inding the best-fitting curve to a given set of points
NAME: 1 Objective: Least squares curve fitting procedure for inding the best-fitting curve to a given set of points by minimizing the sum of the squares of the errors (or offiets or residuals) of the points from the curve. Review the lecture 2 Key Words proc reg noisy data, regression 3 Lab Steps [A ta step 1: Build 31 data points (k, y) and some noise 2, so that ilxgoes from 0 to 3 in steps of size l/10, / [3) z id normal mean 0 variance 1 noise t is fairly amazing that a computer program can be given any four of the data points (x, y), do some calculations and then report that the points all lie on the cube of A 2 what is even more amazing is that if the computer is given NOISY DATA : (x, y + then it can strip off the noise and still come close to finding the cubic JA2] In addition, it can guess the magnitude of the scale factor "a". How is this possible? The computer uses method of LEAST SQUARES [C] Data step 2: Build 31 data points (x, x. 2, x3, w), w:-y + a.z, where columns are labeled x1 x2 x3 w. Do this in one of two ways: [1] edit (A) 2] preferred: write a macro with input: seed a. DI PROC reg step: Now use proc reg data step; to check that claim [B] is true. Here is the code: PROC reg data step2: /. fit Line, output predicted values yhat in data set in / name of column containing predicted yhat./ MODEL W x1; output out lin p plin; MODEL W x1 x2; output out -quad p pquad:nane of column containing predicted yhat MODEL w x1 x2 x3; output out - cub p pcub; nane of colunn containing predicted yhat . / fit t quadratic, output predicted values yhat in data set quad W x1 x2 x3; /. fit cubic, output predicted values yhat in data set cub . run; CCT NAME: 1 Objective: Least squares curve fitting procedure for inding the best-fitting curve to a given set of points by minimizing the sum of the squares of the errors (or offiets or residuals) of the points from the curve. Review the lecture 2 Key Words proc reg noisy data, regression 3 Lab Steps [A ta step 1: Build 31 data points (k, y) and some noise 2, so that ilxgoes from 0 to 3 in steps of size l/10, / [3) z id normal mean 0 variance 1 noise t is fairly amazing that a computer program can be given any four of the data points (x, y), do some calculations and then report that the points all lie on the cube of A 2 what is even more amazing is that if the computer is given NOISY DATA : (x, y + then it can strip off the noise and still come close to finding the cubic JA2] In addition, it can guess the magnitude of the scale factor "a". How is this possible? The computer uses method of LEAST SQUARES [C] Data step 2: Build 31 data points (x, x. 2, x3, w), w:-y + a.z, where columns are labeled x1 x2 x3 w. Do this in one of two ways: [1] edit (A) 2] preferred: write a macro with input: seed a. DI PROC reg step: Now use proc reg data step; to check that claim [B] is true. Here is the code: PROC reg data step2: /. fit Line, output predicted values yhat in data set in / name of column containing predicted yhat./ MODEL W x1; output out lin p plin; MODEL W x1 x2; output out -quad p pquad:nane of column containing predicted yhat MODEL w x1 x2 x3; output out - cub p pcub; nane of colunn containing predicted yhat . / fit t quadratic, output predicted values yhat in data set quad W x1 x2 x3; /. fit cubic, output predicted values yhat in data set cub . run; CCT
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
