Boundary bias of local constant regression Created 2026-10-07 Updated 2026-10-14
A local constant average reproduces constants but need not reproduce a linear regression function near an endpoint. For , , , and , its deterministic estimate at zero is . A local linear fit removes this first-order boundary bias of an estimator.
Fitted values Created 2026-09-24 Updated 2026-10-14
Fitted values are the predictions at the predictor values used to fit a regression model. In linear regression with an explicit regression intercept,Here is the slope design matrix, and is the regression residual vector. The fitted values estimate the regression function at the observed predictors; they need not equal the observed responses, which may also contain random errors. Prediction at a new predictor vector uses with the same centering and scaling used in fitting. A prediction interval addresses uncertainty in a new response rather than just displaying this point prediction.
For the five constructed observations in linear regression, ordinary least squares gives fitted values . The ridge regression fit at instead gives . Both fitted vectors have sample mean because the regression intercept is unpenalized; their regression residuals differ and their residual sums of squares are and , respectively.
For ordinary least squares, the fitted values are the orthogonal projection of onto the column space of the complete design matrix, including its regression intercept column. They remain unique even in rank-deficient ordinary least squares, although the regression coefficients can be nonunique. The regression residuals are then orthogonal to every column.[ref]
Regression 1: Different perspectives. slides 6–10: fitted values, hat matrix, projection and orthogonal residuals
With centered slopes, ridge regression instead satisfies , so the regression residuals need not be orthogonal to the slope columns. Their sum is still zero because the regression intercept remains free.For fixed predictors and scales and a fixed positive penalty, ridge regression gives a linear smoother,For with at least one nonzero slope direction, this matrix is not an orthogonal projection matrix: applying it twice shrinks that direction again. Its effective degrees of freedom are , where are the positive singular values of ; the extra counts the free regression intercept. If the penalty is selected using , the resulting fitting rule need not be a linear smoother, since its chosen also depends on .
Gaussian regression score Created 2026-10-07 Updated 2026-10-14
For a regression function , let . With independent centered normal distribution error of known variance , the parametric score function is . It has zero conditional expectation given the covariate, so unknown covariate-density nuisance directions do not remove any of its Fisher information.
Interior first-order bias cancellation for local constant regression Created 2026-10-06 Updated 2026-10-07
At an interior point where the regression function is differentiable, a symmetric compactly supported regression kernel makes the first-order bias of an estimator vanish asymptotically. In regular fixed-design nonparametric regression with and , the local constant estimator then has squared bias of an estimator and variance for a unit-integral regression kernel. The differentiability remainder is pointwise and need not hold uniformly over a function class.
Law of total variance Created 2026-09-24 Updated 2026-10-14
The law of total variance separates the spread of a population into spread inside groups and spread between their means. For a real square-integrable random variable , so that , and another random variable on the same probability space,The first term averages the conditional variance over the possible information ; the second measures how much the conditional mean changes with that information. There is no independence assumption, and need not be numerical or have finite variance. Conditioning is useful precisely when knowing tells us something about . See MIT tutorial on using conditional expectation and variance.
More generally, the available information can be a sub-sigma-algebra of the ambient probability space. With , the existing conditional expectation definition givesTaking recovers the displayed formula. The conditional mean and conditional variance are themselves random variables: before learning the group, we do not yet know which group average or group spread will apply. Their outer expectation and variance turn these varying quantities into numbers.
For a fully explicit mixture distribution, choose a group or with equal probabilities. In group , choose or with equal conditional probabilities; in group , choose or with equal conditional probabilities. Thus the complete joint probability distribution consists of , each with probability , and no other outcomes. The conditional means are and . Squaring the deviations and gives conditional variances and , respectively. The law of total expectation gives the overall mean .
The within-group contribution to variance isFor the between-group contribution, the conditional mean takes values and , each three units from the overall mean. Consequently,We can check this without any conditioning: the discrete random variable takes values with equal probabilities, soEquivalently, its second moment is , and subtracting the squared mean gives . These are population variances, with the stated probabilities as weights, rather than estimates using the corrected denominator of a sample variance.
The figure makes the two sources of spread visible. The outcomes in group cluster tightly around , while those in group sit farther apart around . Replacing every outcome by its conditional mean removes the internal spread but leaves the separation between groups. Conversely, subtracting each group's conditional mean aligns the two groups around zero. Averaging only the conditional variances would miss nine units of variance; retaining only the conditional means would miss five. Neither summary alone describes the whole population.
Two modifications clarify what each contribution measures. Shift group to outcomes and group to outcomes , keeping all four probabilities equal. Both conditional means are now , while the conditional variances remain . The between-group contribution vanishes, and total variance is just . Group membership still tells us how uncertain an outcome is, even though the best point prediction stays the same. Alternatively, let every outcome in group equal and every outcome in group equal . Now both conditional variances vanish, and all nine units of total variance come from group separation. Knowing the group predicts the outcome perfectly. These limiting cases distinguish differences in average outcome from differences in internal spread; the original mixture distribution contains both.
The same calculation answers a prediction question. If the group is hidden, the best constant prediction is the overall mean , with mean squared error , by variance as the minimum mean squared error of a constant. If the group is revealed, predict for and for . The errors become , and their mean squared error is . Knowing the group therefore improves the best achievable mean squared error by , exactly the between-group contribution. This is an interpretation relative to the information available: the remaining uncertainty could shrink further if additional information were revealed.
For any square-integrable measurable function used as a predictor, write . The prediction identity isThus predicting with the regression function gives the conditional expectation and minimizes mean squared error over every permitted predictor, including nonlinear ones. This minimizes average squared error, not the error for each individual outcome. See Berkeley Statistics 201A notes, sections 36–37.
Why do the two pieces add cleanly? Put . Its conditional expectation given is zero, so and for every square-integrable measurable function . In particular, and are uncorrelated random variables. Splitting and squaring therefore leaves no cross term after taking expectation. Geometrically, the conditional expectation is an orthogonal projection in the L2 space, and the law of total variance is its Pythagorean theorem for centered random variables.
In our example, the four products are , which average to zero. Yet and are not independent: observing identifies group , while observing identifies group . This is a concrete instance of heteroscedasticity, with different conditional variances despite zero conditional means of the errors. A group can predict uncertainty even when it cannot predict the error's sign.
The law of total variance is useful whenever aggregated data conceal distinct groups. Changing mixture weights changes both contributions, so the weighting must match the population being described. For example, giving group weight changes the overall mean to , the within-group variance contribution to , and the between-group contribution to , making the total . Group differences account for spread and prediction gains; assigning them a causal explanation requires a separate causal inference argument.
Overfitting Created 2026-09-24 Updated 2026-10-14
Overfitting occurs when further adaptation improves training error while degrading performance on new data, for example by fitting incidental disturbances instead of a stable regression function. A gap between training error and test error alone does not prove that a simpler rule would generalize better. Compare candidates using cross-validation or a validation set; reserve the test set for assessment. Regularization and early stopping can limit adaptation. [ref]
https://web.stanford.edu/~hastie/ISLR2/Slides/Ch2_Statistical_Learning.pdf. ISLR chapter 2 slides, assessing model accuracy
Evaluate the training error example at , , none coinciding with a training input. The mean squared discrepancy is , , and for degrees 1, 2, and 7. Thus degree 7 improves training error but worsens recovery of the target relative to degree 2. Degree 1 misses the target's curvature, illustrating underfitting.
These are errors against a known noiseless target, not test errors against fresh noisy responses. In a separate noiseless control, degrees 2 and 7 both recover this target exactly; their numerical held-out errors are approximately and . The fixed-disturbance simulation illustrates a mechanism, not a universal numerical benchmark or a claim that higher polynomial degree always harms generalization.
Noisy polynomial fitting, training-only degree selection, and separate noiseless-target evaluation
. Details. Past exam of the mathematics course of the University of Cambridge 2008 iii Paper 42 6 Solution Created 2026-10-03 Updated 2026-10-14
For ordinary homoscedastic fixed-design nonparametric regression, take observations at known distinct sites, with independent mean-zero errors of common variance. A degree- local polynomial estimator at a target solves the finite-dimensional weighted least squares problemHere is a nonnegative regression kernel, is the smoothing bandwidth, and sufficient local design rank ensures uniqueness. The estimate of the regression function is . Each target has its own locally fitted polynomial; this is not one global polynomial fit. The bandwidth controls the localization and the bias-variance tradeoff.
A natural cubic smoothing spline instead solves the global penalized problemThe Sobolev space here consists of functions with square-integrable weak derivatives through order two. The minimizer is a natural cubic spline with knots at the observation sites and linear tails outside the extreme sites. Equivalently one may perform the minimization on that finite-dimensional spline space: the minimum roughness property of the natural cubic spline interpolant shows that replacing a candidate by the natural spline with the same site values preserves the data loss and decreases the second-derivative penalty. The smoothing parameter controls curvature; it differs from the local bandwidth .
For the interval-average observation problem, the printed upper limit in the loss is an indexing error: there are only responses and intervals, so a term with would involve the undefined and . The coherent loss uses the upper limit . Put and define the linear observation functionalsThe intended criterion on is thereforeUnlike the ordinary cubic smoothing spline, this uses interval averages as data and a first-derivative penalty; the resulting spline degree will be two.
Fix any candidate . By the supplied interpolation property, there is a unique quadratic spline with knots , constant on both exterior intervals, such that for every . Put . ThenOn each interior knot interval is a constant , and on the two exterior intervals . Integrate by parts separately on the intervals. At every knot the boundary contributions cancel because both and are continuous; the contributions at and vanish because is zero there. ThusThis orthogonality is the key to the quadratic smoothing spline for interval averages. Expanding the roughness penalty givesThe data-fit terms are equal because the interval averages are equal. Consequently,Equality can occur only if everywhere: the derivative is continuous and its squared integral is zero. Then is constant, and any of its zero interval averages forces that constant to be zero. Therefore every minimizer must equal its matching quadratic spline .
We conclude that the minimizer is a continuously differentiable quadratic spline with knots at the specified sites and constant tails on both exterior intervals. Existence and uniqueness also follow from the supplied interpolation property. The interval-average map identifies the finite-dimensional space of these quadratic splines with , and the criterion becomes a strictly convex quadratic function of that average vector: its data-fit term is , while its penalty is nonnegative and quadratic. It has a unique minimizer, and the strict equality argument above proves uniqueness in the full function class.
Past exam of the mathematics course of the University of Cambridge 2009 iii Paper 33 4 Solution Created 2026-10-03 Updated 2026-10-14
The Nadaraya–Watson estimator isFor the unit-width box kernel, it averages the responses with design points in . Define it to be zero if that window contains no observations; the supplied small-denominator bound must refer to a defined estimator.
Write , and . Set . On ,This is the absolute error bound for a ratio estimator with a controlled denominator; it does not require the numerator and denominator to be independent.
The conditional expectation definition of the regression function givesAt this interior point, the Taylor theorem expansions are and . Multiplying and using the symmetric interval removes the odd linear term. More precisely,This cancellation underlies the interior absolute-error rate of the Nadaraya-Watson estimator.
For the variance, independence between observations givesConditional on , the second moment is . The bounded conditional variance, local boundedness of , and boundedness of consequently make the expectation at most . Thus . By the Cauchy-Schwarz inequality,The auxiliary result supplied in the question makes the expected error on equal to . Combining both events, with , provesBoth the squared-bandwidth bias and the inverse-square-root window-count error have this order. The supplied separate consistency result for the design-density estimator is not needed once the stronger small-denominator expectation bound is used.
Past exam of the mathematics course of the University of Cambridge 2010 iii Paper 31 3 Solution Created 2026-10-03 Updated 2026-10-14
For an orthonormal wavelet construction, setThe scaling function generates the approximation spaces , while generates the detail spaces in the multiresolution analysis, with . At coarse resolution zero, the family is an orthonormal basis of .
For the given square-integrable function the coefficients and wavelet series areFor real wavelets these are the real L2 inner products; use complex conjugates for a complex basis. The series converges in the L2 norm, and its coefficients satisfy the Parseval identity for a Hilbertian basisAn hypothesis alone does not assert pointwise convergence.
The resolution- wavelet projection is the orthogonal projection onto :The two expressions coincide by iterating . Orthogonality gives , which tends to zero. One can equivalently write the projection with kernel , interpreted as the same orthogonal projection.
In fixed-design nonparametric regression, the observations satisfywith independent errors. In the usual Gaussian version . The regression function is evaluated at the design sites, so it must be specified pointwise there, not only as an equivalence class. For , the observations concern on . They cannot identify its values outside this interval. Use an interval-adapted wavelet basis on , consisting of coarse functions and detail functions ; a Haar wavelet basis is one explicit choice.
Here is a wavelet regression estimator valid for every . Divide into cells , with the value at zero assigned arbitrarily, and form the observed step function on . For any normalized basis function , estimate its coefficient byThe wavelet regression estimator at resolution is thereforeOnly finitely many interval basis functions occur. Its expectation is , where equals on . Thus approximation of includes the resolution bias and the grid discretization bias. For continuous , the latter tends uniformly to zero by uniform continuity. No smoothness or consistency claim for arbitrary pointwise representatives of functions is needed to define the estimator.
The common point-evaluation version replaces each weight by , givingThese are Riemann-sum approximations to the coefficient integrals. For Haar wavelets, , and , they equal the integrated-weight coefficients exactly if the dyadic cells and pointwise basis versions are chosen right-closed. Each retained basis function is then constant on every sampling cell. This gives a concrete implementation by the discrete wavelet transform. A sensible finest resolution has ; beyond the grid scale there are details the data cannot resolve.
For wavelet coefficient thresholding, retain the coarse coefficients but discard detail coefficients dominated by noise. A hard-threshold version isAlternatively, soft thresholding replaces each detail coefficient by . The unthresholded wavelet regression estimator retains all details at the chosen resolution; thresholding retains evidence for local features while suppressing small fluctuations.
The thresholds can be derived from a simultaneous wavelet coefficient noise bound. Write . Independence giveswhere the inequality applies the Cauchy-Schwarz inequality on each cell of length . In the dyadic Haar implementation, exactly. For Gaussian errors, the normalized coefficient noise is standard normal. More generally, independent centred sub-Gaussian random variables with parameter giveIf detail coefficients are considered, a union bound consequently justifiesWith probability at least , every retained detail's noise is below its corresponding threshold; independence between the coefficient errors is unnecessary. With of order and , these thresholds have the familiar order . Coefficients larger than their noise level represent potential signal, and a coefficient zero in the discretized mean is not selected on this simultaneous event. If is unknown, a consistent noise-scale estimate can be substituted; for Gaussian errors and predominantly negligible finest-level signal, the median absolute finest-level coefficients divided by the standard-normal absolute median estimates . Without a Gaussian or sub-Gaussian tail assumption, finite variance alone does not justify the logarithmic thresholds: Chebyshev inequality and the union bound instead permit .
Past exam of the mathematics course of the University of Cambridge 2012 iii Paper 39 5 Solution Created 2026-10-03 Updated 2026-10-07
In fixed-design nonparametric regression, the covariates are deterministic andFor the usual finite-variance model assume independent errors with . In random-design nonparametric regression, the pairs are independent observations and ; equivalently with conditional mean-zero errors. Conditional variances are generally assumed bounded for risk bounds.
For a nonnegative regression kernel and a smoothing bandwidth , the Nadaraya–Watson estimator iswhen the denominator is positive; replace by for random-design nonparametric regression. The local polynomial regression estimator of degree minimizes the weighted least squares criterionand reports . If the weighted Gram matrix is invertible, this minimizer is unique. The Nadaraya-Watson estimator is exactly local polynomial regression of degree zero. Higher degrees reproduce nonconstant polynomials and reduce boundary bias of an estimator.
The requested error bound needs and mean-zero independent errors of uniformly bounded variance, along with the matrix condition in the hint. The degree requirement is missing from the printed question. To see the problem, take , , , zero errors, , and . This regression function has two bounded derivatives, but the local constant estimate is the average of for :The scalar matrix is bounded away from zero for every . Nevertheless , so the printed conclusion with fails. A bounded-variance error hypothesis is also essential; otherwise an expectation bound need not even be finite.
Under the qualified hypotheses, use andThis symmetric Gram matrix has inverse operator norm bounded by the reciprocal of its uniform positive eigenvalue lower bound. If is supported in , only contribute. The equally spaced design and imply that there are at most such points. The bounded kernel and bounded on this interval therefore yieldFor the stochastic part, variance additivity for independent random variables and Cauchy-Schwarz inequality giveFor the deterministic part, let be the Taylor polynomial of at of degree . The polynomial reproduction property of local polynomial regression gives . By Taylor's theorem, on the kernel window. ThusCombining the two parts provesThe argument also applies at the endpoints when the assumed matrix bound holds. With arbitrary degree, the generally valid smoothness term is ; extra symmetry can improve some interior biases but does not fix the general boundary counterexample.
Past exam of the mathematics course of the University of Cambridge 2023 iii Paper 218 6 a Solution Created 2026-09-28 Updated 2026-10-03
The binary regression functions are the conditional class probabilitiesUnder zero-one loss, the Bayes classifier iswith arbitrary tie breaking. Its Bayes decision boundary is
Pointwise versus uniform risk distinction 2026-10-06
A risk function can decay rapidly for each fixed regression function while its supremum over a function class decays more slowly or fails to decay. Bounds depending on each function's local differentiability remainder need not be uniform. In fixed-design nonparametric regression, a class with no common smoothness bound permits smooth bump functions whose supports shrink between design points. Such sequences obstruct uniform estimation without contradicting fixed-function mean squared error bounds.
Random-design nonparametric regression 2026-10-07
The predictor values are random, and the regression function is the conditional mean of the response. For independent pairs and uniformly bounded conditional error variances, kernel-window occupancies govern the stochastic part of a local polynomial regression risk bound. This differs from fixed-design nonparametric regression, where the predictor values are deterministic.
Regression diagnostics Created 2026-10-06 Updated 2026-10-07
Regression diagnostics check assumptions and influential observations in a fitted regression function. Residual-versus-fitted plots can reveal omitted mean structure or nonconstant variance; a quantile-quantile plot checks a specified error distribution. Regression leverage measures unusual predictor configurations, and Cook's distance combines leverage and residual size to measure coefficient sensitivity. Independence may require checking collection order and the study design in addition to residual plots.
Regression spline Created 2026-10-05 Updated 2026-10-06
A regression spline fits a regression function in a finite-dimensional spline approximation space with selected knots. Evaluating its basis at predictor values gives a design matrix, reducing fitting to regression on basis coefficients.


