Stat.Nonparametric.Local­Poly

Degree-p local-polynomial regression substrate: equivalent-kernel weights, design positive definiteness, bias, variance, leverage rates, and pointwise risk bounds.

Estimator­Risk 12 core · 10 supporting · 6 submodules Pointwise-risk assembly for local-polynomial estimators, including density constants, leverage bounds, conditional MSE factorization, and unconditional risk lifts. Rate 5 core · 7 supporting · 2 submodules Explicit Θ(Nh) leverage-rate bounds for the local-polynomial design inverse, derived from entrywise design-matrix concentration and population scaling.
Weights 3 core · 4 supporting Equivalent-kernel weights for local-polynomial weighted least squares and their polynomial-reproduction property. ★ equivKernelWeight_reproduces

Polynomial reproduction of the local-polynomial equivalent kernel

Equivalent-kernel weights for local-polynomial weighted least squares and their polynomial-reproduction property.

The degree-p local-polynomial weighted least-squares fit at a point has, when the weighted design moment matrix is invertible, an explicit equivalent-kernel weight Sᵢ = ∑ₖ (M⁻¹)₀ₖ wᵢ xᵢᵏ, where M_{jk} = ∑ᵢ wᵢ xᵢʲ xᵢᵏ is the weighted design moment matrix (xᵢ = aᵢ − t). This file proves the defining polynomial-reproduction property of these weights:

∑ᵢ Sᵢ xᵢᵐ = [m = 0] for m ≤ p,

i.e. the equivalent kernel reproduces polynomials up to degree p. This is exactly the hypothesis hrep consumed by linearSmoother_bias_of_reproduces, so it converts the abstract bias bound into the concrete local-polynomial bias estimate. The reproduction is pure linear algebra: ∑ᵢ Sᵢ xᵢᵐ = ∑ₖ (M⁻¹)₀ₖ M_{km} = (M⁻¹ M)₀ₘ = I₀ₘ (Fan–Gijbels 1996 §3.1).

def designMatrix reviewed
Causalean.Stat.Nonparametric

The weighted design moment matrix M_{jk} = ∑ᵢ wᵢ xᵢʲ xᵢᵏ of a degree-p local-polynomial fit with design points xᵢ (typically aᵢ − t) and weights wᵢ.

Definition (Lean source)
noncomputable def designMatrix (p : ℕ) {N : ℕ} (x w : Fin N → ℝ) : Matrix (Fin (p + 1)) (Fin (p + 1)) ℝ := fun j k => ∑ i, w i * x i ^ (j : ℕ) * x i ^ (k : ℕ)
Causalean.Stat.Nonparametric.designMatrix · Causalean/Stat/Nonparametric/LocalPoly/Weights.lean:39
def equivKernelWeight reviewed
Causalean.Stat.Nonparametric

The local-polynomial equivalent-kernel weight Sᵢ = ∑ₖ (M⁻¹)₀ₖ wᵢ xᵢᵏ extracting the fitted intercept: the degree-p WLS intercept equals ∑ᵢ Sᵢ Yᵢ.

Definition (Lean source)
noncomputable def equivKernelWeight (p : ℕ) {N : ℕ} (x w : Fin N → ℝ) (i : Fin N) : ℝ := ∑ k, (designMatrix p x w)⁻¹ 0 k * (w i * x i ^ (k : ℕ))
Causalean.Stat.Nonparametric.equivKernelWeight · Causalean/Stat/Nonparametric/LocalPoly/Weights.lean:45
theorem equivKernelWeight_reproduces reviewed
Causalean.Stat.Nonparametric

Polynomial reproduction of the equivalent kernel. If the weighted design moment matrix is invertible, then the local-polynomial equivalent-kernel weights reproduce polynomials up to degree p: ∑ᵢ Sᵢ xᵢᵐ = [m = 0] for every m ≤ p. This discharges the reproduction hypothesis of linearSmoother_bias_of_reproduces.

Formal statement
N p :
Fin N → ℝ
hM :
∀ m : ℕ
if
m ≤ p
then
(∑ i, equivKernelWeight p x w i * x i ^ m) = if m = 0 then 1 else 0
Proof (Lean source)
theorem equivKernelWeight_reproduces {N p : ℕ} {x w : Fin N → ℝ} (hM : IsUnit (designMatrix p x w).det) : ∀ m : ℕ, m ≤ p → (∑ i, equivKernelWeight p x w i * x i ^ m) = if m = 0 then 1 else 0 := by intro m hm let M : Matrix (Fin (p + 1)) (Fin (p + 1)) ℝ := designMatrix p x w let m' : Fin (p + 1) := ⟨m, Nat.lt_succ_of_le hm⟩ calc (∑ i, equivKernelWeight p x w i * x i ^ m) = ∑ i, (∑ k, M⁻¹ 0 k * (w i * x i ^ (k : ℕ))) * x i ^ m := by simp only [equivKernelWeight, M] _ = ∑ k, M⁻¹ 0 k * M k m' := by simp only [Finset.sum_mul] rw [Finset.sum_comm] apply Finset.sum_congr rfl intro k hk calc (∑ i, M⁻¹ 0 k * (w i * x i ^ (k : ℕ)) * x i ^ m) = ∑ i, M⁻¹ 0 k * (w i * x i ^ (k : ℕ) * x i ^ m) := by apply Finset.sum_congr rfl intro i hi ring _ = M⁻¹ 0 k * (∑ i, w i * x i ^ (k : ℕ) * x i ^ m) := by rw [Finset.mul_sum] _ = M⁻¹ 0 k * M k m' := by simp only [M, m', designMatrix] _ = (M⁻¹ * M) 0 m' := by rw [Matrix.mul_apply] _ = (1 : Matrix (Fin (p + 1)) (Fin (p + 1)) ℝ) 0 m' := by rw [Matrix.nonsing_inv_mul] simpa only [M] using hM _ = if m = 0 then 1 else 0 := by by_cases hm0 : m = 0 · subst m have hfin : (0 : Fin (p + 1)) = m' := by ext simp only [Fin.val_zero, m'] simp only [Matrix.one_apply, hfin, ↓reduceIte] · simp only [Matrix.one_apply, hm0, ↓reduceIte] rw [if_neg] intro h apply hm0 have hval := congrArg val h simpa only [Fin.val_zero, m', Fin.val_mk] using hval.symm
Causalean.Stat.Nonparametric.equivKernelWeight_reproduces · Causalean/Stat/Nonparametric/LocalPoly/Weights.lean:50 · uses designMatrix , equivKernelWeight
4 supporting declarations (lemmas, instances)
  • wls_intercept_eq_equivKernelSmoother theorem — The local-polynomial WLS intercept is the equivalent-kernel linear smoother. If the weighted design moment matrix is invertible and c minimizes the weighted sum of squares, then the fitted intercept c 0 equals the linear smoother ∑ᵢ Sᵢ Yᵢ with the equivalent-kernel weights Sᵢ = equivKernelWeight p x w i. Combined with equivKernelWeight_reproduces and linearSmoother_bias_of_reproduces, this yields the interior local-polynomial bias estimate.
    N p :
    Fin N → ℝ
    Fin (p + 1) → ℝ
    hw :
    ∀ i, 0 ≤ w i
    hM :
    hmin :
    ∀ c' : Fin (p + 1) → ℝ,
    (∑ i, w i * (Y i - ∑ j, c j * x i ^ (j : ℕ)) ^ 2)
    ≤ ∑ i, w i * (Y i - ∑ j, c' j * x i ^ (j : ℕ)) ^ 2
    c 0 = ∑ i, equivKernelWeight p x w i * Y i
    Proof (Lean source)
    theorem wls_intercept_eq_equivKernelSmoother {N p : ℕ} {x w Y : Fin N → ℝ} {c : Fin (p + 1) → ℝ} (hw : ∀ i, 0 ≤ w i) (hM : IsUnit (designMatrix p x w).det) (hmin : ∀ c' : Fin (p + 1) → ℝ, (∑ i, w i * (Y i - ∑ j, c j * x i ^ (j : ℕ)) ^ 2) ≤ ∑ i, w i * (Y i - ∑ j, c' j * x i ^ (j : ℕ)) ^ 2) : c 0 = ∑ i, equivKernelWeight p x w i * Y i := by let M : Matrix (Fin (p + 1)) (Fin (p + 1)) ℝ := designMatrix p x w let b : Fin (p + 1) → ℝ := fun k => ∑ i, w i * x i ^ (k : ℕ) * Y i have hnormal_scalar : ∀ k : Fin (p + 1), b k = ∑ i, w i * x i ^ (k : ℕ) * (∑ j, c j * x i ^ (j : ℕ)) := by intro k have hne := wls_normal_equations (x := x) (w := w) (Y := Y) (c := c) hw hmin k have hdiff : b k - ∑ i, w i * x i ^ (k : ℕ) * (∑ j, c j * x i ^ (j : ℕ)) = 0 := by rw [← Finset.sum_sub_distrib] calc (∑ i, (w i * x i ^ (k : ℕ) * Y i - w i * x i ^ (k : ℕ) * (∑ j, c j * x i ^ (j : ℕ)))) = ∑ i, w i * (Y i - ∑ j, c j * x i ^ (j : ℕ)) * x i ^ (k : ℕ) := by apply Finset.sum_congr rfl intro i hi ring _ = 0 := hne exact sub_eq_zero.mp hdiff have hnormal : M *ᵥ c = b := by funext k calc (M *ᵥ c) k = ∑ j, M k j * c j := by simp [mulVec, dotProduct] _ = ∑ j : Fin (p + 1), (∑ i, w i * x i ^ (k : ℕ) * x i ^ (j : ℕ)) * c j := by simp only [M, designMatrix] _ = ∑ i, w i * x i ^ (k : ℕ) * (∑ j : Fin (p + 1), c j * x i ^ (j : ℕ)) := by simp_rw [Finset.sum_mul] rw [Finset.sum_comm] apply Finset.sum_congr rfl intro i hi rw [Finset.mul_sum] apply Finset.sum_congr rfl intro j hj ring _ = b k := (hnormal_scalar k).symm have hMinv : M⁻¹ * M = 1 := by rw [Matrix.nonsing_inv_mul] simpa only [M] using hM have hc_eq : c = M⁻¹ *ᵥ b := by calc c = (1 : Matrix (Fin (p + 1)) (Fin (p + 1)) ℝ) *ᵥ c := by simp _ = (M⁻¹ * M) *ᵥ c := by simp only [hMinv] _ = M⁻¹ *ᵥ (M *ᵥ c) := by rw [Matrix.mulVec_mulVec] _ = M⁻¹ *ᵥ b := by rw [hnormal] calc c 0 = (M⁻¹ *ᵥ b) 0 := by rw [hc_eq] _ = ∑ k, M⁻¹ 0 k * b k := by simp [mulVec, dotProduct] _ = ∑ k, M⁻¹ 0 k * (∑ i, w i * x i ^ (k : ℕ) * Y i) := by simp only [b] _ = ∑ i, (∑ k, M⁻¹ 0 k * (w i * x i ^ (k : ℕ))) * Y i := by simp_rw [Finset.mul_sum] rw [Finset.sum_comm] apply Finset.sum_congr rfl intro i hi rw [Finset.sum_mul] apply Finset.sum_congr rfl intro k hk ring _ = ∑ i, equivKernelWeight p x w i * Y i := by simp only [equivKernelWeight, M]
    Causalean.Stat.Nonparametric.wls_intercept_eq_equivKernelSmoother · Causalean/Stat/Nonparametric/LocalPoly/Weights.lean:99
  • equivKernel_weighted_sq_sum theorem — Leverage identity for the equivalent kernel. Writing the equivalent-kernel weight as Sᵢ = wᵢ · gᵢ with gᵢ = ∑ₖ (M⁻¹)₀ₖ xᵢᵏ the unweighted kernel, the weighted leverage equals the (0,0) entry of the inverse moment matrix: ∑ᵢ wᵢ gᵢ² = (M⁻¹)₀₀. (Algebraically e₀ᵀ M⁻¹ M M⁻¹ e₀ = e₀ᵀ M⁻¹ e₀.)
    N p :
    Fin N → ℝ
    hM :
    (∑ i, w i * (∑ k, (designMatrix p x w)⁻¹ 0 k * x i ^ (k : ℕ)) ^ 2)
    = (designMatrix p x w)⁻¹ 0 0
    Proof (Lean source)
    theorem equivKernel_weighted_sq_sum {N p : ℕ} {x w : Fin N → ℝ} (hM : IsUnit (designMatrix p x w).det) : (∑ i, w i * (∑ k, (designMatrix p x w)⁻¹ 0 k * x i ^ (k : ℕ)) ^ 2) = (designMatrix p x w)⁻¹ 0 0 := by let M : Matrix (Fin (p + 1)) (Fin (p + 1)) ℝ := designMatrix p x w have hMinv : M⁻¹ * M = 1 := by rw [Matrix.nonsing_inv_mul] simpa only [M] using hM calc (∑ i, w i * (∑ k, (designMatrix p x w)⁻¹ 0 k * x i ^ (k : ℕ)) ^ 2) = ∑ i, w i * ((∑ k, M⁻¹ 0 k * x i ^ (k : ℕ)) * (∑ l, M⁻¹ 0 l * x i ^ (l : ℕ))) := by simp only [M] apply Finset.sum_congr rfl intro i hi rw [sq] _ = ∑ k, ∑ l, M⁻¹ 0 k * M⁻¹ 0 l * M k l := by calc (∑ i, w i * ((∑ k, M⁻¹ 0 k * x i ^ (k : ℕ)) * (∑ l, M⁻¹ 0 l * x i ^ (l : ℕ)))) = ∑ i, ∑ k, ∑ l, w i * ((M⁻¹ 0 k * x i ^ (k : ℕ)) * (M⁻¹ 0 l * x i ^ (l : ℕ))) := by apply Finset.sum_congr rfl intro i hi rw [Finset.sum_mul_sum] rw [Finset.mul_sum] apply Finset.sum_congr rfl intro k hk rw [Finset.mul_sum] _ = ∑ k, ∑ i, ∑ l, w i * ((M⁻¹ 0 k * x i ^ (k : ℕ)) * (M⁻¹ 0 l * x i ^ (l : ℕ))) := by rw [Finset.sum_comm] _ = ∑ k, ∑ l, ∑ i, w i * ((M⁻¹ 0 k * x i ^ (k : ℕ)) * (M⁻¹ 0 l * x i ^ (l : ℕ))) := by apply Finset.sum_congr rfl intro k hk rw [Finset.sum_comm] _ = ∑ k, ∑ l, M⁻¹ 0 k * M⁻¹ 0 l * M k l := by apply Finset.sum_congr rfl intro k hk apply Finset.sum_congr rfl intro l hl calc (∑ i, w i * ((M⁻¹ 0 k * x i ^ (k : ℕ)) * (M⁻¹ 0 l * x i ^ (l : ℕ)))) = ∑ i, (M⁻¹ 0 k * M⁻¹ 0 l) * (w i * x i ^ (k : ℕ) * x i ^ (l : ℕ)) := by apply Finset.sum_congr rfl intro i hi ring _ = (M⁻¹ 0 k * M⁻¹ 0 l) * (∑ i, w i * x i ^ (k : ℕ) * x i ^ (l : ℕ)) := by rw [Finset.mul_sum] _ = M⁻¹ 0 k * M⁻¹ 0 l * M k l := by simp only [M, designMatrix] _ = ∑ l, (∑ k, M⁻¹ 0 k * M k l) * M⁻¹ 0 l := by rw [Finset.sum_comm] apply Finset.sum_congr rfl intro l hl rw [Finset.sum_mul] apply Finset.sum_congr rfl intro k hk ring _ = ∑ l, (M⁻¹ * M) 0 l * M⁻¹ 0 l := by apply Finset.sum_congr rfl intro l hl rw [Matrix.mul_apply] _ = ∑ l, (1 : Matrix (Fin (p + 1)) (Fin (p + 1)) ℝ) 0 l * M⁻¹ 0 l := by simp only [hMinv] _ = M⁻¹ 0 0 := by simp [Matrix.one_apply]
    Causalean.Stat.Nonparametric.equivKernel_weighted_sq_sum · Causalean/Stat/Nonparametric/LocalPoly/Weights.lean:187
  • equivKernelWeight_sq_sum_le theorem — Leverage bound for the equivalent kernel. With nonnegative weights bounded by W, the local-polynomial equivalent-kernel weights satisfy ∑ᵢ Sᵢ² ≤ W · (M⁻¹)₀₀. Combined with linearSmoother_variance_le, this reduces the interior O((Nh)^{−1/2}) stochastic-error rate to the single concentration bound (M⁻¹)₀₀ = O(1/(Nh)).
    N p :
    Fin N → ℝ
    W :
    hM :
    hw :
    ∀ i, 0 ≤ w i
    hwW :
    ∀ i, w i ≤ W
    (∑ i, equivKernelWeight p x w i ^ 2) ≤ W * (designMatrix p x w)⁻¹ 0 0
    Proof (Lean source)
    theorem equivKernelWeight_sq_sum_le {N p : ℕ} {x w : Fin N → ℝ} {W : ℝ} (hM : IsUnit (designMatrix p x w).det) (hw : ∀ i, 0 ≤ w i) (hwW : ∀ i, w i ≤ W) : (∑ i, equivKernelWeight p x w i ^ 2) ≤ W * (designMatrix p x w)⁻¹ 0 0 := by let M : Matrix (Fin (p + 1)) (Fin (p + 1)) ℝ := designMatrix p x w let g : Fin N → ℝ := fun i => ∑ k, M⁻¹ 0 k * x i ^ (k : ℕ) have hfactor : ∀ i, equivKernelWeight p x w i = w i * g i := by intro i calc equivKernelWeight p x w i = ∑ k, M⁻¹ 0 k * (w i * x i ^ (k : ℕ)) := by simp only [equivKernelWeight, M] _ = ∑ k, w i * (M⁻¹ 0 k * x i ^ (k : ℕ)) := by apply Finset.sum_congr rfl intro k hk ring _ = w i * g i := by simp only [g] rw [Finset.mul_sum] have hterm : ∀ i, equivKernelWeight p x w i ^ 2 ≤ W * (w i * g i ^ 2) := by intro i have hsq_le : w i ^ 2 ≤ W * w i := by nlinarith [hw i, hwW i] have hg_nonneg : 0 ≤ g i ^ 2 := sq_nonneg (g i) calc equivKernelWeight p x w i ^ 2 = (w i * g i) ^ 2 := by rw [hfactor i] _ = w i ^ 2 * g i ^ 2 := by ring _ ≤ (W * w i) * g i ^ 2 := by exact mul_le_mul_of_nonneg_right hsq_le hg_nonneg _ = W * (w i * g i ^ 2) := by ring have hweighted : (∑ i, w i * g i ^ 2) = M⁻¹ 0 0 := by simpa only [g, M] using (equivKernel_weighted_sq_sum (N := N) (p := p) (x := x) (w := w) hM) calc (∑ i, equivKernelWeight p x w i ^ 2) ≤ ∑ i, W * (w i * g i ^ 2) := by exact Finset.sum_le_sum (fun i hi => hterm i) _ = W * (∑ i, w i * g i ^ 2) := by rw [Finset.mul_sum] _ = W * M⁻¹ 0 0 := by rw [hweighted] _ = W * (designMatrix p x w)⁻¹ 0 0 := by simp only [M]
    Causalean.Stat.Nonparametric.equivKernelWeight_sq_sum_le · Causalean/Stat/Nonparametric/LocalPoly/Weights.lean:266
  • equivKernelWeight_abs_sum_sq_le theorem — Cauchy–Schwarz leverage bound for the equivalent kernel. The ℓ¹ leverage of the equivalent-kernel weights is controlled by the product of the (0,0) entries of the design moment matrix and its inverse: (∑ᵢ |Sᵢ|)² ≤ M₀₀ · (M⁻¹)₀₀, where M₀₀ = ∑ᵢ wᵢ is the total weight. (Cauchy–Schwarz on Sᵢ = wᵢ gᵢ split as √wᵢ · √wᵢ gᵢ, using ∑ᵢ wᵢ gᵢ² = (M⁻¹)₀₀.) Together with equivKernelWeight_sq_sum_le this reduces *both* the bias leverage ∑ᵢ|Sᵢ| and the variance leverage ∑ᵢ Sᵢ² to the design quantities M₀₀ and (M⁻¹)₀₀.
    N p :
    Fin N → ℝ
    hM :
    hw :
    ∀ i, 0 ≤ w i
    (∑ i, |equivKernelWeight p x w i|) ^ 2
    ≤ (designMatrix p x w) 0 0 * (designMatrix p x w)⁻¹ 0 0
    Proof (Lean source)
    theorem equivKernelWeight_abs_sum_sq_le {N p : ℕ} {x w : Fin N → ℝ} (hM : IsUnit (designMatrix p x w).det) (hw : ∀ i, 0 ≤ w i) : (∑ i, |equivKernelWeight p x w i|) ^ 2 ≤ (designMatrix p x w) 0 0 * (designMatrix p x w)⁻¹ 0 0 := by let M : Matrix (Fin (p + 1)) (Fin (p + 1)) ℝ := designMatrix p x w let g : Fin N → ℝ := fun i => ∑ k, M⁻¹ 0 k * x i ^ (k : ℕ) have hfactor : ∀ i, equivKernelWeight p x w i = w i * g i := by intro i calc equivKernelWeight p x w i = ∑ k, M⁻¹ 0 k * (w i * x i ^ (k : ℕ)) := by simp only [equivKernelWeight, M] _ = ∑ k, w i * (M⁻¹ 0 k * x i ^ (k : ℕ)) := by apply Finset.sum_congr rfl intro k hk ring _ = w i * g i := by simp only [g] rw [Finset.mul_sum] have habs : ∀ i, |equivKernelWeight p x w i| = w i * |g i| := by intro i rw [hfactor i, abs_mul, abs_of_nonneg (hw i)] have hM00 : M 0 0 = ∑ i, w i := by simp [M, designMatrix] have hweighted : (∑ i, w i * g i ^ 2) = M⁻¹ 0 0 := by simpa only [g, M] using (equivKernel_weighted_sq_sum (N := N) (p := p) (x := x) (w := w) hM) have hleft : (∑ i, sqrt (w i) * (sqrt (w i) * |g i|)) = ∑ i, |equivKernelWeight p x w i| := by apply Finset.sum_congr rfl intro i hi calc sqrt (w i) * (sqrt (w i) * |g i|) = (sqrt (w i) * sqrt (w i)) * |g i| := by ring _ = w i * |g i| := by rw [Real.mul_self_sqrt (hw i)] _ = |equivKernelWeight p x w i| := (habs i).symm have hfirst : (∑ i, sqrt (w i) ^ 2) = M 0 0 := by calc (∑ i, sqrt (w i) ^ 2) = ∑ i, w i := by apply Finset.sum_congr rfl intro i hi exact Real.sq_sqrt (hw i) _ = M 0 0 := hM00.symm have hsecond : (∑ i, (sqrt (w i) * |g i|) ^ 2) = M⁻¹ 0 0 := by calc (∑ i, (sqrt (w i) * |g i|) ^ 2) = ∑ i, w i * g i ^ 2 := by apply Finset.sum_congr rfl intro i hi calc (sqrt (w i) * |g i|) ^ 2 = sqrt (w i) ^ 2 * |g i| ^ 2 := by ring _ = w i * g i ^ 2 := by rw [Real.sq_sqrt (hw i), sq_abs] _ = M⁻¹ 0 0 := hweighted have hcs := Finset.sum_mul_sq_le_sq_mul_sq univ (fun i : Fin N => sqrt (w i)) (fun i : Fin N => sqrt (w i) * |g i|) rw [hleft, hfirst, hsecond] at hcs simpa only [M] using hcs
    Causalean.Stat.Nonparametric.equivKernelWeight_abs_sum_sq_le · Causalean/Stat/Nonparametric/LocalPoly/Weights.lean:318
Bias 1 core · 0 supporting Bias bounds for interior local-polynomial regression, combining equivalent-kernel polynomial reproduction with the Hölder–Taylor remainder. ★ localPoly_intercept_bias

Interior local-polynomial bias O(h^β)

Bias bounds for interior local-polynomial regression, combining equivalent-kernel polynomial reproduction with the Hölder–Taylor remainder.

This file assembles the deterministic bias estimate for the interior local-polynomial regression estimator (Fan–Gijbels 1996 §3.1; Tsybakov 2009 Ch. 1) from its building blocks:

* wls_intercept_eq_equivKernelSmoother — the fitted intercept is the equivalent-kernel linear smoother c₀ = ∑ᵢ Sᵢ f(aᵢ); * equivKernelWeight_reproduces — those weights reproduce polynomials up to degree p = holderDerivOrder β; * linearSmoother_bias_window — a polynomial-reproducing smoother whose design lies within bandwidth h has bias ≤ (M/p!)·(∑ᵢ|Sᵢ|)·h^β.

The result: the degree-p local-polynomial intercept fitted to a β-Hölder regression function f (noise-free responses Yᵢ = f(aᵢ)), with an invertible weighted design moment matrix and design points within bandwidth h of the target t, has bias

|c₀ − f t| ≤ (M/p!)·(∑ᵢ |Sᵢ|)·h^β,

i.e. O(h^β) once the leverage ∑ᵢ|Sᵢ| is controlled by the design density.

theorem localPoly_intercept_bias reviewed
Causalean.Stat.Nonparametric

Interior local-polynomial bias is O(h^β). Let p denote the largest natural number strictly below the smoothness index β. If β is positive, the Hölder constant M is nonnegative, the design weights w are nonnegative, the target point t lies in a window [lo,hi], every design point aᵢ lies in the same window, every design point is within bandwidth h of t, the regression function f is p times continuously differentiable, its p-th derivative is (β−p)-Hölder with constant M on the window, the weighted design moment matrix is invertible, and c globally minimizes the weighted degree-p least-squares objective at noise-free responses f(aᵢ), then the fitted intercept c 0 estimates f t with bias |c 0 − f t| ≤ (M/p!)·(∑ᵢ |Sᵢ|)·h^β, where Sᵢ are the local-polynomial equivalent-kernel weights.

Formal statement
N :
β M lo hi t h :
a w :
Fin N → ℝ
f :
ℝ → ℝ
c :
Fin ((holderDerivOrder β) + 1) → ℝ
:
0 < β
hM :
0 ≤ M
hw :
∀ i, 0 ≤ w i
ht :
t ∈ Icc lo hi
ha :
∀ i, a i ∈ Icc lo hi
hwin :
∀ i, |a i - t| ≤ h
hf :
hb :
∀ x ∈ Icc lo hi,
∀ y ∈ Icc lo hi,
≤ M * |x - y| ^ (β - ((holderDerivOrder β) : ℝ))
hMdet :
IsUnit (designMatrix (holderDerivOrder β) (fun i => a i - t) w).det
hmin :
∀ c' : Fin ((holderDerivOrder β) + 1) → ℝ,
(∑ i, w i * (f (a i) - ∑ j, c j * (a i - t) ^ (j : ℕ)) ^ 2)
≤ ∑ i, w i * (f (a i) - ∑ j, c' j * (a i - t) ^ (j : ℕ)) ^ 2
|c 0 - f t|
≤ (M / ((holderDerivOrder β)).factorial) * (∑ i, |equivKernelWeight (holderDerivOrder β) (fun i => a i - t) w i|) * h ^ β
Proof (Lean source)
theorem localPoly_intercept_bias {N : ℕ} {β M lo hi t h : ℝ} {a w : Fin N → ℝ} {f : ℝ → ℝ} {c : Fin ((holderDerivOrder β) + 1) → ℝ} (hβ : 0 < β) (hM : 0 ≤ M) (hw : ∀ i, 0 ≤ w i) (ht : t ∈ Icc lo hi) (ha : ∀ i, a i ∈ Icc lo hi) (hwin : ∀ i, |a i - t| ≤ h) (hf : ContDiff ℝ (holderDerivOrder β) f) (hb : ∀ x ∈ Icc lo hi, ∀ y ∈ Icc lo hi, |iteratedDeriv (holderDerivOrder β) f x - iteratedDeriv (holderDerivOrder β) f y| ≤ M * |x - y| ^ (β - ((holderDerivOrder β) : ℝ))) (hMdet : IsUnit (designMatrix (holderDerivOrder β) (fun i => a i - t) w).det) (hmin : ∀ c' : Fin ((holderDerivOrder β) + 1) → ℝ, (∑ i, w i * (f (a i) - ∑ j, c j * (a i - t) ^ (j : ℕ)) ^ 2) ≤ ∑ i, w i * (f (a i) - ∑ j, c' j * (a i - t) ^ (j : ℕ)) ^ 2) : |c 0 - f t| ≤ (M / ((holderDerivOrder β)).factorial) * (∑ i, |equivKernelWeight (holderDerivOrder β) (fun i => a i - t) w i|) * h ^ β := by have hc0 : c 0 = ∑ i, equivKernelWeight (holderDerivOrder β) (fun i => a i - t) w i * f (a i) := wls_intercept_eq_equivKernelSmoother (x := fun i => a i - t) (w := w) (Y := fun i => f (a i)) hw hMdet hmin have hrep : ∀ k : ℕ, k ≤ (holderDerivOrder β) → (∑ i, equivKernelWeight (holderDerivOrder β) (fun i => a i - t) w i * (a i - t) ^ k) = if k = 0 then 1 else 0 := equivKernelWeight_reproduces hMdet rw [hc0] exact linearSmoother_bias_window hβ hM ht ha hwin hf hb hrep
Design­Matrix­Pos­Def 3 core · 3 supporting Positive-definiteness criteria for local-polynomial weighted design moment matrices, viewed as Gram matrices of centered monomial vectors. ★ designMatrix_posDef★ designMatrix_isUnit_det★ nondegenerate_of_distinct_points

Positive-definiteness and invertibility of the design moment matrix

Positive-definiteness criteria for local-polynomial weighted design moment matrices, viewed as Gram matrices of centered monomial vectors.

The weighted design moment matrix M_{jk} = ∑ᵢ wᵢ xᵢʲ xᵢᵏ of a degree-p local-polynomial fit is a weighted Gram matrix of the monomial vectors (1, xᵢ, …, xᵢᵖ): its quadratic form is vᵀ M v = ∑ᵢ wᵢ (∑ⱼ vⱼ xᵢʲ)². Hence with nonnegative weights it is positive semidefinite, and it is positive definite — therefore invertible — exactly when the design is non-degenerate (no nonzero degree-p polynomial vanishes at all positively weighted design points; e.g. there are p+1 distinct points with positive weight, by Vandermonde). This discharges the IsUnit (designMatrix p x w).det hypothesis used throughout the local-polynomial analysis from a concrete condition on the design.

theorem designMatrix_posDef reviewed
Causalean.Stat.Nonparametric

The design moment matrix is positive definite under a non-degeneracy condition on the design. If the design weights w are nonnegative and no nonzero coefficient vector v yields a degree-p polynomial ∑ⱼ vⱼ xᵢʲ that vanishes at every positively weighted design point, then the design moment matrix is positive definite. (Implied by the existence of p+1 distinct design points with positive weight, via Vandermonde.)

Formal statement
N p :
Fin N → ℝ
hw :
∀ i, 0 ≤ w i
hnd :
∀ v : Fin (p + 1) → ℝ
if
v ≠ 0
then
∃ i, 0 < w i ∧ (∑ j, v j * x i ^ (j : ℕ)) ≠ 0
Proof (Lean source)
theorem designMatrix_posDef {N p : ℕ} {x w : Fin N → ℝ} (hw : ∀ i, 0 ≤ w i) (hnd : ∀ v : Fin (p + 1) → ℝ, v ≠ 0 → ∃ i, 0 < w i ∧ (∑ j, v j * x i ^ (j : ℕ)) ≠ 0) : (designMatrix p x w).PosDef := by refine Matrix.PosDef.of_dotProduct_mulVec_pos (designMatrix_isHermitian x w) ?_ intro v hv have hstar : star v = v := by funext i exact star_trivial _ rw [hstar, designMatrix_quadForm] obtain ⟨i₀, hwi₀, hpoly⟩ := hnd v hv refine Finset.sum_pos' (fun i _ => mul_nonneg (hw i) (sq_nonneg _)) ?_ refine ⟨i₀, Finset.mem_univ _, ?_⟩ exact mul_pos hwi₀ (sq_pos_of_ne_zero hpoly)
Causalean.Stat.Nonparametric.designMatrix_posDef · Causalean/Stat/Nonparametric/LocalPoly/DesignMatrixPosDef.lean:81 · uses designMatrix
theorem designMatrix_isUnit_det reviewed
Causalean.Stat.Nonparametric

Invertibility of the design moment matrix from design non-degeneracy. If the design weights w are nonnegative and the design is non-degenerate — no nonzero coefficient vector v yields a degree-p polynomial ∑ⱼ vⱼ xᵢʲ vanishing at every positively weighted design point, then the design moment matrix's determinant is a unit, i.e. the matrix is invertible: a positive definite matrix has a unit determinant, discharging the IsUnit (designMatrix p x w).det hypothesis used throughout the local-polynomial analysis.

Formal statement
N p :
Fin N → ℝ
hw :
∀ i, 0 ≤ w i
hnd :
∀ v : Fin (p + 1) → ℝ
if
v ≠ 0
then
∃ i, 0 < w i ∧ (∑ j, v j * x i ^ (j : ℕ)) ≠ 0
Proof (Lean source)
theorem designMatrix_isUnit_det {N p : ℕ} {x w : Fin N → ℝ} (hw : ∀ i, 0 ≤ w i) (hnd : ∀ v : Fin (p + 1) → ℝ, v ≠ 0 → ∃ i, 0 < w i ∧ (∑ j, v j * x i ^ (j : ℕ)) ≠ 0) : IsUnit (designMatrix p x w).det := (Matrix.isUnit_iff_isUnit_det _).mp (designMatrix_posDef hw hnd).isUnit
Causalean.Stat.Nonparametric.designMatrix_isUnit_det · Causalean/Stat/Nonparametric/LocalPoly/DesignMatrixPosDef.lean:102 · uses designMatrix
theorem nondegenerate_of_distinct_points reviewed
Causalean.Stat.Nonparametric

Design non-degeneracy from distinct positively-weighted points (Vandermonde). For a set S of design indices, if every index in S carries a positive weight and the design points xᵢ take at least p+1 distinct values on S, then the design non-degeneracy condition holds: no nonzero coefficient vector v yields a degree-p polynomial ∑ⱼ vⱼ xᵢʲ that vanishes at every positively weighted design point.

Formal statement
N p :
Fin N → ℝ
S :
hpos :
∀ i ∈ S, 0 < w i
hdistinct :
p + 1 ≤ (S.image x).card
∀ v : Fin (p + 1) → ℝ
if
v ≠ 0
then
∃ i, 0 < w i ∧ (∑ j, v j * x i ^ (j : ℕ)) ≠ 0
Proof (Lean source)
theorem nondegenerate_of_distinct_points {N p : ℕ} {x w : Fin N → ℝ} (S : Finset (Fin N)) (hpos : ∀ i ∈ S, 0 < w i) (hdistinct : p + 1 ≤ (S.image x).card) : ∀ v : Fin (p + 1) → ℝ, v ≠ 0 → ∃ i, 0 < w i ∧ (∑ j, v j * x i ^ (j : ℕ)) ≠ 0 := by classical intro v hv by_contra hcon push_neg at hcon let P : Polynomial ℝ := ∑ j : Fin (p + 1), Polynomial.C (v j) * Polynomial.X ^ (j : ℕ) have hP_eval : ∀ a : ℝ, P.eval a = ∑ j : Fin (p + 1), v j * a ^ (j : ℕ) := by intro a simp only [P, Polynomial.eval_finset_sum, Polynomial.eval_mul, Polynomial.eval_C, Polynomial.eval_pow, Polynomial.eval_X] have hP_coeff : ∀ j₀ : Fin (p + 1), P.coeff (j₀ : ℕ) = v j₀ := by intro j₀ simp only [P, Polynomial.finset_sum_coeff, Polynomial.coeff_C_mul_X_pow] rw [Finset.sum_eq_single j₀] · simp · intro j _ hj by_cases hval : (j₀ : ℕ) = (j : ℕ) · exact (hj (Fin.ext hval.symm)).elim · simp [hval] · intro hj₀ simp at hj₀ obtain ⟨j₀, hj₀⟩ := Function.ne_iff.mp hv have hcoeff_ne : P.coeff (j₀ : ℕ) ≠ 0 := by simpa [hP_coeff j₀] using hj₀ have hP_ne : P ≠ 0 := by intro hzero exact hcoeff_ne (by simp [hzero]) have hP_natDegree : P.natDegree ≤ p := by simpa [P] using (Polynomial.natDegree_sum_le_of_forall_le (s := univ) (f := fun j : Fin (p + 1) => Polynomial.C (v j) * Polynomial.X ^ (j : ℕ)) (n := p) (by intro j _ exact (Polynomial.natDegree_C_mul_X_pow_le (v j) (j : ℕ)).trans (Nat.lt_succ_iff.mp j.isLt))) let Z : Finset ℝ := S.image x have hsubset : Z.val ⊆ P.roots := by intro a ha have haZ : a ∈ Z := by simpa using ha obtain ⟨i, hiS, hxi⟩ := Finset.mem_image.mp haZ have hroot_eval : P.eval a = 0 := by rw [hP_eval, ← hxi] exact hcon i (hpos i hiS) exact (Polynomial.mem_roots hP_ne).mpr (by simpa [Polynomial.IsRoot] using hroot_eval) have hZ_le_degree : Z.card ≤ P.natDegree := Polynomial.card_le_degree_of_subset_roots (p := P) (Z := Z) hsubset have hZ_le_p : Z.card ≤ p := hZ_le_degree.trans hP_natDegree have hZ_ge : p + 1 ≤ Z.card := by simpa [Z] using hdistinct omega
Causalean.Stat.Nonparametric.nondegenerate_of_distinct_points · Causalean/Stat/Nonparametric/LocalPoly/DesignMatrixPosDef.lean:115
3 supporting declarations (lemmas, instances)
  • designMatrix_quadForm theorem — Gram quadratic form of the design moment matrix. vᵀ M v = ∑ᵢ wᵢ (∑ⱼ vⱼ xᵢʲ)² — the design moment matrix is the weighted Gram matrix of the monomial feature vectors.
    N p :
    x w :
    Fin N → ℝ
    v :
    Fin (p + 1) → ℝ
    v ⬝ᵥ (designMatrix p x w *ᵥ v) = ∑ i, w i * (∑ j, v j * x i ^ (j : ℕ)) ^ 2
    Proof (Lean source)
    theorem designMatrix_quadForm {N p : ℕ} (x w : Fin N → ℝ) (v : Fin (p + 1) → ℝ) : v ⬝ᵥ (designMatrix p x w *ᵥ v) = ∑ i, w i * (∑ j, v j * x i ^ (j : ℕ)) ^ 2 := by simp only [dotProduct, mulVec, designMatrix] calc (∑ j : Fin (p + 1), v j * ∑ k : Fin (p + 1), (∑ i : Fin N, w i * x i ^ (j : ℕ) * x i ^ (k : ℕ)) * v k) = ∑ j : Fin (p + 1), ∑ k : Fin (p + 1), ∑ i : Fin N, v j * (w i * x i ^ (j : ℕ) * x i ^ (k : ℕ)) * v k := by refine Finset.sum_congr rfl (fun j _ => ?_) rw [Finset.mul_sum] refine Finset.sum_congr rfl (fun k _ => ?_) rw [Finset.sum_mul, Finset.mul_sum] exact Finset.sum_congr rfl (fun i _ => by ring) _ = ∑ j : Fin (p + 1), ∑ i : Fin N, ∑ k : Fin (p + 1), v j * (w i * x i ^ (j : ℕ) * x i ^ (k : ℕ)) * v k := by apply Finset.sum_congr rfl intro j _ rw [Finset.sum_comm] _ = ∑ i : Fin N, ∑ j : Fin (p + 1), ∑ k : Fin (p + 1), v j * (w i * x i ^ (j : ℕ) * x i ^ (k : ℕ)) * v k := by rw [Finset.sum_comm] _ = ∑ i, w i * (∑ j, v j * x i ^ (j : ℕ)) ^ 2 := by refine Finset.sum_congr rfl (fun i _ => ?_) rw [pow_two, Finset.sum_mul_sum, Finset.mul_sum] refine Finset.sum_congr rfl (fun j _ => ?_) rw [Finset.mul_sum] exact Finset.sum_congr rfl (fun k _ => by ring)
    Causalean.Stat.Nonparametric.designMatrix_quadForm · Causalean/Stat/Nonparametric/LocalPoly/DesignMatrixPosDef.lean:31
  • designMatrix_isHermitian theorem — The design moment matrix is symmetric.
    N p :
    x w :
    Fin N → ℝ
    Proof (Lean source)
    theorem designMatrix_isHermitian {N p : ℕ} (x w : Fin N → ℝ) : (designMatrix p x w).IsHermitian := by ext j k simp only [Matrix.conjTranspose_apply, designMatrix, star_trivial] exact Finset.sum_congr rfl (fun i _ => by ring)
    Causalean.Stat.Nonparametric.designMatrix_isHermitian · Causalean/Stat/Nonparametric/LocalPoly/DesignMatrixPosDef.lean:62
  • designMatrix_posSemidef theorem — The design moment matrix is positive semidefinite when the weights are nonnegative (a sum of weighted rank-one squares).
    N p :
    Fin N → ℝ
    hw :
    ∀ i, 0 ≤ w i
    Proof (Lean source)
    theorem designMatrix_posSemidef {N p : ℕ} {x w : Fin N → ℝ} (hw : ∀ i, 0 ≤ w i) : (designMatrix p x w).PosSemidef := by refine Matrix.PosSemidef.of_dotProduct_mulVec_nonneg (designMatrix_isHermitian x w) ?_ intro v have hstar : star v = v := by funext i exact star_trivial _ rw [hstar, designMatrix_quadForm] exact sum_nonneg (fun i _ => mul_nonneg (hw i) (sq_nonneg _))
    Causalean.Stat.Nonparametric.designMatrix_posSemidef · Causalean/Stat/Nonparametric/LocalPoly/DesignMatrixPosDef.lean:69
Smoother­Variance 1 core · 0 supporting Specializes the generic spherical linear-smoother variance bound (Causalean.Stat.Nonparametric.LeastSquares.SmootherVariance) to the degree-p local-polynomial equivalent-kernel weights. ★ localPoly_intercept_variance_le

Variance of the interior local-polynomial estimator

Specializes the generic spherical linear-smoother variance bound (Causalean.Stat.Nonparametric.LeastSquares.SmootherVariance) to the degree-p local-polynomial equivalent-kernel weights. The leverage ∑ᵢ Sᵢ² is controlled by the intercept entry of the inverse design moment matrix (M⁻¹)₀₀ (equivKernelWeight_sq_sum_le), so the interior O((Nh)^{−1/2}) stochastic-error rate reduces to the single design-concentration bound (M⁻¹)₀₀ = O(1/(Nh)).

theorem localPoly_intercept_variance_le reviewed
Causalean.Stat.Nonparametric

Variance of the interior local-polynomial estimator. The degree-p local-polynomial equivalent-kernel smoother ∑ᵢ Sᵢ Yᵢ, applied to a family Y of square-integrable responses that is spherical with common scale σ, with an invertible design moment matrix and nonnegative weights bounded above by a constant W, has variance Var[∑ᵢ Sᵢ Yᵢ] ≤ σ² · W · (M⁻¹)₀₀. This reduces the interior O((Nh)^{−1/2}) stochastic-error rate to the single design-concentration bound (M⁻¹)₀₀ = O(1/(Nh)).

Formal statement
Ω :
Type*
N p :
x w :
Fin N → ℝ
Y :
Fin N → Ω → ℝ
σ W :
hY :
∀ i, MemLp (Y i) 2 μ
hsph :
hM :
hw :
∀ i, 0 ≤ w i
hwW :
∀ i, w i ≤ W
Var[fun ω => ∑ i, equivKernelWeight p x w i * Y i ω; μ]
≤ σ ^ 2 * (W * (designMatrix p x w)⁻¹ 0 0)
Proof (Lean source)
theorem localPoly_intercept_variance_le {Ω : Type*} {N p : ℕ} [MeasurableSpace Ω] {μ : Measure Ω} [IsProbabilityMeasure μ] {x w : Fin N → ℝ} {Y : Fin N → Ω → ℝ} {σ W : ℝ} (hY : ∀ i, MemLp (Y i) 2 μ) (hsph : SphericalFamily Y μ σ) (hM : IsUnit (designMatrix p x w).det) (hw : ∀ i, 0 ≤ w i) (hwW : ∀ i, w i ≤ W) : Var[fun ω => ∑ i, equivKernelWeight p x w i * Y i ω; μ] ≤ σ ^ 2 * (W * (designMatrix p x w)⁻¹ 0 0) := linearSmoother_variance_le hY hsph (equivKernelWeight_sq_sum_le hM hw hwW)