liveBook · Manning

Normal equation

As explained in Experimentation for Engineers

An equation system whose solution gives the least-squares coefficients of a regression model.

The normal equation computes regression coefficients for a surrogate model from measured responses. With a quadratic model, construct a design matrix X containing a constant, threshold, and threshold-squared column, then solve β = (XᵀX)⁻¹Xᵀy. Equal numbers of measurements and parameters can produce an exact fit; with more measurements, the approximation error is generally nonzero. section 4.1.3

Fit a quadratic profit model

For threshold measurements and aggregate profit measurements, use NumPy: X = np.array([np.ones(len(y)), x, x**2]).T; beta = np.linalg.inv(X.T @ X) @ (X.T @ y). Apply the resulting coefficients to a new XHat matrix to estimate profit between measured thresholds. section 4.1.3

Figure 4.9 Analyze stage. In this stage, you build a model to interpolate between the measured values of markout_profit(threshold) and find the value of threshold that optimizes (maximizes) the interpolated value of markout_profit(threshold).
04-09

Trace the analyze workflow from measured markout profit through surrogate-model fitting to threshold optimization. section 4.1.3

How Experimentation for Engineers covers it

How deep it goes
Derives the matrix formula and gives executable NumPy code, but defers the mathematical derivation to an appendix.
Examples
Uses threshold measurements, aggregate markout profit, a quadratic design matrix, and interpolated values between observed thresholds.
What it assumes
Assumes familiarity with vectors and matrices while providing a NumPy mapping for transpose, products, inverses, and matrix-vector products.
What you can do after
Apply it via NumPy to estimate regression coefficients and interpolate responses at unmeasured thresholds.
How it connects
Connects linear regression, matrix operations, surrogate functions, interpolation, and response-surface optimization.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Experimentation for Engineers. The section links point to the parts of the book it draws on.