For each y, calculate P(Y | X)

Y = 1: P(1 | -1) = 1/3 * 1/8

P(1 | 1) = 1/3 * 7/8

Y = 2: P(2 | -1) = 0

P(2 | 1) = 1/6 * 1

Y = 3: P(3 | -1) = 1/2 * 1/2

P(3 | 1) = 1/2 * 1/2

$$ h^*(x) = 1 \text{ if } X = 1 \\ 3 \text{ if } X = -1 $$

a) quadratic

b) quadratic

c) linear

a) You would predict the mean, (1 + 3 + 4 + 6)/4 = 14/4

Its error would be the variance

b) MSE = (0 + 2^2 + 0 + 2^2)/4 = (4 + 4)/4 = 2

c) Finding line using Least Squares Regression:

$$ a = \frac{n(\sum_{i=1}^{n} x_i y_i) - (\sum_{i=1}^{n} x_i)(\sum_{i=1}^{n} y_i)}{n(\sum_{i=1}^{n} x_i^2) - (\sum_{i=1}^{n} x_i)^2}

$$

$$ b = \frac{(\sum_{i=1}^{n} y_i) - m(\sum_{i=1}^{n} x_i)}{n}

$$

Screen Shot 2023-10-20 at 12.07.01 AM.png

a)