Histogram 2026-10-14
A histogram groups numerical observations into adjacent intervals called bins and draws one rectangle per bin. Its attraction is that a long list of values becomes a visible pattern of concentration, gaps and skewness. Specify the bin edges, the treatment of values on those edges, and what the vertical axis means: count, proportion, or density. Those choices are part of the graphic. [ref]
https://www.itl.nist.gov/div898/handbook/eda/section3/histogra.htm. NIST/SEMATECH, Histogram, definition and normalization
Let observations be covered by disjoint bins with positive widths and counts , so . For example, use left-closed, right-open bins, closing the final right edge too. The three common height choices have different meanings:
For the density convention, a histogram is a piecewise constant probability density function estimate:Its normalization follows by adding rectangular areas:If the observations have units, density has reciprocal units; a density height is not a probability and can exceed . With equal bin widths, count heights and density heights differ only by a common scale factor. With unequal widths, count-height areas give wider bins extra visual weight unrelated to their counts. Dividing by width removes that distortion. R's histogram documentation explicitly describes area-one normalization for unequal bins. [ref]
https://stat.ethz.ch/R-manual/R-devel/library/graphics/html/hist.html. R graphics documentation, hist, frequency versus density
Reuse the twelve invented values under box plot, with bins . The counts are and the widths are . Hence the density heights and areas are exactlyThe second and third bars have equal density heights even though the third contains twice as many observations: it is also twice as wide. The last bar contains only two observations; its count-height area would be , larger than the six-observation bar's . Its correct density area is only .
Bin choice trades detail against stability. Broad bins merge distinctions: the toy bin hides the empty stretch between and . Narrow bins expose gaps but can make each individual observation dominate a bar. With one-unit bins starting at , the bins each contain two values and appear equally prominent; that apparent pattern depends on grouping the repeated integers together. Moving the bin origin also changes membership without changing the observations. For density estimation, this is a form of the bias-variance tradeoff: averaging over broad bins loses local detail, while narrow bins give more variable density estimates across repeated statistical samples. [ref]
https://www.stat.cmu.edu/~cshalizi/uADA/24/lectures/ch14.pdf. Cosma Rohilla Shalizi, Estimating Distributions and Densities, Section 14.1
A useful practice is to compare a few plausible widths and offsets, keeping common edges when comparing groups. Automatic bin selectors are starting points, rather than guarantees of a unique correct picture. [ref]https://numpy.org/doc/stable/reference/generated/numpy.histogram_bin_edges.html. NumPy documentation, histogram_bin_edges, Notes on bin selectors
A histogram retains only bin membership. Its density estimate spreads each bin's fraction uniformly across that bin, so our last bar assigns density throughout even though the only toy values there are and . It does not recover within-bin positions or observation order, and a visually convincing shape does not establish a population probability distribution. A box plot provides a complementary compact summary of quartiles; neither graphic replaces the original observations.
Past exam of the mathematics course of the University of Cambridge 2007 iii Paper 49 4 Solution Created 2026-10-03 Updated 2026-10-14
In kernel density estimation, take a kernel for density estimation that is nonnegative, symmetric, and has integral one, finite , and finite . Its smoothing bandwidth gives and the kernel density estimatorfrom an independent and identically distributed sample with probability density function . Nonnegativity and unit mass make the estimate itself a probability density function. We compare kernel for density estimation shapes by their optimized mean integrated squared error, rather than by their performance at an arbitrarily common numerical smoothing bandwidth.
For the usual second-order theory, assume, for example, that belongs to the Sobolev space and , and let , . The expectation is the convolution . The vanishing first moment of the symmetric kernel for density estimation and the integral Taylor remainder giveContinuity of translations in the L2 norm, with domination by , shows that in the L2 norm. Hence the integrated squared bias of a kernel density estimator isBy independence, the exact integrated variance of a kernel density estimator isIndeed the integrated second moment of a single summand is , and its integrated squared mean is . The latter quantity is bounded by , by Young's convolution inequality, so its contribution is . The bias-variance decomposition of mean squared error therefore yields the leading criterionThis asymptotic mean integrated squared error displays the bias-variance tradeoff: a small smoothing bandwidth increases integrated variance, while a large one increases squared bias of an estimator.
Differentiating the asymptotic mean integrated squared error with respect to gives . It changes sign once, from negative to positive, so its unique minimum isAt this minimum the integrated variance term is four times the squared bias of an estimator term. Substitution givesThus the leading rate is , and the shape comparison reduces to minimizing .
There is an essential scale ambiguity: if , then . Changing the scale of the kernel for density estimation merely changes the numerical convention for the smoothing bandwidth. MoreoverA comparison at the same raw is therefore not a fair comparison of shape. One can normalize the second moment to one, but that does not make the optimal smoothing bandwidth independent of shape.
The canonical kernel for density estimation instead chooses the unique scaleIt satisfies , and soConsequently all canonical kernels share the same leading optimal bandwidth . Only the multiplicative constant depends on shape. This is precisely the separation of shape choice and scale choice that makes the canonical kernel normalization useful. For an original unscaled kernel for density estimation, its corresponding optimal smoothing bandwidth is .
To prove optimal shape, scale a candidate kernel for density estimation to have second moment one. Let andDirect integration gives , , and . Thus is a rescaled Epanechnikov kernel. For any admissible with the same mass and second moment,Outside , and , because . The integral inside is therefore nonnegative, and multiplying by gives . Expanding the square now provesEquality forces almost everywhere. At fixed second moment, minimizing is equivalent to minimizing . Since is scale invariant, this proves the optimality of the Epanechnikov kernel over all nonnegative symmetric second-order kernels for density estimation, including the equality case up to rescaling.
In its usual scale, the optimal Epanechnikov kernel isIts canonical scale is , givingThe optimal Epanechnikov kernel shape is therefore a truncated parabola, rather than a particular support radius. The canonical kernel and unit-second-moment version represent the same shape but different scale conventions.
The numerical gains over other reasonable kernels for density estimation are modest. Define asymptotic relative efficiency against the optimal Epanechnikov kernel by the sample-size fraction giving the same optimized leading mean integrated squared error:For the Gaussian density kernel , and , so its efficiency is . For the uniform smoothing kernel , and , giving efficiency . The Gaussian density kernel is infinitely smooth, whereas the optimal Epanechnikov kernel has compact support and allows each observation to affect only a finite window. Such computational and smoothness considerations may outweigh a small leading-efficiency difference.
In practice is unknown. A plug-in estimator estimates this roughness functional from a pilot estimate of the second derivative and substitutes it into the optimal smoothing bandwidth formula. Alternatively, Leave-one-out cross-validation minimizeswhere uses the other observations. By independence, the expectation of the second term is , so . Thus it targets integrated error without knowing . The choice of smoothing bandwidth remains important: even for the optimal Epanechnikov kernel, setting multiplies the leading minimum error by .
The preceding optimum concerns nonnegative second-order kernels for density estimation and twice-smooth densities on the real line. Signed kernels of order ell can cancel higher moments for smoother densities and yield different rates, but may produce negative density estimates. A support boundary or a density jump also requires separate bias of a kernel density estimator analysis. These settings do not contradict the proved second-order optimality of the Epanechnikov kernel.
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 2008 iii Paper 45 1 c Solution Created 2026-10-03 Updated 2026-10-14
To isolate the bias-variance tradeoff of the smoothing step, fix the three neighbor locations and write , with independent zero-mean errors of common variance . At a target , the local estimate isThe bias and variance of a three-neighbour weighted smoother areConsequently the variance is minimized by equal weights, , when it equals . It decreases as increases from zero to , and increases thereafter toward as . In particular, variance is not increasing over the entire interval .
Giving more weight to the closest location reduces the influence of more distant responses and often reduces smoothing bias. If the closest location is the target itself, , put . Then the squared bias is , andThus a locally flat signal favors equal averaging, while stronger local smoothing bias favors greater nearest-point weight. At a general target the bias is affine in , and its absolute value need not decrease: farther neighbors can cancel one another's approximation errors. Even without that cancellation, a smoothness-based worst-case bias bound decreases with because the first neighbor is closest. The exact tradeoff is therefore lower variance near balanced weights versus potentially lower bias near the closest-point fit. These formulas describe the elementary smoother; fitted partial residuals, centering and repeated backfitting can introduce dependence, so the variance of the final additive fit requires its full fitting operator rather than this single-step calculation.
Past exam of the mathematics course of the University of Cambridge 2008 iii Paper 45 4 c Solution Created 2026-10-03 Updated 2026-10-14
An orthonormal multiresolution analysis is a sequence of closed subspaces satisfying , , , and iff . A scaling function has integer translates forming an orthonormal basis of , and its scaled translates span . Thus contains information at resolution about .
The detail space is generated by the corresponding wavelet functions . The orthogonal splitting iterates toAccordingly a square-integrable signal has a coarse-and-detail wavelet series,and its wavelet projection onto keeps the coarse coefficients and details below level . Increasing adds finer-scale oscillations and localized features. On the real line there are infinitely many translates at each level; for a bounded observation interval, with an appropriate interval or periodic construction, the relevant approximation dimension satisfies . For the Haar wavelet on a unit interval this is exactly , corresponding to a separate mean on each dyadic subinterval.
This hierarchy gives a concrete meaning to wavelet approximation complexity. Coarse resolution uses few coefficients and can miss sharp features; fine resolution uses more coefficients and can fit noise. By orthogonality, projection bias is the energy of the omitted details,For an orthonormal sequence model with independent coefficient noise of variance , estimating the retained coefficients without shrinkage givesThe first term decreases with resolution while the second increases, making the bias-variance tradeoff explicit. Equivalently, a fixed orthogonal regression projection of rank has effective degrees of freedom and prediction optimism under independent equal-variance errors.
Wavelets also permit local rather than only global complexity control. Thresholding small estimated detail coefficients, for example by soft thresholding, retains strong local structure while suppressing fine-scale noise elsewhere. A sparse retained coefficient set can represent localized features much more economically than keeping every coefficient through a high level. Its locations and scales matter as well as its count. If that set is selected using the same noisy responses, however, selection adds adaptivity: its raw coefficient count is not automatically its covariance-based degrees of freedom. Resolution or threshold tuning should therefore account for prediction error, using an appropriate risk estimate or cross-validation, rather than only decreasing training error.
Wavelet complexity is controlled by retained resolutions and coefficients; more detail reduces approximation bias while increasing estimation variance and sensitivity to noise.
Past exam of the mathematics course of the University of Cambridge 2009 iii Paper 33 3 Solution Created 2026-10-03 Updated 2026-10-14
Let be the scaling function and an orthonormal wavelet, with and . For , the wavelet series at a coarse level isThe series converges in the L2 norm. Its coarse part captures broad variation and successive wavelet levels add finer detail. Truncating at levels produces the orthogonal projection onto ; Parseval identity makes its squared approximation error the sum of the omitted squared coefficients. Merely square-integrable functions need not have pointwise convergence.
For the Haar wavelet, use the cell convention and let be the unique such interval containing . The Haar scaling functions are , so the Haar projection isFor a merely locally integrable function this cell-average formula remains defined, even if a global orthogonal projection is unavailable. If , the mean value theorem gives Lipschitz continuity and, since on the cell,Thus the requested bound holds with , by the Haar projection error for a Lipschitz function.
To estimate a density, replace each scaling or wavelet coefficient or by the sample average of that basis function. The finite-resolution Haar density estimator is thereforeIt is the histogram on the dyadic cells, is nonnegative, and integrates to one. Its expectation is . A density with bounded derivative is bounded: the Lipschitz density height bound gives by integrating the triangular lower envelope . The case cannot be a probability density on the whole real line. Hence .
The cell probability is . The sample count has a binomial distribution, soThe Cauchy-Schwarz inequality bounds the mean centered absolute deviation by the square root of this variance. Adding the projection bias givesChoose , so . The two terms have the same order, andThis is a bias-variance tradeoff: refining the cells decreases the averaging bias but increases the sampling variance.
Haar projections of the standard normal density at three resolutions
. Details. The Haar projection averages this normal distribution density on each cell; the finer cells follow its variation more closely. A Haar density estimator replaces these exact cell probabilities by empirical frequencies and therefore also introduces sampling noise.
Past exam of the mathematics course of the University of Cambridge 2010 iii Paper 32 3 Solution Created 2026-10-03 Updated 2026-10-14
In a linear regression model, a large number of predictors or nearly dependent columns of the design matrix can make some eigenvalues of small. The ordinary least squares estimate has covariance matrix , so these directions have large variance, even though the estimator is unbiased. Ridge regression reduces this variance by shrinking the estimate towards zero, at the cost of introducing bias. This bias-variance tradeoff can improve the mean squared error when the signal is not too large in the shrunken directions.
For the usual preprocessing with a regression intercept, separate the constant column from the predictors and leave the intercept unpenalized. Subtract the sample mean from the response and from each nonconstant predictor, then divide each centered predictor column by its positive scale, for example its Euclidean norm. Thus all predictor columns have squared norm one; using squared norm instead simply changes the convention for the penalty. Centering is performed on the slope columns, not on the constant column. A full-rank design containing an intercept retains full rank on its centered slope columns. A model without an intercept should retain its specified mean structure unless an intercept is deliberately introduced.
Let be the resulting scaled, centered slope design matrix, let be the centered response, and let denote the coefficients in these standardized coordinates. The ridge regression problem isHere is the number of slopes; it is one less than the original number of columns when a constant column was present. The gradient of this objective is . Its Hessian matrix is a positive-definite matrix, giving the unique closed-form ridge regression estimatorThe regression intercept in the original coordinates is recovered as , and the original slopes are , where is the scale used for column . This is the unpenalized intercept in ridge regression convention. For a fixed full-rank coefficient design written simply as , with response and coefficient , the same formula readsThe risk comparison below first uses the fixed coefficient coordinates in which this quadratic penalty is imposed, and then addresses reversal of the scaling.
Assume at least one penalized coefficient, zero-mean errors with covariance matrix , and . No normal distribution assumption is needed for this mean squared error calculation. Put and . The covariance and bias of a ridge regression estimator follow directly from its linear expression:For the centered slope model, the response errors have covariance matrix , where . Since , the same coefficient covariance matrix formula still holds with .
By the spectral theorem for real symmetric matrices, write , with orthogonal and every , and put . The bias-variance decomposition of mean squared error now givesThe expression at is the ordinary least squares mean squared error. Its right derivative isTherefore, for every fixed coefficient vector, all sufficiently small positive penalties strictly improve mean squared error.
An explicit sufficient choice follows by subtracting the ordinary least squares risk term by term:Since , every summand is negative wheneverWhen , every positive penalty works. This is a pointwise result: the permitted penalty may depend on the true coefficient vector. A fixed positive penalty cannot improve risk for all arbitrarily large signals, because its squared bias grows quadratically with the signal. The same distinction appears in uniform directional risk improvement by ridge regression and unbounded directional risk of fixed ridge shrinkage. In centered coordinates the unpenalized intercept contributes the same to both coefficient risks, so it does not affect the improvement. Reversing a fixed predictor scaling measures coefficient error with a fixed positive-definite matrix instead of the identity matrix. For this weighted loss the squared bias still has derivative zero at , while the variance term has derivativeThe inequality follows because . Thus sufficiently small penalties also improve the original-coordinate mean squared error, though the explicit sufficient bound above was for the unweighted coordinates. Recovering an uncentered intercept adds a fixed nonnegative quadratic form to the slope loss, and its sample-mean error is uncorrelated with the centered slope errors, so the same weighted argument applies. A model with only an unpenalized intercept gives identical estimators. If the noise variance were zero, the strict improvement assertion would fail; positive noise variance is essential.
Past exam of the mathematics course of the University of Cambridge 2013 iii Paper 31 3 Solution Created 2026-10-03 Updated 2026-10-07
With the same squared-error normalization as in Question 2, the ridge estimator solvesThe unpenalized intercept in ridge regression is because the columns of are centered. Differentiating the remaining quadratic objective gives . Since , the left matrix is positive definite even when is rank-deficient. Thus the closed-form ridge regression estimator isThe second equality again uses centering. If the penalty convention is with an unnormalized squared-error term , replace by throughout; the limiting assertion is unchanged.
For the full-column-rank case, take a singular value decomposition with positive singular values . The ordinary least squares estimator, which is the slope maximum-likelihood estimator in this normal linear model, and the ridge regression estimator are respectivelyConsequently principal-component shrinkage by ridge regression multiplies the least-squares coordinate in direction by . Ridge shrinks most strongly in directions with the smallest singular values. These are combinations of predictors that the data distinguish least well.
Near multicollinearity creates small singular values, and the factor in ordinary least squares greatly amplifies noise in those directions. Its coefficient variance there is , while the ridge variance iswhich is smaller. The price is bias: the expectation of the ridge coordinate is times the corresponding true coefficient. This bias-variance tradeoff can substantially reduce estimation and prediction error when the poorly identified directions do not contain an excessively large signal. It is not a guarantee of improvement for every coefficient vector. Adding to every eigenvalue also improves the condition number of the normal matrix and makes numerical inversion more stable.
To handle every rank and every relation between and , put and use its spectral theorem for real symmetric matrices. Choose an orthonormal eigenbasis with eigenvalues , and put . ThenIf , then , so and . Thus these terms are exactly zero for every positive ; there is no divergent component in the null space. Each remaining term converges to . By the definition of the Moore-Penrose pseudoinverse,and thereforeThis proves the vanishing-penalty ridge limit without an invertibility assumption. The limit is the minimum-norm least-squares solution: every other least-squares solution differs by a vector in , orthogonal to the displayed solution, and therefore has at least as large a Euclidean norm.
Past exam of the mathematics course of the University of Cambridge 2013 iii Paper 33 2 Solution Created 2026-10-03 Updated 2026-10-07
For the unit-width box kernel, the convolution and kernel density estimator areandIn particular . The scaling gives . Even if is not square-integrable, Young's convolution inequality gives because and .
Using independence to eliminate the cross terms in the centred estimator, and Tonelli theorem to integrate the nonnegative variance, gives the exact integrated variance of a kernel density estimator:The Cauchy-Schwarz inequality now yieldsThis constant comes from the unit norm of the unscaled unit-width box kernel.
For the piecewise constant probability density function, integrability forces the constants on both unbounded outer intervals to be zero. Thus is bounded, has compact support, and has finitely many jumps. Let denote the jump at . For smaller than the least gap between consecutive breakpoints, the smoothing regions do not overlap. Outside these regions the convolution equals .
Within a region, put . For , the bias is ; for , it is . Endpoint values do not affect an norm. Integrating these two triangular errors givesThis is the box-kernel bias of a piecewise constant density. By the triangle inequality, with ,Balancing this bias-variance tradeoff with gives, for all sufficiently large ,
Past exam of the mathematics course of the University of Cambridge 2016 iii Paper 209 1 c Solution Created 2026-10-03 Updated 2026-10-14
Write and , restricting to meshes small enough that . This discontinuous indicator function does not satisfy the hypothesis of part (b). Instead apply part (a) with and handle its two boundary cells directly.
Let on each observation cell . Away from cells containing the two ends of , almost everywhere. Even if an endpoint is itself an observation time, at most two cells contribute, and their total length is at most . Thus the quadrature error obeysThe fluctuation has variance at most . Its zero expected value givesusing .
The remaining bias is the difference between an interval average and the spot variance. By the Hölder continuity of ,Retaining the centered fluctuation and bounding yieldsFor , both and equal . Therefore and satisfy both requested bounds:The constants are independent of the observation partition, , and . The exponent follows from a bias-variance tradeoff for a shrinking window.
Past exam of the mathematics course of the University of Cambridge 2022 iii Paper 218 5 b Solution 2026-09-28
Adding variables can reduce training bias and increase the maximized likelihood, but it also increases estimation variance and optimism. The penalty estimates this optimism, so minimizing AIC implements a bias-variance tradeoff aimed at expected out-of-sample Kullback–Leibler performance.
Past exam of the mathematics course of the University of Cambridge 2024 iii Paper 218 2 b Solution Created 2026-09-24 Updated 2026-09-25
Choose to minimize an estimate of out-of-sample mean squared prediction error, commonly K-fold cross-validation or a separate validation set. As increases, the coefficient vector is shrunk toward zero. This generally increases bias of an estimator but decreases variance of an estimator; the minimizing value balances the two contributions in the bias-variance tradeoff. The independent test set in the question can assess the final choice, but repeatedly selecting on that same set would cause data leakage.
Past exam of the mathematics course of the University of Cambridge 2025 iii Paper 218 3 b Solution Created 2026-09-24 Updated 2026-09-25
The -nearest-neighbour classifier finds the training predictors nearest to and returns the majority class among their labels. Increasing averages more labels and reduces variance of an estimator, but uses observations farther from and therefore increases bias of an estimator; decreasing reverses this bias-variance tradeoff.
Ridge regression Created 2026-09-24 Updated 2026-10-14
Ridge regression fits a linear regression model while penalizing the size of its slope regression coefficients. For a fixed design matrix containing the slope predictors, observed responses , and an unpenalized regression intercept , the objective isHere is the all-ones vector, and is the squared Euclidean norm of the slopes alone. The first term is the residual sum of squares; the second implements regularization. No random-error assumption is needed to define this fit. The convention is a summed squared-error loss: writing the objective as gives the same fit when .[ref]
Modern regression 1: Ridge regression. slides 5 and 7: summed squared-error objective and unpenalized intercept
For an exact example, reuse the constructed pairs from linear regression. Their sample means are and , and the centered cross-products are and . ThusThe ordinary least squares line has slope and residual sum of squares . At , ridge regression has slope , regression intercept , and residual sum of squares ; at these become , , and . Every line passes through : the penalty reduces the slope while retaining the response sample mean.
The computational benefit is visible after predictor centering. Write for the design matrix with each column's sample mean subtracted, and . The unpenalized intercept in ridge regression gives , and the closed-form ridge regression estimator solvesFor any nonzero vector and , . This positive-definite matrix is therefore invertible even when lacks full column rank, including repeated columns or . The unique penalized slopes resolve the ambiguity of rank-deficient ordinary least squares; they do not supply evidence about slope directions absent from the data. This makes ridge regression useful for multicollinearity.[ref]
High-Dimensional Regression: Ridge. p. 1, equations (1)–(2): uniqueness for positive penalty regardless of design rank
Predictor centering and scaling serve different purposes. Centering handles the free regression intercept. Scaling determines what counts as a large slope: replacing by changes its coefficient to for the same predictions, changing its contribution to an unweighted penalty. A common convention forms standard scores using each nonconstant predictor's sample standard deviation , then penalizes slopes in those coordinates. Since , this is the weighted penalty in the original units. Constant columns have and must be removed before this scaling. Scaling is a modelling choice; equal penalties in original units and in standardized units define different fits.[ref]
Modern regression 1: Ridge regression. slide 7: center predictors, leave the intercept free and scale predictors to sample variance one
The singular value decomposition explains the shrinkage. If is the compact decomposition using the positive singular values , with columns of , thenThe principal-component shrinkage by ridge regression factors are between and : directions with small singular values are damped most. As , the fitted values approach ; the vanishing-penalty ridge limit recovers the ordinary least squares fitted vector as , even if the slope estimates at zero penalty are nonunique. The covariance and bias of a ridge regression estimator describes the resulting bias-variance tradeoff. A penalty can reduce variance of an estimator while introducing bias of an estimator; the unbounded directional risk of fixed ridge shrinkage rules out a uniform improvement for a fixed positive penalty over all possible signals.[ref]
For a second exact construction, choose a centered orthonormal set of three vectors,and set and . The squared singular values are and . At , the fitted coordinates along are , retaining and of their ordinary least squares values . At they become , retaining and . The unfittable component contributes to every residual sum of squares, giving total values , , and at penalties . These are constructed fits, not measured prediction results.
Exact synthetic ridge shrinkage retains the strong singular direction longer than the weak one
. Details. The penalty is a hyperparameter, so fitting slopes at a fixed value and selecting that value are separate tasks. Use a validation set or K-fold cross-validation to compare candidate penalties by held-out squared-error loss. In each split, compute predictor sample means and scales from that split's training data, apply the same transformation to its validation set, and refit the slopes; using held-out information in preprocessing introduces data leakage. Minimum training residual sum of squares cannot select useful shrinkage: ordinary least squares already attains the smallest possible value.[ref]
Model selection and validation 1: Cross-validation. slides 5–8 and 11–14: tuning for prediction, training error and refitting on each training fold
After model selection, refit on all training data with the selected penalty. A separate test set or nested cross-validation assesses the entire selection procedure; a low selected validation score alone is no performance guarantee.[ref]On Over-fitting in Model Selection and Subsequent Selection Bias in Performance Evaluation by Gavin C. Cawley and others. pp. 2079–2080: selection as part of fitting and nested assessment
Smoothing bandwidth Created 2026-10-05 Updated 2026-10-14
A smoothing bandwidth determines the scale over which a regression kernel averages data, or a kernel for density estimation spreads each observation. It has the same units as the observations. In kernel density estimation, changing changes the visible detail while preserving the total integral one. For a Gaussian density kernel, each bump has standard deviation and its individual contribution has peak height .
If the smoothing bandwidth is too small relative to the spacings in a statistical sample, the kernel density estimator shows narrow spikes tied to individual observations: apparent peaks may be sampling accidents. If it is too large relative to features of the unknown probability density function, it blurs distinct groups together and spreads fitted probability far from the observations. An intermediate smoothing bandwidth can reveal broad structure, but visual smoothness alone cannot establish accuracy.
The same sample at three Gaussian bandwidths, and leakage below zero for a separate positive sample
. Details. The first three panels use exactly with smoothing bandwidths , and , respectively. Every curve has area one; the two groups in the observed statistical sample become less distinct as increases. No true probability density function is specified in this illustration, so the middle panel is illustrative, not a certified optimal fit. The fourth panel uses and to illustrate boundary bias of a kernel density estimator.
For a fixed nonnegative kernel for density estimation with finite squared integral, a probability density function that is bounded and continuous at an interior point with , and a deterministic sequence , the pointwise sampling variance obeysThus decreasing the smoothing bandwidth increases the leading sampling variance while reducing interior smoothing bias of an estimator: this is a bias-variance tradeoff. The conditions and express two goals, increasingly fine resolution and enough observations contributing locally. Practical methods such as plug-in bandwidth selection use the data to choose ; pointwise optimal kernel bandwidth depends on local features of the unknown probability density function. The smoothing bandwidth remains a tuning choice in nonparametric statistics, and knowing the support of a probability distribution can require more than a width adjustment near a boundary.





