Stat.Nonparametric.Series­Sieve

This barrel collects reusable series/sieve approximation and least-squares prediction tools for nonparametric regression and projection arguments.

Jackson 5 core · 4 supporting Jackson-type approximation bounds for piecewise-polynomial sieves on one-dimensional Hölder classes. ★ piecewiseTaylor_sup_approx_rate

Jackson-type approximation for the piecewise-polynomial sieve

Jackson-type approximation bounds for piecewise-polynomial sieves on one-dimensional Hölder classes.

This file proves a from-scratch Jackson theorem for a concrete one-dimensional sieve: the piecewise-Taylor approximant on a uniform J-cell partition of a window [lo, hi]. Splitting [lo, hi] into J cells of width δ = (hi − lo)/J and replacing f on each cell by its degree-p Taylor polynomial, where p = holderDerivOrder β, expanded at the cell's left endpoint yields a piecewise polynomial whose uniform (sup-norm) approximation error obeys

sup_{x ∈ [lo,hi]} |f x − g x| ≤ (M / p!) · ((hi − lo)/J)^β = C · J^{−β}

under the standard Hölder convention used here: f has p continuous derivatives and its p-th derivative satisfies the displayed Hölder-type bound with exponent β − p. For positive integer β = m, this means p = m - 1 and exponent 1.

The result is the deterministic approximation-error half of the series least-squares prediction analysis. It feeds the empirical projection reduction in SeriesSieve/Prediction.lean, where a sup-norm approximation bound can control a weighted empirical least-squares objective via projection optimality (lstsq_objective_le_of_orthogonal).

def cellWidth reviewed
Causalean.Stat.Nonparametric

The width δ = (hi − lo)/J of a uniform J-cell partition of [lo, hi].

Definition (Lean source)
noncomputable def cellWidth (lo hi : ℝ) (J : ℕ) : ℝ := (hi - lo) / (J : ℝ)
Causalean.Stat.Nonparametric.cellWidth · Causalean/Stat/Nonparametric/SeriesSieve/Jackson.lean:38
def cellIdx reviewed
Causalean.Stat.Nonparametric

The cell index of x in a uniform J-cell partition of [lo, hi]: the floor ⌊(x − lo)/δ⌋, clamped to the last cell J − 1 (so the right endpoint hi lands in the final cell).

Definition (Lean source)
noncomputable def cellIdx (lo hi : ℝ) (J : ℕ) (x : ℝ) : ℕ := min (J - 1) ⌊(x - lo) / cellWidth lo hi J⌋₊
Causalean.Stat.Nonparametric.cellIdx · Causalean/Stat/Nonparametric/SeriesSieve/Jackson.lean:41
def cellBase reviewed
Causalean.Stat.Nonparametric

The left endpoint lo + (cellIdx x)·δ of the cell containing x. The piecewise-Taylor approximant expands f around this base point.

Definition (Lean source)
noncomputable def cellBase (lo hi : ℝ) (J : ℕ) (x : ℝ) : ℝ := lo + (cellIdx lo hi J x : ℝ) * cellWidth lo hi J
Causalean.Stat.Nonparametric.cellBase · Causalean/Stat/Nonparametric/SeriesSieve/Jackson.lean:47
def piecewiseTaylorApprox reviewed
Causalean.Stat.Nonparametric

The piecewise-Taylor sieve approximant: on the cell containing x, the value of the degree-p Taylor polynomial of f expanded at the cell's left endpoint. This is a piecewise polynomial of degree ≤ p on the uniform J-cell partition of [lo, hi].

Definition (Lean source)
noncomputable def piecewiseTaylorApprox (p : ℕ) (f : ℝ → ℝ) (lo hi : ℝ) (J : ℕ) (x : ℝ) : ℝ := taylorPoly p f (cellBase lo hi J x) x
Causalean.Stat.Nonparametric.piecewiseTaylorApprox · Causalean/Stat/Nonparametric/SeriesSieve/Jackson.lean:52
theorem piecewiseTaylor_sup_approx_rate reviewed
Causalean.Stat.Nonparametric

Jackson rate, J^{−β} form. Fix a Hölder exponent β > 0, a nonnegative Hölder constant M, and a nondegenerate window [lo, hi] with lo < hi subdivided into a positive number J of uniform cells. If f has p = holderDerivOrder β continuous derivatives on the window and its p-th derivative obeys the Hölder bound |f^(p) x − f^(p) y| ≤ M · |x − y|^(β − p) for all x, y in the window, then at any evaluation point x in the window, the piecewise-Taylor approximant on the uniform J-cell partition has pointwise error |f x − g x| ≤ C · J^{−β}, with constant C = (M / p!) · (hi − lo)^β independent of J.

Formal statement
f :
ℝ → ℝ
M β lo hi :
J :
:
0 < β
hM :
0 ≤ M
hlohi :
lo < hi
hJ :
0 < J
hf :
hb :
∀ x ∈ Icc lo hi,
∀ y ∈ Icc lo hi,
≤ M * |x - y| ^ (β - ((holderDerivOrder β) : ℝ))
x :
hx :
x ∈ Icc lo hi
|f x - piecewiseTaylorApprox (holderDerivOrder β) f lo hi J x|
≤ (M / ((holderDerivOrder β)).factorial * (hi - lo) ^ β) * (J : ℝ) ^ (-β)
Proof (Lean source)
theorem piecewiseTaylor_sup_approx_rate {f : ℝ → ℝ} {M β lo hi : ℝ} {J : ℕ} (hβ : 0 < β) (hM : 0 ≤ M) (hlohi : lo < hi) (hJ : 0 < J) (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 β) : ℝ))) {x : ℝ} (hx : x ∈ Icc lo hi) : |f x - piecewiseTaylorApprox (holderDerivOrder β) f lo hi J x| ≤ (M / ((holderDerivOrder β)).factorial * (hi - lo) ^ β) * (J : ℝ) ^ (-β) := by have h := piecewiseTaylor_sup_approx hβ hM hlohi hJ hf hb hx refine h.trans_eq ?_ have hJpos : (0 : ℝ) < (J : ℝ) := by exact_mod_cast hJ have hlo : (0 : ℝ) ≤ hi - lo := by linarith rw [Real.div_rpow hlo hJpos.le, Real.rpow_neg hJpos.le] ring
Causalean.Stat.Nonparametric.piecewiseTaylor_sup_approx_rate · Causalean/Stat/Nonparametric/SeriesSieve/Jackson.lean:203 · uses holderDerivOrder , piecewiseTaylorApprox
4 supporting declarations (lemmas, instances)
  • cellWidth_pos lemma — The cell width is positive on a nondegenerate window.
    lo hi :
    J :
    hlohi :
    lo < hi
    hJ :
    0 < J
    0 < cellWidth lo hi J
    Proof (Lean source)
    lemma cellWidth_pos {lo hi : ℝ} {J : ℕ} (hlohi : lo < hi) (hJ : 0 < J) : 0 < cellWidth lo hi J := by unfold cellWidth have h1 : 0 < hi - lo := by linarith have h2 : (0 : ℝ) < (J : ℝ) := by exact_mod_cast hJ exact div_pos h1 h2
    Causalean.Stat.Nonparametric.cellWidth_pos · Causalean/Stat/Nonparametric/SeriesSieve/Jackson.lean:58
  • cellBase_mem lemma — The cell base point lies inside the window [lo, hi].
    lo hi :
    J :
    hlohi :
    lo < hi
    hJ :
    0 < J
    x :
    cellBase lo hi J x ∈ Icc lo hi
    Proof (Lean source)
    lemma cellBase_mem {lo hi : ℝ} {J : ℕ} (hlohi : lo < hi) (hJ : 0 < J) {x : ℝ} : cellBase lo hi J x ∈ Icc lo hi := by let δ := cellWidth lo hi J have hδ : 0 < δ := cellWidth_pos hlohi hJ constructor · unfold cellBase have hnonneg : 0 ≤ (cellIdx lo hi J x : ℝ) * δ := mul_nonneg (Nat.cast_nonneg _) hδ.le dsimp [δ] at hnonneg ⊢ linarith · unfold cellBase change lo + (cellIdx lo hi J x : ℝ) * δ ≤ hi have hJone : 1 ≤ J := Nat.succ_le_of_lt hJ have hidx_nat : cellIdx lo hi J x ≤ J - 1 := by unfold cellIdx exact min_le_left _ _ have hidx_cast : (cellIdx lo hi J x : ℝ) ≤ (J : ℝ) - 1 := by have hcast : (cellIdx lo hi J x : ℝ) ≤ (J - 1 : ℕ) := by exact_mod_cast hidx_nat have hsub : ((J - 1 : ℕ) : ℝ) = (J : ℝ) - 1 := by rw [Nat.cast_sub hJone, cast_one] linarith have hmul : (cellIdx lo hi J x : ℝ) * δ ≤ ((J : ℝ) - 1) * δ := mul_le_mul_of_nonneg_right hidx_cast hδ.le have hJnz : (J : ℝ) ≠ 0 := by exact_mod_cast (Nat.ne_of_gt hJ) have hJδ : (J : ℝ) * δ = hi - lo := by dsimp [δ] unfold cellWidth field_simp [hJnz] nlinarith [hmul, hδ]
    Causalean.Stat.Nonparametric.cellBase_mem · Causalean/Stat/Nonparametric/SeriesSieve/Jackson.lean:66
  • cellBase_dist lemma — x is within one cell width to the right of its base point: 0 ≤ x − base ≤ δ.
    lo hi :
    J :
    hlohi :
    lo < hi
    hJ :
    0 < J
    x :
    hx :
    x ∈ Icc lo hi
    0 ≤ x - cellBase lo hi J x ∧ x - cellBase lo hi J x ≤ cellWidth lo hi J
    Proof (Lean source)
    lemma cellBase_dist {lo hi : ℝ} {J : ℕ} (hlohi : lo < hi) (hJ : 0 < J) {x : ℝ} (hx : x ∈ Icc lo hi) : 0 ≤ x - cellBase lo hi J x ∧ x - cellBase lo hi J x ≤ cellWidth lo hi J := by let δ := cellWidth lo hi J have hδ : 0 < δ := cellWidth_pos hlohi hJ let q := (x - lo) / δ let m : ℕ := ⌊q⌋₊ let i : ℕ := min (J - 1) m have hq0 : 0 ≤ q := by dsimp [q] exact div_nonneg (by linarith [hx.1]) hδ.le have hJnz : (J : ℝ) ≠ 0 := by exact_mod_cast (Nat.ne_of_gt hJ) have hJδ : (J : ℝ) * δ = hi - lo := by dsimp [δ] unfold cellWidth field_simp [hJnz] have hqJ : q ≤ (J : ℝ) := by have hxq' : q * δ = x - lo := by dsimp [q] field_simp [hδ.ne'] have hmul : q * δ ≤ (J : ℝ) * δ := by linarith [hx.2, hJδ, hxq'] exact le_of_mul_le_mul_right hmul hδ have hmq : (m : ℝ) ≤ q := by exact Nat.floor_le hq0 have hqm : q < (m : ℝ) + 1 := by exact Nat.lt_floor_add_one q have him : (i : ℝ) ≤ (m : ℝ) := by exact_mod_cast (min_le_right (J - 1) m) have hcellidx : cellIdx lo hi J x = i := by unfold cellIdx dsimp [δ, q, m, i] have hxq : δ * q = x - lo := by dsimp [q] field_simp [hδ.ne'] have hrepr : x - cellBase lo hi J x = δ * (q - (i : ℝ)) := by unfold cellBase rw [hcellidx] nlinarith [hxq] constructor · rw [hrepr] exact mul_nonneg hδ.le (by linarith [him, hmq]) · rw [hrepr] have hqi : q ≤ (i : ℝ) + 1 := by by_cases hmle : m ≤ J - 1 · have hi_eq_m : i = m := by dsimp [i] exact min_eq_right hmle rw [hi_eq_m] linarith [hqm] · have hlt : J - 1 < m := Nat.lt_of_not_ge hmle have hle : J - 1 ≤ m := le_of_lt hlt have hi_eq_j : i = J - 1 := by dsimp [i] exact min_eq_left hle rw [hi_eq_j] have hJone : 1 ≤ J := Nat.succ_le_of_lt hJ have hcast : ((J - 1 : ℕ) : ℝ) + 1 = (J : ℝ) := by rw [Nat.cast_sub hJone, cast_one] linarith rw [hcast] exact hqJ have hle1 : q - (i : ℝ) ≤ 1 := by linarith calc δ * (q - (i : ℝ)) ≤ δ * 1 := mul_le_mul_of_nonneg_left hle1 hδ.le _ = cellWidth lo hi J := by simp [δ]
    Causalean.Stat.Nonparametric.cellBase_dist · Causalean/Stat/Nonparametric/SeriesSieve/Jackson.lean:99
  • piecewiseTaylor_sup_approx theorem — Piecewise-Taylor approximation bound under the standard Hölder convention. If f has p = holderDerivOrder β continuous derivatives and its p-th derivative obeys a Hölder bound with exponent β - p on the window, then the corresponding piecewise-Taylor approximant on a uniform J-cell partition has pointwise error at most (M / p!)·((hi − lo)/J)^β. For positive integer β = m, this uses derivative order m - 1 and Hölder exponent 1.
    f :
    ℝ → ℝ
    M β lo hi :
    J :
    :
    0 < β
    hM :
    0 ≤ M
    hlohi :
    lo < hi
    hJ :
    0 < J
    hf :
    hb :
    ∀ x ∈ Icc lo hi,
    ∀ y ∈ Icc lo hi,
    ≤ M * |x - y| ^ (β - ((holderDerivOrder β) : ℝ))
    x :
    hx :
    x ∈ Icc lo hi
    |f x - piecewiseTaylorApprox (holderDerivOrder β) f lo hi J x|
    ≤ M / ((holderDerivOrder β)).factorial * ((hi - lo) / (J : ℝ)) ^ β
    Proof (Lean source)
    theorem piecewiseTaylor_sup_approx {f : ℝ → ℝ} {M β lo hi : ℝ} {J : ℕ} (hβ : 0 < β) (hM : 0 ≤ M) (hlohi : lo < hi) (hJ : 0 < J) (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 β) : ℝ))) {x : ℝ} (hx : x ∈ Icc lo hi) : |f x - piecewiseTaylorApprox (holderDerivOrder β) f lo hi J x| ≤ M / ((holderDerivOrder β)).factorial * ((hi - lo) / (J : ℝ)) ^ β := by have hbase_mem := cellBase_mem (x := x) hlohi hJ have hdist := cellBase_dist hlohi hJ hx have hwpos := cellWidth_pos hlohi hJ -- Hölder–Taylor remainder at base point `cellBase`. have hrem := holder_taylor_remainder (f := f) (M := M) (β := β) (lo := lo) (hi := hi) (t := cellBase lo hi J x) (a := x) hβ hM hbase_mem hx hf hb refine hrem.trans ?_ -- `|x − base|^β ≤ δ^β` since `0 ≤ x − base ≤ δ`. have habs : |x - cellBase lo hi J x| = x - cellBase lo hi J x := abs_of_nonneg hdist.1 have hpow : |x - cellBase lo hi J x| ^ β ≤ (cellWidth lo hi J) ^ β := by rw [habs] exact Real.rpow_le_rpow hdist.1 hdist.2 hβ.le have hcoef : 0 ≤ M / (((holderDerivOrder β)).factorial : ℝ) := div_nonneg hM (by positivity) calc M / (((holderDerivOrder β)).factorial : ℝ) * |x - cellBase lo hi J x| ^ β ≤ M / (((holderDerivOrder β)).factorial : ℝ) * (cellWidth lo hi J) ^ β := mul_le_mul_of_nonneg_left hpow hcoef _ = M / (((holderDerivOrder β)).factorial : ℝ) * ((hi - lo) / (J : ℝ)) ^ β := by rw [cellWidth]
    Causalean.Stat.Nonparametric.piecewiseTaylor_sup_approx · Causalean/Stat/Nonparametric/SeriesSieve/Jackson.lean:167
Prediction 1 core · 3 supporting Prediction-error decompositions for series least squares, combining deterministic approximation error with the spherical-noise variance of the projected fit. ★ seriesLS_expected_prediction_le

Series / sieve least-squares prediction error

Prediction-error decompositions for series least squares, combining deterministic approximation error with the spherical-noise variance of the projected fit.

This file assembles the series least-squares prediction rate O(J^{−s/d} + √(J/N)) from the two reusable substrate pieces:

* approximation (deterministic, bias side): the empirical best-approximation error of the least-squares fit is controlled by the sup-norm error of any comparator, so an externally supplied approximation bound can transfer to the weighted empirical objective; * stochastic (variance side): the exact orthogonal (Pythagorean) decomposition of the prediction error splits off the projected noise, whose expected weighted quadratic form is σ² · (effective degrees of freedom).

Conditioning on the design, the data fit Φ ĉ and the noise-free projection Φ ĉ⁰ differ by a deterministic linear image of the noise (the hat matrix), so the stochastic term's expectation reduces, via the Gauss–Markov spherical-variance identity (linearSmoother_variance_spherical), to σ²·∑ᵢ wᵢ ∑ₖ aᵢₖ². If a separate design argument bounds that effective-degree-of-freedom sum by V, and if a separate approximation argument bounds the noise-free projection error by A, the main theorem gives the oracle inequality A + σ² V.

All results are generic in the design matrix Φ (Newey 1997; Chen 2007; Belloni–Chernozhukov– Chetverikov–Kato 2015).

theorem seriesLS_expected_prediction_le reviewed
Causalean.Stat.Nonparametric

Conditional oracle inequality for series least-squares prediction. Suppose the noise-free projection coefficients c0 have residual orthogonal to every design column, so that the noise-free least-squares objective is bounded by A, and suppose the data fit chat ω differs from c0, at every design row i, by a deterministic linear image ∑ₖ a i k · ε k ω of a noise family ε that is square-integrable, mean zero, and spherical with scale σ, with the weighted trace sum ∑ᵢ wᵢ ∑ₖ aᵢₖ² bounded by V. Then the expected weighted quadratic prediction error of the fitted series coefficients against the target values f is at most A + σ² V:

Formal statement
Ω :
Type*
N :
ι :
Type*
Φ :
Fin N → ι → ℝ
w f :
Fin N → ℝ
c0 :
ι → ℝ
chat :
Ω → ι → ℝ
ε :
Fin N → Ω → ℝ
a :
Fin N → Fin N → ℝ
σ A V :
hortho :
∀ k : ι, ∑ i, w i * lstsqResidual Φ f c0 i * Φ i k = 0
hApprox :
lstsqObjective Φ w f c0 ≤ A
hlin :
∀ ω, ∀ i, (∑ j, (c0 j - chat ω j) * Φ i j) = ∑ k, a i k * ε k ω
:
∀ k, MemLp (ε k) 2 μ
hmean :
∀ k, ∫ ω, ε k ω ∂μ = 0
hsph :
hlev :
(∑ i, w i * ∑ k, a i k ^ 2) ≤ V
∫ ω, lstsqObjective Φ w f (chat ω) ∂μ ≤ A + σ ^ 2 * V
Proof (Lean source)
theorem seriesLS_expected_prediction_le {Ω : Type*} {N : ℕ} {ι : Type*} [Fintype ι] [MeasurableSpace Ω] {μ : Measure Ω} [IsProbabilityMeasure μ] {Φ : Fin N → ι → ℝ} {w f : Fin N → ℝ} {c0 : ι → ℝ} {chat : Ω → ι → ℝ} {ε : Fin N → Ω → ℝ} {a : Fin N → Fin N → ℝ} {σ A V : ℝ} (hortho : ∀ k : ι, ∑ i, w i * lstsqResidual Φ f c0 i * Φ i k = 0) (hApprox : lstsqObjective Φ w f c0 ≤ A) (hlin : ∀ ω, ∀ i, (∑ j, (c0 j - chat ω j) * Φ i j) = ∑ k, a i k * ε k ω) (hε : ∀ k, MemLp (ε k) 2 μ) (hmean : ∀ k, ∫ ω, ε k ω ∂μ = 0) (hsph : SphericalFamily ε μ σ) (hlev : (∑ i, w i * ∑ k, a i k ^ 2) ≤ V) : ∫ ω, lstsqObjective Φ w f (chat ω) ∂μ ≤ A + σ ^ 2 * V := by -- Pointwise decomposition + linearity substitution. have hpt : ∀ ω, lstsqObjective Φ w f (chat ω) = lstsqObjective Φ w f c0 + ∑ i, w i * (∑ k, a i k * ε k ω) ^ 2 := by intro ω rw [seriesLS_prediction_decomp hortho] congr 1 refine Finset.sum_congr rfl (fun i _ => ?_) rw [hlin ω i] -- Integrate. have hstoch_int : Integrable (fun ω => ∑ i, w i * (∑ k, a i k * ε k ω) ^ 2) μ := by apply integrable_finset_sum intro i _ have hD : MemLp (fun ω => ∑ k, a i k * ε k ω) 2 μ := by convert memLp_finset_sum' univ (fun k _ => (hε k).const_mul (a i k)) using 1 ext ω simp exact (hD.integrable_sq.const_mul (w i)) calc ∫ ω, lstsqObjective Φ w f (chat ω) ∂μ = ∫ ω, (lstsqObjective Φ w f c0 + ∑ i, w i * (∑ k, a i k * ε k ω) ^ 2) ∂μ := by exact integral_congr_ae (Filter.Eventually.of_forall hpt) _ = lstsqObjective Φ w f c0 + ∫ ω, ∑ i, w i * (∑ k, a i k * ε k ω) ^ 2 ∂μ := by rw [integral_add (integrable_const _) hstoch_int, integral_const] simp _ = lstsqObjective Φ w f c0 + σ ^ 2 * ∑ i, w i * ∑ k, a i k ^ 2 := by rw [expected_weighted_sq_image_spherical hε hmean hsph] _ ≤ A + σ ^ 2 * V := by have hvar : σ ^ 2 * ∑ i, w i * ∑ k, a i k ^ 2 ≤ σ ^ 2 * V := mul_le_mul_of_nonneg_left hlev (sq_nonneg σ) linarith
3 supporting declarations (lemmas, instances)
  • seriesApprox_le_of_sup theorem — Empirical approximation error is controlled by the best uniform approximant. If the least-squares fit c to target values f has residual orthogonal to every design column (lstsq_normal_equations) and some comparator cstar approximates f uniformly within δ at the design points (|fᵢ − ∑ⱼ cstarⱼ Φᵢⱼ| ≤ δ), then the empirical fit error is at most (∑ᵢ wᵢ)·δ². With the Jackson rate δ = C·J^{−s/d} this is the empirical best-approximation half of the series prediction rate.
    N :
    ι :
    Type*
    Fin N → ι → ℝ
    w f :
    Fin N → ℝ
    c cstar :
    ι → ℝ
    δ :
    hw :
    ∀ i, 0 ≤ w i
    hortho :
    ∀ k : ι, ∑ i, w i * lstsqResidual Φ f c i * Φ i k = 0
    hsup :
    ∀ i, |f i - ∑ j, cstar j * Φ i j| ≤ δ
    lstsqObjective Φ w f c ≤ (∑ i, w i) * δ ^ 2
    Proof (Lean source)
    theorem seriesApprox_le_of_sup {N : ℕ} {ι : Type*} [Fintype ι] {Φ : Fin N → ι → ℝ} {w f : Fin N → ℝ} {c cstar : ι → ℝ} {δ : ℝ} (hw : ∀ i, 0 ≤ w i) (hortho : ∀ k : ι, ∑ i, w i * lstsqResidual Φ f c i * Φ i k = 0) (hsup : ∀ i, |f i - ∑ j, cstar j * Φ i j| ≤ δ) : lstsqObjective Φ w f c ≤ (∑ i, w i) * δ ^ 2 := by have hopt := lstsq_objective_le_of_orthogonal hw hortho cstar refine hopt.trans ?_ unfold lstsqObjective calc ∑ i, w i * lstsqResidual Φ f cstar i ^ 2 ≤ ∑ i, w i * δ ^ 2 := by apply Finset.sum_le_sum intro i _ apply mul_le_mul_of_nonneg_left _ (hw i) have hres : |lstsqResidual Φ f cstar i| ≤ δ := by simpa [lstsqResidual] using hsup i calc lstsqResidual Φ f cstar i ^ 2 = |lstsqResidual Φ f cstar i| ^ 2 := (sq_abs _).symm _ ≤ δ ^ 2 := by apply pow_le_pow_left₀ (abs_nonneg _) hres _ = (∑ i, w i) * δ ^ 2 := by rw [← Finset.sum_mul]
    Causalean.Stat.Nonparametric.seriesApprox_le_of_sup · Causalean/Stat/Nonparametric/SeriesSieve/Prediction.lean:41
  • seriesLS_prediction_decomp theorem — Pythagorean decomposition of the series prediction error. If the noise-free projection coefficient c0 (least-squares fit to the true values f) has residual orthogonal to every design column, then for *any* coefficient vector chat the prediction error of Φ·chat against the truth f splits exactly into the approximation error of the projection plus the squared fitted-value gap:
    N :
    ι :
    Type*
    Fin N → ι → ℝ
    w f :
    Fin N → ℝ
    c0 chat :
    ι → ℝ
    hortho :
    ∀ k : ι, ∑ i, w i * lstsqResidual Φ f c0 i * Φ i k = 0
    lstsqObjective Φ w f chat
    = lstsqObjective Φ w f c0 + ∑ i, w i * (∑ j, (c0 j - chat j) * Φ i j) ^ 2
    Proof (Lean source)
    theorem seriesLS_prediction_decomp {N : ℕ} {ι : Type*} [Fintype ι] {Φ : Fin N → ι → ℝ} {w f : Fin N → ℝ} {c0 chat : ι → ℝ} (hortho : ∀ k : ι, ∑ i, w i * lstsqResidual Φ f c0 i * Φ i k = 0) : lstsqObjective Φ w f chat = lstsqObjective Φ w f c0 + ∑ i, w i * (∑ j, (c0 j - chat j) * Φ i j) ^ 2 := lstsq_pythagoras hortho chat
    Causalean.Stat.Nonparametric.seriesLS_prediction_decomp · Causalean/Stat/Nonparametric/SeriesSieve/Prediction.lean:70
  • expected_weighted_sq_image_spherical theorem — Expected weighted quadratic form of a deterministic linear image of spherical mean-zero noise. If ε is a spherical mean-zero square-integrable family with scale σ, and a is a deterministic matrix of coefficients, then the linear image Dᵢ(ω) = ∑ₖ aᵢₖ εₖ(ω) has expected weighted sum of squares
    Ω :
    Type*
    N :
    ε :
    Fin N → Ω → ℝ
    a :
    Fin N → Fin N → ℝ
    w :
    Fin N → ℝ
    σ :
    :
    ∀ k, MemLp (ε k) 2 μ
    hmean :
    ∀ k, ∫ ω, ε k ω ∂μ = 0
    hsph :
    ∫ ω, ∑ i, w i * (∑ k, a i k * ε k ω) ^ 2 ∂μ = σ ^ 2 * ∑ i, w i * ∑ k, a i k ^ 2
    Proof (Lean source)
    theorem expected_weighted_sq_image_spherical {Ω : Type*} {N : ℕ} [MeasurableSpace Ω] {μ : Measure Ω} [IsProbabilityMeasure μ] {ε : Fin N → Ω → ℝ} {a : Fin N → Fin N → ℝ} {w : Fin N → ℝ} {σ : ℝ} (hε : ∀ k, MemLp (ε k) 2 μ) (hmean : ∀ k, ∫ ω, ε k ω ∂μ = 0) (hsph : SphericalFamily ε μ σ) : ∫ ω, ∑ i, w i * (∑ k, a i k * ε k ω) ^ 2 ∂μ = σ ^ 2 * ∑ i, w i * ∑ k, a i k ^ 2 := by -- RECIPE (codex): -- Let `D i ω = ∑ k, a i k * ε k ω`. -- (1) Pull the finite sum out of the integral: `integral_finset_sum`, with each summand -- `fun ω => w i * (D i ω)^2` integrable. Integrability: `(D i)` is `MemLp _ 2` as a finite -- sum of `L²` functions (`MemLp.const_mul`, `memLp_finset_sum'`), so `(D i)^2` is `L¹` -- (`MemLp.integrable_sq` / `MemLp.integrable (le_refl)` after `.pow`); the `w i *` is a -- constant multiple (`Integrable.const_mul`). -- (2) Constant `w i` out of each integral (`integral_const_mul`). -- (3) `∫ (D i)^2 = Var[D i; μ]`: because `∫ D i = ∑ k a i k * ∫ ε k = 0` (linearity of the -- integral over the finite sum + `hmean`). Use `ProbabilityTheory.variance_eq` -- (`Var[X] = ∫ X^2 - (∫ X)^2`, valid for `MemLp X 2`) and simplify the `(∫ D i)^2 = 0` term. -- The variance form: `Var[fun ω => ∑ k, a i k * ε k ω; μ]`. -- (4) `Var[fun ω => ∑ k, a i k * ε k ω; μ] = σ^2 * ∑ k, (a i k)^2` by -- `linearSmoother_variance_spherical (S := a i) hε hsph`. -- (5) Assemble: `∑ i, w i * (σ^2 * ∑ k, (a i k)^2) = σ^2 * ∑ i, w i * ∑ k, (a i k)^2` -- via `Finset.mul_sum`/`ring`-style sum manipulation (reduce with -- `Finset.sum_congr rfl (fun _ _ => ?_)` then `ring` at the scalar leaf). let D : Fin N → Ω → ℝ := fun i ω => ∑ k, a i k * ε k ω have hDmemlp : ∀ i, MemLp (D i) 2 μ := by intro i dsimp [D] convert memLp_finset_sum' univ (fun k _ => (hε k).const_mul (a i k)) using 1 ext ω simp have hDint : ∀ i, ∫ ω, D i ω ∂μ = 0 := by intro i calc ∫ ω, D i ω ∂μ = ∫ ω, ∑ k, a i k * ε k ω ∂μ := rfl _ = ∑ k, ∫ ω, a i k * ε k ω ∂μ := by simpa using (integral_finset_sum univ (fun k _ => ((hε k).const_mul (a i k)).integrable (by norm_num))) _ = 0 := by simp [integral_const_mul, hmean] have hDsq : ∀ i, ∫ ω, (D i ω) ^ 2 ∂μ = σ ^ 2 * ∑ k, a i k ^ 2 := by intro i have hvarint : Var[D i; μ] = ∫ ω, (D i ω) ^ 2 ∂μ := by rw [variance_eq_integral (hDmemlp i).aemeasurable] rw [hDint i] simp calc ∫ ω, (D i ω) ^ 2 ∂μ = Var[D i; μ] := hvarint.symm _ = σ ^ 2 * ∑ k, a i k ^ 2 := by simpa [D] using (linearSmoother_variance_spherical (Y := ε) (S := a i) (σ := σ) hε hsph) have hterm_int : ∀ i, Integrable (fun ω => w i * (D i ω) ^ 2) μ := by intro i exact (hDmemlp i).integrable_sq.const_mul (w i) calc ∫ ω, ∑ i, w i * (∑ k, a i k * ε k ω) ^ 2 ∂μ = ∫ ω, ∑ i, w i * (D i ω) ^ 2 ∂μ := by simp [D] _ = ∑ i, ∫ ω, w i * (D i ω) ^ 2 ∂μ := by simpa using (integral_finset_sum univ (fun i _ => hterm_int i)) _ = ∑ i, w i * ∫ ω, (D i ω) ^ 2 ∂μ := by refine Finset.sum_congr rfl (fun i _ => ?_) rw [integral_const_mul] _ = ∑ i, w i * (σ ^ 2 * ∑ k, a i k ^ 2) := by refine Finset.sum_congr rfl (fun i _ => ?_) rw [hDsq i] _ = σ ^ 2 * ∑ i, w i * ∑ k, a i k ^ 2 := by rw [Finset.mul_sum] refine Finset.sum_congr rfl (fun i _ => ?_) ring
    Causalean.Stat.Nonparametric.expected_weighted_sq_image_spherical · Causalean/Stat/Nonparametric/SeriesSieve/Prediction.lean:87
Prediction­Rate 3 core · 0 supporting The Causalean file Causalean.Stat.Nonparametric.SeriesSieve.Prediction proves a *conditional* oracle inequality seriesLS_expected_prediction_le: 𝔼[‖f − Φ·ĉ‖²_w] ≤ A + σ² · V, where A is any bound on the noise-free least ★ jacksonSeriesBias_le★ seriesEffectiveDoF_le★ seriesLS_prediction_rate

Series / sieve least-squares prediction rate O(J^{−2s/d} + J/N)

The Causalean file Causalean.Stat.Nonparametric.SeriesSieve.Prediction proves a conditional oracle inequality seriesLS_expected_prediction_le:

𝔼[‖f − Φ·ĉ‖²_w] ≤ A + σ² · V,

where A is any bound on the noise-free least-squares objective (bias side) and V is any bound on the effective-degrees-of-freedom sum ∑ᵢ wᵢ ∑ₖ aᵢₖ² (variance side). This module supplies the two missing rate ingredients and combines them into the standard series/sieve prediction rate.

Main results

* jacksonSeriesBias_le — squares the Jackson best-approximation bound A ≤ (∑ᵢ wᵢ)·(C_J·J^{−s/d})² into the explicit bias rate A ≤ ((∑ᵢ wᵢ)·C_J²)·J^{−2s/d}. The Jackson approximation power of the sieve is taken as an explicit hypothesis (no attempt to prove Jackson's theorem for a concrete basis). * seriesEffectiveDoF_le — for normalized weights wᵢ = 1/N and a Frobenius / trace hypothesis on the hat map ∑ᵢ ∑ₖ aᵢₖ² ≤ Cvar·J, the effective-degrees-of-freedom sum obeys ∑ᵢ wᵢ ∑ₖ aᵢₖ² ≤ Cvar·J/N, i.e. it is controlled by (basis dimension)/(sample size). The trace bound is an explicit hypothesis (not derived from an explicit Gram matrix). * seriesLS_prediction_rate — feeds the two suppliers into seriesLS_expected_prediction_le to obtain the full rate 𝔼[‖f − Φ·ĉ‖²_w] ≤ ((∑ᵢ wᵢ)·C_J²)·J^{−2s/d} + σ²·(Cvar·J/N).

Here J^{−s/d} is the real power (J : ℝ) ^ (-(s/d)) (Real.rpow), keeping s, d, J, N, σ as free parameters; no concrete basis is assumed. See Newey (1997), Chen (2007), Belloni–Chernozhukov–Chetverikov–Kato (2015) for the econometric series-estimator theory and DeVore–Lorentz, Constructive Approximation, for the Jackson/Bernstein bias term.

theorem jacksonSeriesBias_le reviewed
Causalean.Stat.Nonparametric.SeriesSieve

Jackson bias rate for the series least-squares objective. If the noise-free least-squares objective A := lstsqObjective Φ w f c0 obeys the squared Jackson best-approximation bound A ≤ (∑ᵢ wᵢ)·(C_J·J^{−s/d})² — the shape produced by seriesApprox_le_of_sup with sup-error δ = C_J·J^{−s/d} — then the same objective satisfies the explicit doubled-exponent bias rate A ≤ ((∑ᵢ wᵢ)·C_J²) · J^{−2s/d}:

Formal statement
N :
ι :
Type*
Fin N → ι → ℝ
w f :
Fin N → ℝ
c0 :
ι → ℝ
s d C_J :
J :
hJack :
lstsqObjective Φ w f c0 ≤ (∑ i, w i) * (C_J * (J : ℝ) ^ (-(s / d))) ^ 2
lstsqObjective Φ w f c0 ≤ ((∑ i, w i) * C_J ^ 2) * (J : ℝ) ^ (-(2 * s / d))
Proof (Lean source)
theorem jacksonSeriesBias_le {N : ℕ} {ι : Type*} [Fintype ι] {Φ : Fin N → ι → ℝ} {w f : Fin N → ℝ} {c0 : ι → ℝ} {s d C_J : ℝ} {J : ℕ} (hJack : lstsqObjective Φ w f c0 ≤ (∑ i, w i) * (C_J * (J : ℝ) ^ (-(s / d))) ^ 2) : lstsqObjective Φ w f c0 ≤ ((∑ i, w i) * C_J ^ 2) * (J : ℝ) ^ (-(2 * s / d)) := by -- Rewrite the squared Jackson bound into the doubled-exponent rate, then transfer `hJack`. have hpow : ((J : ℝ) ^ (-(s / d))) ^ 2 = (J : ℝ) ^ (-(2 * s / d)) := by rw [← Real.rpow_natCast ((J : ℝ) ^ (-(s / d))) 2, ← Real.rpow_mul (Nat.cast_nonneg J)] congr 1 push_cast ring have hrw : (∑ i, w i) * (C_J * (J : ℝ) ^ (-(s / d))) ^ 2 = ((∑ i, w i) * C_J ^ 2) * (J : ℝ) ^ (-(2 * s / d)) := by rw [mul_pow, hpow]; ring exact hJack.trans_eq hrw
Causalean.Stat.Nonparametric.SeriesSieve.jacksonSeriesBias_le · Causalean/Stat/Nonparametric/SeriesSieve/PredictionRate.lean:44 · uses lstsqObjective
theorem seriesEffectiveDoF_le reviewed
Causalean.Stat.Nonparametric.SeriesSieve

Effective degrees of freedom is controlled by J/N. If the sample size N is positive, the least-squares weights are normalized as wᵢ = 1/N, and the hat map a obeys the Frobenius/trace bound ∑ᵢ ∑ₖ aᵢₖ² ≤ Cvar·J, then the weighted coefficient sum — the effective degrees of freedom V of the oracle inequality — obeys the bound Cvar · J / N:

Formal statement
N :
Fin N → Fin N → ℝ
Fin N → ℝ
Cvar :
J :
hN :
0 < N
hw :
∀ i, w i = (1 : ℝ) / N
htr :
(∑ i, ∑ k, a i k ^ 2) ≤ Cvar * J
(∑ i, w i * ∑ k, a i k ^ 2) ≤ Cvar * (J : ℝ) / N
Proof (Lean source)
theorem seriesEffectiveDoF_le {N : ℕ} {a : Fin N → Fin N → ℝ} {w : Fin N → ℝ} {Cvar : ℝ} {J : ℕ} (hN : 0 < N) (hw : ∀ i, w i = (1 : ℝ) / N) (htr : (∑ i, ∑ k, a i k ^ 2) ≤ Cvar * J) : (∑ i, w i * ∑ k, a i k ^ 2) ≤ Cvar * (J : ℝ) / N := by have hNpos : (0 : ℝ) < N := by exact_mod_cast hN calc (∑ i, w i * ∑ k, a i k ^ 2) = (1 / (N : ℝ)) * ∑ i, ∑ k, a i k ^ 2 := by rw [Finset.mul_sum] exact Finset.sum_congr rfl (fun i _ => by rw [hw i]) _ ≤ (1 / (N : ℝ)) * (Cvar * J) := by exact mul_le_mul_of_nonneg_left htr (by positivity) _ = Cvar * (J : ℝ) / N := by ring
Causalean.Stat.Nonparametric.SeriesSieve.seriesEffectiveDoF_le · Causalean/Stat/Nonparametric/SeriesSieve/PredictionRate.lean:72
theorem seriesLS_prediction_rate reviewed
Causalean.Stat.Nonparametric.SeriesSieve

Series / sieve least-squares prediction rate O(J^{−2s/d} + J/N). Assume a positive sample size; the noise-free projection c0 has residual orthogonal to every design column; the data fit chat ω differs from c0 by a deterministic linear image a of a noise family ε that is square-integrable, mean zero, and spherical with scale σ; the noise-free objective obeys the squared Jackson best-approximation bound at rate s/d with constant C_J; and the weights are normalized wᵢ = 1/N with the hat map obeying the Frobenius/trace bound ∑ᵢ ∑ₖ aᵢₖ² ≤ Cvar·J. Then the expected weighted quadratic prediction error of the fitted series coefficients obeys the standard series/sieve rate:

Formal statement
Ω :
Type*
N :
ι :
Type*
Φ :
Fin N → ι → ℝ
w f :
Fin N → ℝ
c0 :
ι → ℝ
chat :
Ω → ι → ℝ
ε :
Fin N → Ω → ℝ
a :
Fin N → Fin N → ℝ
s d C_J Cvar σ :
J :
hN :
0 < N
hortho :
∀ k : ι, ∑ i, w i * lstsqResidual Φ f c0 i * Φ i k = 0
hlin :
∀ ω, ∀ i, (∑ j, (c0 j - chat ω j) * Φ i j) = ∑ k, a i k * ε k ω
:
∀ k, MemLp (ε k) 2 μ
hmean :
∀ k, ∫ ω, ε k ω ∂μ = 0
hsph :
hJack :
lstsqObjective Φ w f c0 ≤ (∑ i, w i) * (C_J * (J : ℝ) ^ (-(s / d))) ^ 2
hw :
∀ i, w i = (1 : ℝ) / N
htr :
(∑ i, ∑ k, a i k ^ 2) ≤ Cvar * J
∫ ω, lstsqObjective Φ w f (chat ω) ∂μ
≤ ((∑ i, w i) * C_J ^ 2) * (J : ℝ) ^ (-(2 * s / d)) + σ ^ 2 * (Cvar * (J : ℝ) / N)
Proof (Lean source)
theorem seriesLS_prediction_rate {Ω : Type*} {N : ℕ} {ι : Type*} [Fintype ι] [MeasurableSpace Ω] {μ : Measure Ω} [IsProbabilityMeasure μ] {Φ : Fin N → ι → ℝ} {w f : Fin N → ℝ} {c0 : ι → ℝ} {chat : Ω → ι → ℝ} {ε : Fin N → Ω → ℝ} {a : Fin N → Fin N → ℝ} {s d C_J Cvar σ : ℝ} {J : ℕ} (hN : 0 < N) (hortho : ∀ k : ι, ∑ i, w i * lstsqResidual Φ f c0 i * Φ i k = 0) (hlin : ∀ ω, ∀ i, (∑ j, (c0 j - chat ω j) * Φ i j) = ∑ k, a i k * ε k ω) (hε : ∀ k, MemLp (ε k) 2 μ) (hmean : ∀ k, ∫ ω, ε k ω ∂μ = 0) (hsph : SphericalFamily ε μ σ) (hJack : lstsqObjective Φ w f c0 ≤ (∑ i, w i) * (C_J * (J : ℝ) ^ (-(s / d))) ^ 2) (hw : ∀ i, w i = (1 : ℝ) / N) (htr : (∑ i, ∑ k, a i k ^ 2) ≤ Cvar * J) : ∫ ω, lstsqObjective Φ w f (chat ω) ∂μ ≤ ((∑ i, w i) * C_J ^ 2) * (J : ℝ) ^ (-(2 * s / d)) + σ ^ 2 * (Cvar * (J : ℝ) / N) := by have hA := jacksonSeriesBias_le (Φ := Φ) (w := w) (f := f) (c0 := c0) (s := s) (d := d) (C_J := C_J) (J := J) hJack have hV := seriesEffectiveDoF_le (a := a) (w := w) (Cvar := Cvar) (J := J) hN hw htr exact seriesLS_expected_prediction_le hortho hA hlin hε hmean hsph hV
Causalean.Stat.Nonparametric.SeriesSieve.seriesLS_prediction_rate · Causalean/Stat/Nonparametric/SeriesSieve/PredictionRate.lean:98 · uses SphericalFamily , lstsqObjective , lstsqResidual