0
プロットするときに、なぜ私が異なる行を得るのか誰かが説明できますか?どういうわけか私はラインは私がモデルから値を取得できますか同じローカル多項式回帰を理解する
data(aircraft)
help(aircraft)
attach(aircraft)
lgWeight <- log(Weight)
library(KernSmooth)
# a) Fit a nonparametric regression to data (xi,yi) and save the estimated values mˆ (xi).
# Regression of degree 2 polynomial of lgWeight against Yr
op <- par(mfrow=c(2,1))
lpr1 <- locpoly(Yr,lgWeight, bandwidth=7, degree = 2, gridsize = length(Yr))
plot(Yr,lgWeight,col="grey", ylab="Log(Weight)", xlab = "Year")
lines(lpr1,lwd=2, col="blue")
lines(lpr1$y, col="black")
あるべきと思いましたか?モデルを印刷すると、$x
と$y
の値が得られますが、プロットすると青い線と同じではありません。 x
ごとにフィットモデル(青色)の値が必要ですが、助けてくれますか?