Why Predictor Scales Matter
A GLM can include predictors measured on very different numerical scales: age in years, income in thousands of dollars, or a laboratory value recorded in small units. These units do not change the scientific model, but they can change the numerical behavior of the information matrix used in an iterative fit. When columns of the design matrix have very different magnitudes, solving the information system can be less well conditioned.
Centering and scaling replace continuous predictors with more convenient coordinates. The operation is a change of parameterization, not a change to the fitted model: coefficients must be converted consistently so that every linear predictor, and hence every fitted mean, remains the same. Scaling can improve numerical conditioning, but it does not guarantee improvement in every model or at every iteration.
Definition and Coefficient Conversion
For clarity, consider a model with an intercept and \(p\) continuous predictors. Write \(x_i=(x_{i1},\ldots,x_{ip})^\top\), \(z_i=(z_{i1},\ldots,z_{ip})^\top\), and \(\eta_i=\beta_0+x_i^\top\beta\). Let \(c=(c_1,\ldots,c_p)^\top\), and let \(D\) be the diagonal matrix with entries \(s_1,\ldots,s_p\). Since \(x_i=c+Dz_i\), the same linear predictor can be written \(\eta_i=\gamma_0+z_i^\top\gamma\), where \(\gamma_0=\beta_0+c^\top\beta\) and \(\gamma=D\beta\). Equivalently, \(\beta=D^{-1}\gamma\) and \(\beta_0=\gamma_0-c^\top D^{-1}\gamma\).
The intercept therefore has a different interpretation after centering: it is the linear predictor at \(x=c\), rather than at \(x=0\). A slope also changes its numerical value when its predictor's unit changes. These changes are coordinate changes; they do not imply that the underlying fitted relationship has changed.
Worked Example: Converting a Slope and Intercept
Suppose a model has linear predictor \(\eta=2+0.003x\), where \(x\) is a laboratory measurement. Define \(z=(x-1100)/100\). Find the transformed coefficients and check the linear predictor at three values of \(x\).
Since \(x=1100+100z\), \(\eta=2+0.003(1100+100z)=2+3.3+0.3z=5.3+0.3z\). Thus \(\gamma_0=5.3\) and \(\gamma_1=0.3\).
At \(x=1000\), \(z=-1\). The original predictor is \(2+0.003(1000)=5\), and the transformed predictor is \(5.3+0.3(-1)=5\). At \(x=1100\), \(z=0\), and both give \(5.3\). At \(x=1200\), \(z=1\), and both give \(5.6\). For a GLM with, for example, a log link, equal linear predictors also give equal fitted means after applying the inverse link.
How the Information Matrix Changes
Let \(X\) be the design matrix with first column equal to one and remaining columns the original predictors. Let \(X_*\) be the design matrix with the centered and scaled predictors. For fixed values of the GLM working weights collected in a diagonal matrix \(W\), write the information matrix in the original coordinates as \(I_\beta=X^\top W X\). This is the usual weighted information form at the current fit. The same transformation applies to observed information when the log-likelihood is expressed in the transformed coordinates.
Define the block matrix \(A=\begin{pmatrix}1&c^\top\\0&D\end{pmatrix}\). Then \(X=X_*A\), and the transformed coefficient vector is \(\gamma=A\beta\). Because every \(s_j>0\), \(A\) is invertible. The information matrix for \(\gamma\) is therefore \(I_\gamma=A^{-\top}I_\beta A^{-1}\). This relation makes the numerical effect explicit: changing predictor units changes the matrix representation of the same local likelihood geometry.
Proof. The linear predictors satisfy \(X_*\gamma=X_*A\beta=X\beta\), so they agree observation by observation. A GLM log-likelihood depends on the coefficients through the linear predictors (with the observations, offsets, and other fixed quantities unchanged). Thus the corresponding coefficient values give the same log-likelihood. More explicitly, \(\ell_\gamma(\gamma)=\ell_\beta(A^{-1}\gamma)\). Since \(A^{-1}\) is constant, the chain rule gives \(\nabla_\gamma\ell_\gamma=A^{-\top}\nabla_\beta\ell_\beta\), and differentiating again gives \(\nabla_\gamma^2\ell_\gamma=A^{-\top}(\nabla_\beta^2\ell_\beta)A^{-1}\). Taking the negative Hessian gives the stated information transformation. The same first-derivative calculation gives the weighted-information identity for \(X^\top W X\), since \(X=X_*A\). \(\square\)
Worked Example: A Large Change in Conditioning
Take three observations with predictor values \(1000,1001,1002\), an intercept, and unit working weights. The original design matrix has columns \(1\) and \(x\), so \[ I_\beta= \begin{pmatrix} 3&3003\\ 3003&3006005 \end{pmatrix}. \] Its determinant is \(3(3006005)-3003^2=9018015-9018009=6\), and its trace is \(3006008\). The eigenvalues are positive because the matrix is positive definite, and their product and sum are respectively 6 and 3006008. The larger eigenvalue is approximately \(3006008\), so the smaller is approximately \(6/3006008\), or \(1.996\times10^{-6}\). The 2-norm condition number is therefore approximately \(1.51\times10^{12}\).
Now use \(z=x-1001\), so the transformed predictor values are \(-1,0,1\). The transformed information matrix is \[ I_\gamma= \begin{pmatrix} 3&0\\ 0&2 \end{pmatrix}. \] Its eigenvalues are 3 and 2, so its 2-norm condition number is \(3/2=1.5\). Here centering removes the large intercept–slope cross-term, and the numerical scales of the information matrix's diagonal entries are comparable. The transformation has not changed the possible fitted linear predictors; it has changed their coordinates.
Weighted Centering and the Intercept–Slope Term
Ordinary centering uses the unweighted mean of a predictor. In a GLM information matrix, however, the cross-term between the intercept and a predictor is weighted by the current working weights. Consequently, centering at the ordinary mean does not generally make that cross-term zero. Centering at the weighted mean does, provided the weights are positive and have a positive sum.
Proof. The intercept–predictor entry is \(\sum_i w_i(x_i-c_w)\). Substituting the definition of \(c_w\) gives \[ \sum_i w_ix_i-c_w\sum_i w_i =\sum_i w_ix_i- \frac{\sum_i w_ix_i}{\sum_i w_i}\sum_i w_i =0. \] The denominator is nonzero because the weights are positive. \(\square\)
In a fitted GLM, working weights can change as the fitted means change. Weighted centering at one iteration need not remove the cross-term at a later iteration. The result describes the information matrix for the weights at which the center was calculated; it is not a permanent orthogonality guarantee.
Worked Example: Ordinary and Weighted Centers Differ
Suppose two observations have predictor values \(0\) and \(2\), with working weights \(1\) and \(9\). Their ordinary mean is \(1\), but their weighted mean is \(c_w=(1\cdot0+9\cdot2)/(1+9)=18/10=1.8\).
Using the ordinary center, the centered values are \(-1\) and \(1\). The weighted intercept–predictor cross-term is \(1(-1)+9(1)=8\), not zero. Using the weighted center, the centered values are \(-1.8\) and \(0.2\), giving \(1(-1.8)+9(0.2)=-1.8+1.8=0\).
The weighted information matrix after centering at \(1.8\), but before scaling, is diagonal: \[ \begin{pmatrix} 1+9&0\\ 0&1(1.8)^2+9(0.2)^2 \end{pmatrix} = \begin{pmatrix} 10&0\\ 0&3.6 \end{pmatrix}. \] If the centered predictor is also divided by \(0.6\), its weighted sum of squares becomes \(3.6/(0.6)^2=10\), giving information matrix \(\begin{pmatrix}10&0\\0&10\end{pmatrix}\) at these weights. This choice makes the two diagonal entries equal in this example; it is not a general promise that all information matrices will be perfectly conditioned.
Practical Use and a Common Pitfall
A common practical choice is to center each continuous predictor at a representative value, often its sample mean, and divide by a positive scale such as its standard deviation or a scientifically meaningful unit. This can make coefficient magnitudes easier to interpret and can reduce avoidable numerical disparity among design-matrix columns. It is often useful to leave indicator variables and the intercept unchanged unless there is a specific reason to transform them.
Common mistake: “I centered and scaled a predictor, so the GLM fit must be different—or I can keep the old coefficients.” Both conclusions are wrong. If the coefficients are transformed by the stated formulas, each linear predictor is exactly preserved, and so are the fitted means and likelihood. If the predictor is transformed but the old numerical coefficients are used unchanged, the linear predictor generally changes. Another overclaim is that standardizing every predictor guarantees a well-conditioned information matrix: it does not. Correlation between predictors, the current working weights, and other features of the design still matter. Scaling changes coordinates; it does not make every numerical difficulty disappear.
For a numerical implementation, choose and record the centers and scales, fit using the transformed predictors, and convert coefficient estimates back when original-unit interpretation is needed. For a single predictor, the conversion is \(\beta_1=\gamma_1/s\) and \(\beta_0=\gamma_0-c\gamma_1/s\). For multiple predictors, use \(\beta=D^{-1}\gamma\) and \(\beta_0=\gamma_0-c^\top D^{-1}\gamma\). Verify the conversion by comparing linear predictors at selected observations; this is a direct check that the parameter coordinates were handled consistently.
Worked Example: Returning to Original Units
A fitted model uses \(z_1=(x_1-50)/10\) and \(z_2=(x_2-4)/2\), with transformed linear predictor \(\eta=1.2+0.5z_1-0.8z_2\). Convert it to the original predictors.
Since \(z_1=(x_1-50)/10\) and \(z_2=(x_2-4)/2\), \[ \eta=1.2+0.5\frac{x_1-50}{10}-0.8\frac{x_2-4}{2} =1.2+0.05x_1-2.5-0.4x_2+1.6 =0.3+0.05x_1-0.4x_2. \] Thus the original-unit intercept is \(0.3\), and the original-unit slopes are \(0.05\) and \(-0.4\).
At \(x_1=60\) and \(x_2=6\), the transformed values are \(z_1=1\) and \(z_2=1\). The transformed expression gives \(1.2+0.5-0.8=0.9\). The original expression gives \(0.3+0.05(60)-0.4(6)=0.3+3-2.4=0.9\). The identical linear predictor confirms the conversion.
Check Your Understanding
Work through these questions using the coefficient and information transformations developed above.
- If \(z=(x-20)/5\) and \(\eta=4+0.2x\), what are the transformed intercept and slope?
- Why does an invertible affine transformation of predictors preserve the fitted linear predictors when the coefficients are converted consistently?
- For working weights \(w_i\), which center makes the intercept–predictor cross-term zero, and what condition on the weights is needed?
- What does standardizing predictors fail to guarantee about the GLM information matrix?
- A fitted model uses transformed predictors. What direct numerical check can help detect an incorrect coefficient conversion?