Math

  • |

    Outer Product Expansion Primer

    A matrix product AB equals the sum of outer products of the k-th column of A and the k-th row of B. Each term is a matrix of rank at most one, so the rank of AB cannot exceed the inner dimension. This view underlies singular value decomposition and sample-by-sample accumulation of X transpose X.

  • |

    Null Space Primer

    The null space of a matrix A is the set of all input vectors that A sends to zero, a subspace whose dimension, the nullity, adds to the rank to give the input dimension. When Ax = b has a solution, it is unique only if the null space holds the zero vector alone; otherwise there are infinitely many.

  • |

    Singular Value Decomposition Primer

    Singular value decomposition writes any real matrix, of any size or rank, as an orthogonal matrix, a diagonal matrix of singular values, and another orthogonal matrix. Singular values are the semi-axis lengths of the ellipse the matrix makes from the unit circle, and keeping the largest k gives the best rank-k approximation behind PCA and the pseudo-inverse.

  • |

    Matrix Operations Primer

    Matrix addition, subtraction, and scalar multiplication work element by element on same-size matrices, while a product needs matching inner dimensions and changes when the order changes. There is no division, only multiplication by an inverse on a chosen side. Element-wise derivatives and integrals yield the normal equations and the multivariate normal constant.

  • |

    Scores in Partial Least Squares

    PLS extracts scores as coordinates in a low-dimensional latent space that maximizes the covariance between inputs X and targets Y. That one set of scores reduces dimension, extracts features related to Y, removes multicollinearity, and supports visualization and anomaly detection, which suits sensor and spectral data with many correlated variables.

  • |

    Lagrange Multiplier Method

    At an extremum of f on the constraint g(x, y) = C, the gradient of f equals lambda times the gradient of g. The multiplier lambda is the rate at which the optimal value changes as C changes, and setting the partial derivatives of the Lagrangian to zero gives a solvable system for the optimum.

  • |

    Dot Product Primer

    The dot product, the sum of element-wise products, equals the product of two vector lengths and the cosine of their angle. When the weight vector has unit length, it is the signed length of the input projected onto that axis, which is how linear regression predictions and PLS and PCA scores are computed.

  • | | |

    Intervals from the RMSE and Their Use in SPC

    🇺🇸🇰🇷 A band of 1.96 times the RMSE covers a new error less than 95 percent of the time when the RMSE comes from n errors; at n = 28 it covers 94 percent. Using the Student t quantile, 2.05 at n = 28, restores 95 percent and sets SPC error limits and guard bands.

  • |

    Bayesian Information Criterion

    BIC scores a fitted model as its deviance plus a penalty of ln n per parameter, and the smallest score wins. The penalty comes from a large-sample approximation to the marginal likelihood, so a difference of two scores reads directly as a Bayes factor. Differences under two are a tie.

  • |

    Marginal Likelihood and its Laplace Approximation

    The marginal likelihood is an integral, and closed forms exist only for conjugate pairs. Laplace approximation replaces the integrand with a Gaussian at the posterior mode, costing one optimization and one Hessian, and BIC is that same expansion with the terms that do not grow with sample size dropped. It fails on a multimodal posterior.

  • |

    Bayesian Statistics

    Classical and Bayesian statistics differ in which side of a conditional probability they compute. On Eddy’s pool table problem the same data gives fair odds of 7 to 1 one way and 10 to 1 the other, because only the Bayesian route averages over the posterior instead of fixing one parameter value.

  • | |

    Ordinary Least Squares

    Fitting a linear regression means solving one matrix equation, not one equation per observation. Stacking the data into a design matrix and minimizing the residual sum of squares gives the normal equation, whose closed-form solution fixes the coefficients uniquely whenever the cross-product matrix can be inverted. NumPy reproduces the computation.