Matrix Approach to Simple Linear Regression: An Overview

Similar documents
Linear Algebra Review

Chapter 5 Matrix Approach to Simple Linear Regression

STAT 540: Data Analysis and Regression

Outline. Remedial Measures) Extra Sums of Squares Standardized Version of the Multiple Regression Model

Topic 7 - Matrix Approach to Simple Linear Regression. Outline. Matrix. Matrix. Review of Matrices. Regression model in matrix form

Need for Several Predictor Variables

STAT5044: Regression and Anova. Inyoung Kim

Regression Review. Statistics 149. Spring Copyright c 2006 by Mark E. Irwin

Lecture 9 SLR in Matrix Form

Lecture 15 Multiple regression I Chapter 6 Set 2 Least Square Estimation The quadratic form to be minimized is

Final Review. Yang Feng. Yang Feng (Columbia University) Final Review 1 / 58

Preliminaries. Copyright c 2018 Dan Nettleton (Iowa State University) Statistics / 38

STAT 135 Lab 13 (Review) Linear Regression, Multivariate Random Variables, Prediction, Logistic Regression and the δ-method.

Linear models and their mathematical foundations: Simple linear regression

Ch 2: Simple Linear Regression

PART I. (a) Describe all the assumptions for a normal error regression model with one predictor variable,

Lecture 13: Simple Linear Regression in Matrix Format. 1 Expectations and Variances with Vectors and Matrices

[4+3+3] Q 1. (a) Describe the normal regression model through origin. Show that the least square estimator of the regression parameter is given by

Maximum Likelihood Estimation

Estimating Estimable Functions of β. Copyright c 2012 Dan Nettleton (Iowa State University) Statistics / 17

Estimation of the Response Mean. Copyright c 2012 Dan Nettleton (Iowa State University) Statistics / 27

Linear Regression. In this problem sheet, we consider the problem of linear regression with p predictors and one intercept,

LINEAR REGRESSION MODELS W4315

6. Multiple Linear Regression

2. A Review of Some Key Linear Models Results. Copyright c 2018 Dan Nettleton (Iowa State University) 2. Statistics / 28

assumes a linear relationship between mean of Y and the X s with additive normal errors the errors are assumed to be a sample from N(0, σ 2 )

Contents. 1 Review of Residuals. 2 Detecting Outliers. 3 Influential Observations. 4 Multicollinearity and its Effects

Concordia University (5+5)Q 1.

COMPLETELY RANDOMIZED DESIGNS (CRD) For now, t unstructured treatments (e.g. no factorial structure)

Multivariate Regression (Chapter 10)

Ch 3: Multiple Linear Regression

3 Multiple Linear Regression

Weighted Least Squares

Summer School in Statistics for Astronomers V June 1 - June 6, Regression. Mosuk Chow Statistics Department Penn State University.

Chapter 1 Simple Linear Regression (part 6: matrix version)

STAT 100C: Linear models

STAT 360-Linear Models

STA 2101/442 Assignment Four 1

Multivariate Linear Regression Models

18.S096 Problem Set 3 Fall 2013 Regression Analysis Due Date: 10/8/2013

Linear regression. We have that the estimated mean in linear regression is. ˆµ Y X=x = ˆβ 0 + ˆβ 1 x. The standard error of ˆµ Y X=x is.

ST 740: Linear Models and Multivariate Normal Inference

[y i α βx i ] 2 (2) Q = i=1

Peter Hoff Linear and multilinear models April 3, GLS for multivariate regression 5. 3 Covariance estimation for the GLM 8

Xβ is a linear combination of the columns of X: Copyright c 2010 Dan Nettleton (Iowa State University) Statistics / 25 X =

Covariance and Correlation

Linear Models Review

STAT420 Midterm Exam. University of Illinois Urbana-Champaign October 19 (Friday), :00 4:15p. SOLUTIONS (Yellow)

Chapter 12: Multiple Linear Regression

MIT Spring 2015

Simultaneous Inference: An Overview

MA 575 Linear Models: Cedric E. Ginestet, Boston University Midterm Review Week 7

STAT Homework 8 - Solutions

Applied Regression. Applied Regression. Chapter 2 Simple Linear Regression. Hongcheng Li. April, 6, 2013

UNIVERSITY OF MASSACHUSETTS. Department of Mathematics and Statistics. Basic Exam - Applied Statistics. Tuesday, January 17, 2017

Multiple Linear Regression

Formal Statement of Simple Linear Regression Model

Weighted Least Squares

Matrices and Multivariate Statistics - II

Math 423/533: The Main Theoretical Topics

Simple Linear Regression

STAT763: Applied Regression Analysis. Multiple linear regression. 4.4 Hypothesis testing

Simple Linear Regression

Scatter plot of data from the study. Linear Regression

11 Hypothesis Testing

variability of the model, represented by σ 2 and not accounted for by Xβ

STA 2101/442 Assignment 3 1

BIOS 2083 Linear Models c Abdus S. Wahed

Multiple Regression. Dr. Frank Wood. Frank Wood, Linear Regression Models Lecture 12, Slide 1

Multiple Linear Regression for the Supervisor Data

. a m1 a mn. a 1 a 2 a = a n

Chapter 1. Linear Regression with One Predictor Variable

MAT2377. Rafa l Kulik. Version 2015/November/26. Rafa l Kulik

4 Multiple Linear Regression

Lecture 4 Multiple linear regression

Matrices and vectors A matrix is a rectangular array of numbers. Here s an example: A =

Stat 579: Generalized Linear Models and Extensions

Measuring the fit of the model - SSR

Sampling Distributions

ECON The Simple Regression Model

Scatter plot of data from the study. Linear Regression

Lecture 6 Multiple Linear Regression, cont.

STAT 511. Lecture : Simple linear regression Devore: Section Prof. Michael Levine. December 3, Levine STAT 511

Matrix Factorizations

where x and ȳ are the sample means of x 1,, x n

Regression Models for Quantitative and Qualitative Predictors: An Overview

Regression diagnostics

MA 575 Linear Models: Cedric E. Ginestet, Boston University Mixed Effects Estimation, Residuals Diagnostics Week 11, Lecture 1

Statement: With my signature I confirm that the solutions are the product of my own work. Name: Signature:.

5. Multiple Regression (Regressioanalyysi) (Azcel Ch. 11, Milton/Arnold Ch. 12) The k-variable Multiple Regression Model

Categorical Predictor Variables

Linear Models and Estimation by Least Squares

14 Multiple Linear Regression

Inverse of a Square Matrix. For an N N square matrix A, the inverse of A, 1

ANOVA Variance Component Estimation. Copyright c 2012 Dan Nettleton (Iowa State University) Statistics / 32

Regression Analysis. Regression: Methodology for studying the relationship among two or more variables

Applied Regression Analysis

STAT 100C: Linear models

Regression and Statistical Inference

Transcription:

Matrix Approach to Simple Linear Regression: An Overview Aspects of matrices that you should know: Definition of a matrix Addition/subtraction/multiplication of matrices Symmetric/diagonal/identity matrix Transpose/rank/inverse of a matrix Determinants Random vectors and matrices Simple linear regression model in matrix terms Least squares estimation of regression parameters Fitted values and residuals Inferences in regression analysis ANOVA results W Zhou (Colorado State University) STAT 540 July 6th, 2015 1 / 20

Random Vector and Matrix A random vector or a random matrix contains elements that are random variables Simple linear regression: The response variables Y 1,, Y n can be written in the form of a random vector Y n 1 = Y 1 Y n Alternative notation: Y = (Y 1,, Y n ) T or Y = (Y 1,, Y n ) W Zhou (Colorado State University) STAT 540 July 6th, 2015 2 / 20

Expectation of Random Vector/Matrix The expectation of an n 1 random vector Y is E(Y ) n 1 = [E(Y i ) : i = 1,, n] = Since E(Y i ) = β 0 + β 1 X i for i = 1,, n, β 0 + β 1 X 1 E(Y ) = β 0 + β 1 X n E(Y 1 ) E(Y n ) In general, the expectation of an n p random matrix Y is E(Y ) n p = [E(Y ij ) : i = 1,, n; j = 1,, p] W Zhou (Colorado State University) STAT 540 July 6th, 2015 3 / 20

Variance-Covariance Matrix of Random Vector The variance-covariance of an n 1 random vector Y is Σ (or σ 2 {Y }) Σ = V ar(y ) = E [(Y ] E(Y ))(Y E(Y )) T (Y 1 E(Y 1)) 2 (Y 1 E(Y 1))(Y n E(Y n)) (Y 2 E(Y 2))(Y n E(Y n)) = E (Y n E(Y n)) 2 V ar(y 1) Cov(Y 1, Y 2) Cov(Y 1, Y n) V ar(y 2) Cov(Y 2, Y n) = V ar(y n) Since Cov(Y i, Y j ) = Cov(Y j, Y i ), Σ is symmetric W Zhou (Colorado State University) STAT 540 July 6th, 2015 4 / 20

Variance-Covariance Matrix of Random Vector The independent random errors ɛ 1,, ɛ n can be written in the form of a random vector ɛ 1 ɛ n 1 = ɛ n The expectation of ɛ is E(ɛ) = 0 n 1 The variance-covariance matrix of ɛ is σ 2 {ɛ} = Σ ɛ = W Zhou (Colorado State University) STAT 540 July 6th, 2015 5 / 20

Some Basic Results For Y (n 1 random vector), A (n n non-random matrix), and b (n 1 non-random vector), we have E(AY + b) = AE(Y ) + b Var(AY + b) = AVar(Y )A T Also for a n 1 = (a 1,, a n ) T (n 1 non-random vector), a T a = n a 2 i := a 2 2 i=1 and for J = [1] n n (n n matrix of 1 s), a T Ja = W Zhou (Colorado State University) STAT 540 July 6th, 2015 6 / 20

Multivariate Normal Distribution Let Y m 1 = (Y 1,, Y m ) T follow a multivariate normal distribution with mean µ m 1 = (µ 1,, µ m ) T and variance We denote this by Σ m m = (σ 2 ij) i=1,,m;j=1,,m Y N(µ, Σ) The probability density function is [ 1 f(y ) = exp 1 ] (2π) m/2 Σ 1/2 2 (Y µ)t Σ 1 (Y µ), where Σ is the determinant of Σ W Zhou (Colorado State University) STAT 540 July 6th, 2015 7 / 20

Using the Notation with Simple Linear Regression Let Y n 1 = Let X n 2 = Y 1 Y n denote the n 1 vector of response variables 1 X 1 denote the n 2 design matrix of predictor 1 X n variables (2 columns for simple LR) ɛ 1 Let ɛ n 1 = denote the n 1 vector of random errors Let β 2 1 = [ ɛ n β 0 β 1 ] denote the 2 1 vector of regression coefficients W Zhou (Colorado State University) STAT 540 July 6th, 2015 8 / 20

Simple Linear Regression in Matrix Terms The simple linear regression model in matrix terms is Y = Xβ + ɛ, where ɛ N(0, σ 2 I) Recall that E(ɛ) = 0 n 1 and Σ ɛ = σ 2 I n n Thus, we have Y N(Xβ, σ 2 I) since E(Y ) = E(Xβ + ɛ) = Xβ + E(ɛ) = Xβ Σ = Var(Xβ + ɛ) = Var(ɛ) = σ 2 {ɛ} = σ 2 I W Zhou (Colorado State University) STAT 540 July 6th, 2015 9 / 20

Least Squares Estimation [ Let ˆβ ˆβ0 2 1 = ˆβ 1 As we will show, ] denote the least squares estimate of β ˆβ = (X T X) 1 X T Y Recall that the least squares method minimizes Q = In matrix terms, n (Y i β 0 β 1 X i ) 2 i=1 W Zhou (Colorado State University) STAT 540 July 6th, 2015 10 / 20

Normal Equations Let ( Q Q =, Q ) β 2 1 β 0 β 1 Differentiate Q with respect to β to obtain: Q β = Set the equation above to 0 2 1 and obtain a set of normal equations: Thus the least squares estimate of β is ˆβ = assuming that the 2 2 matrix X T X is nonsingular and thus invertible W Zhou (Colorado State University) STAT 540 July 6th, 2015 11 / 20

Fitted Values Let Ŷn 1 = Ŷ 1 Ŷ n Since Ŷi = ˆβ 0 + ˆβ 1 X i, we have denote the n 1 vector of fitted vales Ŷ = X ˆβ Note that Ŷ 1 = 1 X 1 [ ˆβ0 ˆβ 1 ] = ˆβ 0 + ˆβ 1 X 1 Ŷ n 1 X n ˆβ 0 + ˆβ 1 X n W Zhou (Colorado State University) STAT 540 July 6th, 2015 12 / 20

Hat Matrix Rewrite the vector of fitted values as Ŷ = X ˆβ = X(X T X) 1 X T Y := HY where the n n hat matrix is defined as H = X(X T X) 1 X T The hat matrix H is symmetric and idempotent, as H T = HH = W Zhou (Colorado State University) STAT 540 July 6th, 2015 13 / 20

Residuals Let e n 1 = e 1 e n Since e i = Y i Ŷi, we have e = denote the n 1 vector of residuals (I H) is symmetric and idempotent Proof: W Zhou (Colorado State University) STAT 540 July 6th, 2015 14 / 20

Variance-Covariance Matrix of Residuals The variance-covariance matrix of residuals is The estimated variance-covariance matrix of residuals is W Zhou (Colorado State University) STAT 540 July 6th, 2015 15 / 20

Fitted Values The variance-covariance matrix of fitted values is The estimate of σ 2 {Ŷ } is W Zhou (Colorado State University) STAT 540 July 6th, 2015 16 / 20

Regression Coefficients The variance-covariance matrix of least squares estimates is The estimate of σ 2 { ˆβ} is W Zhou (Colorado State University) STAT 540 July 6th, 2015 17 / 20

Estimation of Mean Response and Prediction of New Observation Define X h = [ 1 X h ] NOTE!! Book uses column vector for X h, not row So many transposes are opposite from book s presentation! The variance of Ŷh for estimating E(Y h ) is The estimate of σ 2 {Ŷh} is Similarly, the variance of Ŷh for predicting Y h(new) is The estimate of σ 2 {pred} is W Zhou (Colorado State University) STAT 540 July 6th, 2015 18 / 20

Sums of Squares Total sum of squares: n SST O = (Y i Ȳ )2 = i=1 Error sum of squares: n SSE = (Y i Ŷi) 2 = e T e = i=1 Regression sum of squares: SSR = SST O SSE = W Zhou (Colorado State University) STAT 540 July 6th, 2015 19 / 20

Sums of Squares as Quadratic Forms For a non-random symmetric n n matrix A, a quadratic form is defined as n n Q(Y ) = Y T AY = a ij Y i Y j, a ij = a ji Total sum of squares: SST O = i=1 j=1 Error sum of squares: SSE = Regression sum of squares: SSR = W Zhou (Colorado State University) STAT 540 July 6th, 2015 20 / 20