In statistics and in machine learning, a linear predictor function is a linear function (linear combination) of a set of coefficients and explanatory variables (independent variables), whose value is used to predict the outcome of a dependent variable. This sort of function usually comes in linear regression, where the coefficients are called regression coefficients. However, they also occur in various types of linear classifiers (e.g. logistic regression, perceptrons, support vector machines, and linear discriminant analysis), as well as in various other models, such as principal component analysis and factor analysis. In many of these models, the coefficients are referred to as "weights".
Definition The basic form of a linear predictor function f(i) for data point i (consisting of p explanatory variables), for i = 1, ..., n, is
f(i)=β0+β1xi1+⋯+βpxip, where xik, for k = 1, ..., p, is the value of the k-th explanatory variable for data point i, and β0,…,βp are the coefficients (regression coefficients, weights, etc.) indicating the relative effect of a particular explanatory variable on the outcome.
Notations It is common to write the predictor function in a more compact form as follows:
The coefficients β0, β1, ..., βp are grouped into a single vector β of size p + 1. For each data point i, an additional explanatory pseudo-variable xi0 is added, with a fixed value of 1, corresponding to the intercept coefficient β0. The resulting explanatory variables xi0(= 1), xi1, ..., xip are then grouped into a single vector xi of size p + 1.
Vector Notation This makes it possible to write the linear predictor function as follows:
f(i)=𝜷⋅𝐱i using the notation for a dot product between two vectors.
Matrix Notation An equivalent form using matrix notation is as follows:
f(i)=𝜷T𝐱i=𝐱iT𝜷 where 𝜷 and 𝐱i are assumed to be a (p+1)-by-1 column vectors, 𝜷T is the matrix transpose of 𝜷 (so 𝜷T is a 1-by-(p+1) row vector), and 𝜷T𝐱i indicates matrix multiplication between the 1-by-(p+1) row vector and the (p+1)-by-1 column vector, producing a 1-by-1 matrix that is taken to be a scalar.
Linear regression An example of the usage of a linear predictor function is in linear regression, where each data point is associated with a continuous outcome yi, and the relationship written
yi=f(i)+εi=𝜷T𝐱i +εi, where εi is a disturbance term or error variable — an unobserved random variable that adds noise to the linear relationship between the dependent variable and predictor function.
Stacking In some models (standard linear regression, in particular), the equations for each of the data points i = 1, ..., n are stacked together and written in vector form as
𝐲=𝐗𝜷+𝜺, where
𝐲=(y1y2⋮yn),𝐗=(𝐱'1𝐱'2⋮𝐱'n)=(x11⋯x1px21⋯x2p⋮⋱⋮xn1⋯xnp),𝜷=(β1⋮βp),𝜺=(ε1ε2⋮εn). The matrix X is known as the design matrix and encodes all known information about the independent variables. The variables εi are random variables, which in standard linear regression are distributed according to a standard normal distribution; they express the influence of any unknown factors on the outcome. This makes it possible to find optimal coefficients through the method of least squares using simple matrix operations. In particular, the optimal coefficients 𝜷̂ as estimated by least squares can be written as follows:
𝜷̂=(XTX)−1XT𝐲. The matrix (XTX)−1XT is known as the Moore–Penrose pseudoinverse of X. The use of the matrix inverse in this formula requires that X is of full rank, i.e. there is not perfect multicollinearity among different explanatory variables (i.e. no explanatory variable can be perfectly predicted from the others). In such cases, the singular value decomposition can be used to compute the pseudoinverse.
Preprocessing of explanatory variables When a fixed set of nonlinear functions are used to transform the value(s) of a data point, these functions are known as basis functions. An example is polynomial regression, which uses a linear predictor function to fit an arbitrary degree polynomial relationship (up to a given order) between two sets of data points (i.e. a single real-valued explanatory variable and a related real-valued dependent variable), by adding multiple explanatory variables corresponding to various powers of the existing explanatory variable. Mathematically, the form looks like this:
yi=β0+β1xi+β2xi2+⋯+βpxip. In this case, for each data point i, a set of explanatory variables is created as follows:
(xi1=xi,xi2=xi2,…,xip=xip) and then standard linear regression is run. The basis functions in this example would be
𝝓(x)=(ϕ1(x),ϕ2(x),…,ϕp(x))=(x,x2,…,xp). This example shows that a linear predictor function can actually be much more powerful than it first appears: It only really needs to be linear in the coefficients. All sorts of non-linear functions of the explanatory variables can be fit by the model. There is no particular need for the inputs to basis functions to be univariate or single-dimensional (or their outputs, for that matter, although in such a case, a K-dimensional output value is likely to be treated as K separate scalar-output basis functions). An example of this is radial basis functions (RBF's), which compute some transformed version of the distance to some fixed point:
ϕ(𝐱;𝐜)=ϕ(||𝐱−𝐜||)=ϕ((x1−c1)2+…+(xK−cK)2) An example is the Gaussian RBF, which has the same functional form as the normal distribution:
… excerpt ends here. Continue reading the full article.