Multiple Linear Regression Week 4, Lecture 2

2y ago
49 Views
3 Downloads
258.17 KB
5 Pages
Last View : 21d ago
Last Download : 3m ago
Upload by : Kaleb Stephen
Transcription

MA 575: Linear ModelsMA 575 Linear Models:Cedric E. Ginestet, Boston UniversityMultiple Linear RegressionWeek 4, Lecture 21Multiple Regression1.1The DataThe simple linear regression setting can be extended to the case of p independent variables, such that wemay now have the following array of data points,(yi , xi1 , . . . , xip ),i 1, . . . , n.In addition, and for notational convenience, we also include a dummy variable, which will be used to computethe y-intercept, β0 . Therefore, when the model includes such an intercept, we add the dummy variablexi0 : 1, for every i, and obtain the full data set,(yi , xi0 , xi1 , . . . , xip ),i 1, . . . , n.Therefore,1. the number of covariates will be denoted by p,2. whereas the number of parameters will be denoted by p : p 1.Naturally, the IVs, xij , can take either discrete or continuous values, without affecting the estimationprocedure. In the sequel, we will systematically assume that the model contains an intercept, except whenspecified otherwise. In multiple regression, it is assumed that p n, and more generally, we mainly considerdata sets, for which p n.1.2The ModelMultiple linear regression (MLR) is defined in the following manner,yi pXxij βj ei , i 1, . . . , n,j 0which may then be reformulated, using linear algebra,yi xTi β ei , i 1, . . . , n,Department of Mathematics and Statistics, Boston University1

MA 575: Linear Modelswhere β and the xi ’s are (p 1) column vectors. Altogether, we can write the entire system of linearequations in matrix format,e11 x11 . . . x1py1βe21 x21 . . . x2p .0y2. . . .βpen1 xn1 . . . xnpynAlternatively, one could also re-express this as a single equation, alongside the assumption on the error terms,y Xβ e,where y and e are (n 1) vectors, X is an (n p ) matrix, and β is a (p 1) vector.1.3Example: One-way ANOVAThe matrix X is usually referred to as the design matrix, because it specifies the experimental design. Forinstance, if considering a one-way analysis of variance (ANOVA) over three different groups, where we have2 subjects in each group. We may select one of the following two design matrices,110X1 : 000001100000,011and111X2 : 111001100000;011where in the former case, X1 is called a cell means design, whereas in the latter case, X2 is referred toas a reference group design, where the mean value in the two remaining groups are expressed as offsetsfrom the value attained in the first group.1.4Geometrical PerspectiveJust as the mean function of a simple regression determines a one-dimensional line in the two-dimensionalEuclidean space, R2 , the defining equation of multiple regression determines a p-dimensional hyperplane embedded into the p -dimensonal Euclidean space, Rp .The goal of OLS estimation is to identify the optimal hyperplane minimizing our target statisticalcriterion with respect to all the points in the sample, i.e. the n points of the form (yi , xi1 , . . . , xip ), positioned in p -dimensional Euclidean space, Rp .1.5Model AssumptionsMultiple regression is based on the following assumptions:1. Linearity in the parameters, such that the mean function is defined asE[Yi X] xTi β, i 1, . . . , n.2. Independence and homoscedasticity of the error terms, such thatVar[e X] σ 2 In .Department of Mathematics and Statistics, Boston University2

MA 575: Linear ModelsEquivalently, the variance function may be assumed to satisfy,Var[y X] σ 2 In ,since the variance operator is invariant under translation, i.e. Var[a Y] Var[Y].3. In addition to the standard OLS assumptions for simple linear regression, we will also assume that Xhas full rank. That is,rank(X) p .22.1Minimizing the Residual Sum of SquaresMatrix Formulation for RSSSince p n, we have here a non-homogeneous over-determined system of linear equations, in the parametersβj ’s. So, as before, we define, for computational convenience, a statistical criterion, which we wish tominimize. The RSS for this model is given byRSS(β) : nXyi xTi β 2,i 1which can be re-expressed more concisely as follows,RSS(β) : (y Xβ)T (y Xβ).Observe that this criterion is a scalar, and not a vector or a matrix. This is a dot product. In particular,this should be contrasted with the variance of a vector, such as for instance,hiVar[y X] : E (y E[y X])(y E[y X])T ,which is an n n matrix.2.2Some Notions of Matrix CalculusConsider a vector-valued function F(x) : Rn 7 Rm of order m 1, such thathiTF(x) f1 (x), . . . , fm (x) .The differentiation of such a vector-valued function F(x) by another vector x of order n 1 is ambiguousin the sense that the derivative F(x) xcan either be expressed as an m n matrix (numerator layout convention), or as an n m matrix(denominator layout convention), such that we have F(x) x f1 (x) x1. fm (x) x1. f1 (x) xn. fm (x) xn,or F(x) xDepartment of Mathematics and Statistics, Boston University f1 (x) x1. f1 (x) xn. fm (x) x1. fm (x) xn3

MA 575: Linear ModelsIn the sequel, we will adopt the denominator layout convention, such that the resulting vector of partialderivatives will be of the dimension of the vector that we are conducting the differentiation with respectto. Moreover, we will be mainly concerned with differentiating scalars. However, observe that the choice oflayout convention remains important, even though we are only considering the case of scalar-valued functions. Indeed, if we were to adopt the numerator convention, the derivative xf (x) would produce a row vector,whereas the denominator convention would yield a column vector. In a sense, the choice of a particularlayout convention is equivalent to the question of treating all vectors as either row or column vectors inlinear algebra. Here, for consistency, all vectors are treated as column vectors, and therefore we also selectthe denominator layout convention.For instance, given any column vectors a, x Rn , the scalar-valued function f (x) : aT x is differentiatedas follows,P aT xai xi x1 x1 T. a. (a x) xPT a xai xi xn xnMoreover, it immediately follows that differentiating a scalar is invariant to transposition, T T T T(a x) (a x) (x a) a. x x x(1)For a quadratic form, however, things become slightly more cumbersome. Here, we are considering thefunction of a column vector x Rn , for some square matrix A of order n n,Tx Ax x1.xna11.an1.a1n x1. .ann xnNaturally, this quantity is also a scalar. Differentiation with respect to x, adopting the denominatorconvention givesP i,j aij xi xj x1 T.(x Ax) ,(2) xP . i,j aij xi xj xnwhere observe that the double summation in each element of this vector can be simplified as follows, nn XX T(x Ax) aij xi xj x xk i 1 j 1k nXj 1akj xj nXajk xj Ak· x AT·k x,j 1for every k 1, . . . , n, and where Ak· and A·k denote the k th row and the k th column of A, respectively.For the entire vector, the above expression therefore gives T(x Ax) Ax AT x A AT x, xwhere recall that A is a square matrix, which can hence be transposed. Now, if in addition, this matrix isalso symmetric, such that A AT , then T(x Ax) 2Ax, xDepartment of Mathematics and Statistics, Boston University(3)4

MA 575: Linear Models kwhich provides a natural matrix generalization of the classical power rule of differential calculus, xx k 1Tkx, when k 2. A useful mnemonic for recalling whether one should eliminate x or x, is to rememberthat we must obtain a matrix, which is conformable to the order of the argument with respect to which wedifferentiate. In this case, this is β, which is of order (n 1), and therefore we know that we must obtainAx, which is also of order (n 1).2.3Derivation of OLS EstimatorsNow, the OLS estimators can be defined as the vector of βj ’s that minimizes the RSS,eβb : argmin RSS(β).e p β RThis can be expanded in the following manner,RSS(β) : (y Xβ)T (y Xβ) yT y yT Xβ β T XT y β T (XT X)β yT y 2β T XT y β T (XT X)β,where we have used the fact that any scalar is invariant under transposition, such thatyT Xβ (yT Xβ)T β T XT y.Differentiating and setting to 0, we obtain T T T Tβ (X X)β 2β X y 0, β βwhere using equations (1) and (3), we obtain2(XT X)β 2XT ysince XT X can be shown to be symmetric. This produces a system of linear equations, which are referredto as the normal equations, in statistics. These equations put p constraints on the random vector, y, ofobserved values.Finally, we have also assumed that X is full rank. Moreover, since X is a matrix with real entries, itis known that the rank of X is equal to the rank of its Gram matrix, defined as XT X, such thatrank(X) rank(XT X) p .Since XT X is a matrix of order p p , it follows that this matrix is therefore also of full rank, which isequivalent to that matrix being invertible. Thus, the minimizer of RSS(β) is given byβb (XT X) 1 XT y.Department of Mathematics and Statistics, Boston University5

MA 575: Linear Models MA 575 Linear Models: Cedric E. Ginestet, Boston University Multiple Linear Regression Week 4, Lecture 2 1 Multiple Regression 1.1 The Data The simple linear regression setting can be extended to the case of pindependent variables, such that we may now have the followi

Related Documents:

independent variables. Many other procedures can also fit regression models, but they focus on more specialized forms of regression, such as robust regression, generalized linear regression, nonlinear regression, nonparametric regression, quantile regression, regression modeling of survey data, regression modeling of

(prorated 13/week) week 1 & 2 156 week 3 130 week 4 117 week 5 104 week 6 91 week 7 78 week 8 65 week 9 52 week 10 39 week 11 26 week 12 13 17-WEEK SERIES* JOIN IN MEMBER PAYS (prorated 10.94/week) week 1 & 2 186.00 week 3 164.10 week 4 153.16 week 5 142.22 week 6 131.28 week 7 120.34

LINEAR REGRESSION 12-2.1 Test for Significance of Regression 12-2.2 Tests on Individual Regression Coefficients and Subsets of Coefficients 12-3 CONFIDENCE INTERVALS IN MULTIPLE LINEAR REGRESSION 12-3.1 Confidence Intervals on Individual Regression Coefficients 12-3.2 Confidence Interval

Multiple Linear Regression Linear relationship developed from more than 1 predictor variable Simple linear regression: y b m*x y β 0 β 1 * x 1 Multiple linear regression: y β 0 β 1 *x 1 β 2 *x 2 β n *x n β i is a parameter estimate used to generate the linear curve Simple linear model: β 1 is the slope of the line

Probability & Bayesian Inference CSE 4404/5327 Introduction to Machine Learning and Pattern Recognition J. Elder 3 Linear Regression Topics What is linear regression? Example: polynomial curve fitting Other basis families Solving linear regression problems Regularized regression Multiple linear regression

Its simplicity and flexibility makes linear regression one of the most important and widely used statistical prediction methods. There are papers, books, and sequences of courses devoted to linear regression. 1.1Fitting a regression We fit a linear regression to covariate/response data. Each data point is a pair .x;y/, where

Week 3: Spotlight 21 Week 4 : Worksheet 22 Week 4: Spotlight 23 Week 5 : Worksheet 24 Week 5: Spotlight 25 Week 6 : Worksheet 26 Week 6: Spotlight 27 Week 7 : Worksheet 28 Week 7: Spotlight 29 Week 8 : Worksheet 30 Week 8: Spotlight 31 Week 9 : Worksheet 32 Week 9: Spotlight 33 Week 10 : Worksheet 34 Week 10: Spotlight 35 Week 11 : Worksheet 36 .

Last previous edition approved in 2018 as A234/A234M – 18. DOI: 10.1520/A0234_A0234M-18A. 2 For ASME Boiler and Pressure Vessel Code applications see related Specifi-cation SA-234 in Section II of that Code. 3 For referenced ASTM standards, visit the ASTM website, www.astm.org, or contact ASTM Customer Service at service@astm.org. For Annual Book of ASTM Standards volume information, refer .