YuhangZhou88 / ESL_Solution

https://yuhangzhou88.github.io/ESL_Solution/
MIT License
247 stars 36 forks source link

Ex. 9.1: no universe S in local linear regression #5

Open szcf-weiya opened 2 years ago

szcf-weiya commented 2 years ago

I am concerned about the usage of S in your solution

image

The "smoothing matrix" is different for each query point in the local linear regression. In other words, different weighted linear regressions are performed on different points.

BTW, I think it should be straightforward by starting from the definition (my thought: https://github.com/szcf-weiya/ESL-CN/issues/167)

YuhangZhou88 commented 2 years ago

thanks, yeah you're correct, my notation is misleading. The point is Step 2 in Algo. 9.1 is also localized, so the fix is to add subscript j to W (thus S as well). Note that terms with W_j get cancelled out anyway.

your solution looks good.

szcf-weiya commented 2 years ago

thanks, yeah you're correct, my notation is misleading. The point is Step 2 in Algo. 9.1 is also localized, so the fix is to add subscript j to W (thus S as well). Note that terms with W_j get cancelled out anyway.

your solution looks good.

I don't think you can put them into a vector yhat, since each component uses a different S.

Step 2 of Alg. 9.1. is to fit a component function using all points, and this problem isolates the fitting procedure as a standalone question, what do you mean "Step 2 in Algo. 9.1 is also localized, so ..."

YuhangZhou88 commented 2 years ago
  1. local regression estimate is linear in y_i, so it preserves linear part of the fit;
  2. Step 2 is an iterative process done for each predictor in turn.
szcf-weiya commented 2 years ago

agree. Maybe I misunderstood your former description. Wait for your fix for a clear discussion.