Finding the sum of e

Report a typo

Imagine that you are working in a secret laboratory.

Your colleague build a linear regression model based on some secret data below.

Secret X Secret Y
1 18
3 17
5 13
7 8
9 4

The resulting model is as follows:

y=1.85x+21.25y = -1.85x + 21.25

Help your colleague to compute the sum of squares of deviations i=15e2=i=15(yy^)2\sum_{i=1}^5 e^2 = \sum_{i=1}^ 5(y - \hat{y})^2 of the obtained model.

Input values as NumPy arrays
import numpy as np

x = np.array([1, 3, 5, 7, 9])
y = np.array([18, 17, 13, 8, 4])

Enter a number
___

Create a free account to access the full topic