You’ve probably seen classical equations for linear regression, which is a procedure that finds the straight line that best fits a set of discrete points . You might also be aware that similar formulas exist to find a straight line that is a best (least squares) fit to a continuous function .

The bottom of this post provides a link to a tutorial on how to generalize the concept of linear regression to fit a function that takes a vector as input and produces a vector as output. In mechanics, the most common example of this type of function is a mapping function that describes material deformation: the input vector is the initial location of a point on a body, and the output vector is the deformed location of the same point. The image shows a collection of input vectors (initial positions, as grey dots) and a collection of output vectors (deformed locations as blue dots). The affine fit to these descrete data is the pink parallelogram.

Analogous to the scalar formula for a straight line, , a mapping transformation is “affine” or “homogeneous” if it is expressible in the form (here, we are using Einstein’s implied summation index notation). For an affine mapping, a physical domain that is initially rectangular will deform to a parallelogram. More broadly, any initially straight line of points will deform, under homogeneous mapping, to a new straight line that is possibly of different length and orientation. Otherwise, if any initially straight line becomes curved, then the mapping is nonlinear.

The generalization of linear regression, called multi-linear regression, aims to find the affine mapping that is as close as possible (by minimizing a square mean residual) to a nonlinear mapping. This might be used, for example, in heirarchical multiscale modeling where you seek the overall uniform deformation field that most closely approximates non-uniform deformations in an explicit model of microscale grains. You might also apply multilinear regression to turn a discrete displacement field (such as motion of atoms in a Molecular Dynamics simulation) into a continuum representation of the same motion.

The quality of the fit is visualized by showing the curvy deformed shape of an initially rectangular domain in comparison to the parallelogram deformed shape of the affine fit. [WARNING: deformation of a rectangular boundary to become a parallelogram is necessary, but not sufficient, for a mapping to be affine]. A better visualization would additioinally color the domain by the local residual, as defined in the full write-up linked below.

For the full equations, refer to our tutorial on affine (multilinear) regression. That document refers to some sample data, which are available here as a zip archive