Comparing the kernel and local-linear estimators: To illustrate the reduced bias of the local-linear estimator in comparison
Question:
Comparing the kernel and local-linear estimators: To illustrate the reduced bias of the local-linear estimator in comparison to the kernel estimator, generate n ¼ 100 observations of artificial data according to the cubic regression equation Y ¼ 100 & 5 x
10 & 5
( ) þ
x 10 & 5
( )3
þ ε ð18:15Þ
where the X-values are sampled from the uniform distribution X ; Uð0; 100Þ, and the errors are sampled from the normal distribution ε ; Nð0; 202Þ. Draw a scatterplot of the data showing the true regression line EðYÞ ¼ 100 & 5ð Þþ x=10 & 5 ð Þ x=10 & 5 3
. Then, use both kernel regression and local-linear regression to estimate the regression of Y on X, in each case adjusting the span to produce a smooth regression curve. Which estimator has less bias? Why?67 Save the data from this exercise, or generate the data in a manner that can be replicated.
Step by Step Answer:
Applied Regression Analysis And Generalized Linear Models
ISBN: 9781452205663
3rd Edition
Authors: By John Fox