统计学习精要 (Elements of Statistical Learning ) 习题 5.10
Derive an expression for Var(f̂ λ(x0)) and bias (f̂ λ(x0)) . Using the example (5.22), create a version of Figure 5.9 where the mean and several (pointwise) quantiles of f̂ λ(x) are shown.
思路:
这里仅给出前半部分推导。其实我一直也觉得每个点的bias和variance能够算出来很神奇。
假设原来数据集
X
和对应的输出
θ̂ λ=(NTN+λΩN)−1NTy
记一个新的数据点
x0
的basis function为
N(x0)
,那么
f̂ λ(x0)=N(x0)θ̂ λ
。而bias为
Bias(f̂ λ(x0))=f(x0)−Ef̂ λ(x0)=f(x0)−N(x0)Eθ̂ λ=f(x0)−N(x0)(NTN+λΩN)−1NTf(x)
其中 Ey=f(x) .
而Variance为
Var(f̂ λ(x0))=Var(N(x0)θ̂ λ)=N(x0)Var(θ̂ λ)N(x0)T=N(x0)(NTN+λΩN)−1NTVar(y)N(NTN+λΩN)−1N(x0)T=N(x0)(NTN+λΩN)−1NTN(NTN+λΩN)−1N(x0)Tσ2
注意,这里的 N(x0) 是行向量。