Skip to content

MANE 3351 - Manufacturing Engineering Analysis

Laboratory 6 Assignment

Assigned: November 22, 2021

Due: November 30, 2021


Learning Goals

  1. Utilize Numpy matrix functions to perform regression analysis
  2. Utilize Matplotlib to plot raw and fitted data

Description

In Laboratory Six, you will use Numpy and Matplotlib to perform linear regression analysis. The value of the parameters, \(\beta\), can be found by using \(\beta=\left(X^TX\right)^{-1}X^TY\). Once \(\beta\) is found, the fitted values can be found using \(\hat{y}=X\beta\).

Cell 1

Replace the text “Your Name” with your name.

Cell 2

In cell two, the arrays containing the values for \(x\) and \(y\) are created and a scatterplot is created. You do not need to modify cell 2.

Cell 3

In cell three, the array X is created and the values of \(\beta\) are found and printed. You do not need to modify cell 3.

Cell 4

In cell four, you need to create a vector containing the fitted values, \(\hat{y}=X\beta\) using Numpy commands, and print the fitted values.

Cell 5

In cell five, you need to use Matplotlib to create a scatter plot containing both the observed data and the fitted value. It is recommended that you copy the code from cell two as your starting point. You are to add another series to the scatter plot containing the fitted values. The fitted values should be displayed with a Diamond symbol (marker). Your plot in cell five, should also containing a legend that links the symbols with either the observed or fitted values.

Post Programming

Do not forget to save your Jupyter Notebook and then use git add, git commit, and git push to upload your submission