Assignment
Suppose we know the Age and Salary of 5 employees as follows:
Employee ID
|
Age
|
Salary
|
1
|
20
|
3000
|
2
|
25
|
3600
|
3
|
30
|
4000
|
4
|
35
|
5000
|
5
|
40
|
5100
|
We can see there is a positive association between Age and Salary, and we'd like to use the following linear model to capture this positive relationship:
Salary = α + β Age
where α and β are both unknown parameters for us to estimate.
(a) Find the α and β that minimize the TOTAL estimation error. Estimation error for a specific employee is defined as the Euclidean distance between the model-predicted salary and actual salary. For example, if α = 0 and β = 100, the estimation error for Employee 1 is:
( ModelPredicted Salary - Actual Salary)2 = (0 + 100 * 20 - 3000)2 = 1000000
(b) Use the model, predict the salary of an employee whose age is 45.