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

Similar documents
B = B is a 3 4 matrix; b 32 = 3 and b 2 4 = 3. Scalar Multiplication

Linear regression. Daniel Hsu (COMS 4771) (y i x T i β)2 2πσ. 2 2σ 2. 1 n. (x T i β y i ) 2. 1 ˆβ arg min. β R n d

CLRM estimation Pietro Coretto Econometrics

Matrices and vectors

Matrix Algebra 2.2 THE INVERSE OF A MATRIX Pearson Education, Inc.

Why learn matrix algebra? Vectors & Matrices with statistical applications. Brief history of linear algebra

Chapter Vectors

Slide Set 13 Linear Model with Endogenous Regressors and the GMM estimator

TAMS24: Notations and Formulas

Linear Regression Models, OLS, Assumptions and Properties

Matrix Representation of Data in Experiment

Geometry of LS. LECTURE 3 GEOMETRY OF LS, PROPERTIES OF σ 2, PARTITIONED REGRESSION, GOODNESS OF FIT

Apply change-of-basis formula to rewrite x as a linear combination of eigenvectors v j.

Inverse Matrix. A meaning that matrix B is an inverse of matrix A.

ECONOMETRIC THEORY. MODULE XIII Lecture - 34 Asymptotic Theory and Stochastic Regressors

M 340L CS Homew ork Set 6 Solutions

M 340L CS Homew ork Set 6 Solutions

Algebra of Least Squares

Solution to Chapter 2 Analytical Exercises

University of California, Los Angeles Department of Statistics. Practice problems - simple regression 2 - solutions

STATISTICAL PROPERTIES OF LEAST SQUARES ESTIMATORS. Comments:

Linear Algebra Review

Probability 2 - Notes 10. Lemma. If X is a random variable and g(x) 0 for all x in the support of f X, then P(g(X) 1) E[g(X)].

Linear Regression Demystified

Lecture 22: Review for Exam 2. 1 Basic Model Assumptions (without Gaussian Noise)

CHAPTER I: Vector Spaces

Section 14. Simple linear regression.

Chapter Unary Matrix Operations

(all terms are scalars).the minimization is clearer in sum notation:

Chimica Inorganica 3

First, note that the LS residuals are orthogonal to the regressors. X Xb X y = 0 ( normal equations ; (k 1) ) So,

11 Correlation and Regression

CHAPTER 5. Theory and Solution Using Matrix Techniques

Statistical and Mathematical Methods DS-GA 1002 December 8, Sample Final Problems Solutions

STAT5044: Regression and Anova. Inyoung Kim

1 Inferential Methods for Correlation and Regression Analysis

Chapter 5 Matrix Approach to Simple Linear Regression

Statistical Properties of OLS estimators

Statistics 203 Introduction to Regression and Analysis of Variance Assignment #1 Solutions January 20, 2005

, then cv V. Differential Equations Elements of Lineaer Algebra Name: Consider the differential equation. and y2 cos( kx)

THE KALMAN FILTER RAUL ROJAS

The Method of Least Squares. To understand least squares fitting of data.

A Relationship Between the One-Way MANOVA Test Statistic and the Hotelling Lawley Trace Test Statistic

1 General linear Model Continued..

(3) If you replace row i of A by its sum with a multiple of another row, then the determinant is unchanged! Expand across the i th row:

Matrix Approach to Simple Linear Regression: An Overview

ECON 3150/4150, Spring term Lecture 3

Open book and notes. 120 minutes. Cover page and six pages of exam. No calculators.

( ) ( ) ( ) notation: [ ]

Theorem: Let A n n. In this case that A does reduce to I, we search for A 1 as the solution matrix X to the matrix equation A X = I i.e.

(I.C) Matrix algebra

Recurrence Relations

Linear Regression Models

Lecture 24: Variable selection in linear models

Unbiased Estimation. February 7-12, 2008

Asymptotic Results for the Linear Regression Model

Chapter 2 Multiple Regression I (Part 1)

MA Advanced Econometrics: Properties of Least Squares Estimators

Optimally Sparse SVMs

Machine Learning for Data Science (CS 4786)

Math E-21b Spring 2018 Homework #2

Simple Regression. Acknowledgement. These slides are based on presentations created and copyrighted by Prof. Daniel Menasce (GMU) CS 700

The Basic Space Model

Efficient GMM LECTURE 12 GMM II

Principle Of Superposition

Stat 139 Homework 7 Solutions, Fall 2015

Cov(aX, cy ) Var(X) Var(Y ) It is completely invariant to affine transformations: for any a, b, c, d R, ρ(ax + b, cy + d) = a.s. X i. as n.

Lecture 11 Simple Linear Regression

MATH10212 Linear Algebra B Proof Problems

Maximum Likelihood Estimation

Lecture 1, Jan 19. i=1 p i = 1.

SIMPLE LINEAR REGRESSION AND CORRELATION ANALYSIS

The variance of a sum of independent variables is the sum of their variances, since covariances are zero. Therefore. V (xi )= n n 2 σ2 = σ2.

Simple Linear Regression

Properties and Hypothesis Testing

Determinants of order 2 and 3 were defined in Chapter 2 by the formulae (5.1)

Machine Learning for Data Science (CS 4786)

ECE 901 Lecture 12: Complexity Regularization and the Squared Loss

Basic Iterative Methods. Basic Iterative Methods

Table 12.1: Contingency table. Feature b. 1 N 11 N 12 N 1b 2 N 21 N 22 N 2b. ... a N a1 N a2 N ab

5.1 Review of Singular Value Decomposition (SVD)

Lecture 20: Multivariate convergence and the Central Limit Theorem

Estimation of the Mean and the ACVF

INTRODUCTION TO MATRIX ALGEBRA. a 11 a a 1n a 21 a a 2n...

LECTURE 8: ORTHOGONALITY (CHAPTER 5 IN THE BOOK)

Review Problems 1. ICME and MS&E Refresher Course September 19, 2011 B = C = AB = A = A 2 = A 3... C 2 = C 3 = =

6. Kalman filter implementation for linear algebraic equations. Karhunen-Loeve decomposition

Matrix Algebra 2.3 CHARACTERIZATIONS OF INVERTIBLE MATRICES Pearson Education, Inc.

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

MATH 320: Probability and Statistics 9. Estimation and Testing of Parameters. Readings: Pruim, Chapter 4

In this section we derive some finite-sample properties of the OLS estimator. b is an estimator of β. It is a function of the random sample data.

a for a 1 1 matrix. a b a b 2 2 matrix: We define det ad bc 3 3 matrix: We define a a a a a a a a a a a a a a a a a a

Economics 241B Relation to Method of Moments and Maximum Likelihood OLSE as a Maximum Likelihood Estimator

9. Simple linear regression G2.1) Show that the vector of residuals e = Y Ŷ has the covariance matrix (I X(X T X) 1 X T )σ 2.

Soo King Lim Figure 1: Figure 2: Figure 3: Figure 4: Figure 5: Figure 6: Figure 7:

11 THE GMM ESTIMATION

Definitions and Theorems. where x are the decision variables. c, b, and a are constant coefficients.

Stochastic Matrices in a Finite Field

Problems from 9th edition of Probability and Statistical Inference by Hogg, Tanis and Zimmerman:

BHW #13 1/ Cooper. ENGR 323 Probabilistic Analysis Beautiful Homework # 13

Transcription:

Chapter Simple Liear Regressio (part 6: matrix versio) Overview Simple liear regressio model: respose variable Y, a sigle idepedet variable X Y β 0 + β X + ε Multiple liear regressio model: respose Y, more tha oe idepedet variables X,X 2,, X p Y β 0 + β X + β 2 X 2 + + β p X p + ε To ivestigate multiple regressio model, we eed matrix 2 Review of Matrices A matrix: a rectagular array of elemets arraged i rows ad colums a example Row Row 2 Row 3 Colum Colum 2 00 22 300 46 600 8 2 A matrix with r rows ad c colums a a 2 a j a c a 2 a 22 a 2j a 2c A a i a i2 a ij a ic a r a r2 a rj a rc Sometimes deote it as A a ij i,, r; j,, c

r ad c are called the dimesio of a matrix 22 Square matrix ad Vector Square matrix: equal umber of rows ad colums a 4 7 a 2 a 3, a 3 9 2 a 22 a 23 a 3 a 32 a 33 vector: matrix with oly oe row or oe colum A 4 7 0 B 23 Traspose of a matrix ad equality of matrices 5 25 20 traspose of a matrix A is aother matrix deoted by A A 2 5 7 0 3 4, A 2 7 3 5 0 4 two matrices are equal if they have the same dimesio ad all the correspodig elemets are equal Suppose A a a 2 a 2 a 22 a 3 a 32 If A B, thea 7,a 2 2,, B 7 2 4 5 3 9 24 Matrix additio ad subtractio Addig or subtractig of two matrices require that they have the same dimesio 4 2 A 2 5, B 2 3, 3 6 3 4 A + B + 4+2 2+2 5+3 3+3 6+4 A B 4 2 2 2 5 3 3 3 6 4 2 6 4 8 6 0 0 2 0 2 0 2, 2

25 Matrix multiplicatio Multiplicatio of a Matrix by a Scalar 2 7 A 9 3 2 7 4A A4 4 9 3, 8 28 36 2 Multiplicatio of a Matrix by a Matrix If A has dimesio r c ad B has dimesio c s, the product AB is a matrix of dimesio r s with the elemet i the ith row ad jth colum: A 26 Regressio examples 4 2 5 8 c a ik b kj k a a 2 4a +2a 2 5a +8a 2 It is easy to check X X 2 X β0 β β 0 + β X β 0 + β X 2 β 0 + β X Let Y Y Y, X X X 2 X, β β0 β, E ε ε 2 ε The regressio model Y β 0 + β X + ε, β 0 + β X 2 + ε 2, Y β 0 + β X + ε ca be writte as Y Xβ + E 3

Other calculatios X X X X 2 X X Y X X 2 X X X 2 X Y Y Y Y Y Y i X i i Y i i X iy i Y Y i i i X i i X2 i 27 Special types of matrices Symmetric Matrix A A A 4 6 4 2 5 6 5 3 Diagoal Matrix: a square matrix whose off-diagoal elemets are all zeros a 0 0 0 a 2 0 0 0 a 3 Idetity Matrix I 0 0 0 0 0 0 facts: for ay appropriate matrix AI A ad IB B zero vector ad uit vector 0 0 0 0, 4

28 Iverse of a square matrix the iverse of a square matrix A is aother square matrix, deoted by A, such that AA A A I Sice 0 04 03 02 or 2 4 3 So A 2 4 3 2 4 3 0 04 03 02 A 29 Fidig the Iverse of a matrix 0 04 03 02 0 0 0 0 I I If the where D ad bc a b A c d A d D c D b D a D For high dimesioal matrix, its iverse is ot easy to calculate by had 20 Regressio example (cotiue) the iverse of matrix X X i X i i X i i X2 i D i X2 i ( i X i) 2 So (X X) i X2 i ( i X i) 2 i X2 i i (X i X) 2 i X i i (X i X) 2 i X i i (X i X) 2 i (X i X) 2 + X2 i (X i X) 2 i (X i X) 2 X i (X i X) 2 X i (X i X) 2 i (X i X) 2 5

2 Use of Iverse Matrix Suppose we wat to solve two equatios: 2y +4y 2 20 3y + y 2 0 Rewrite the equatios i matrix otatio: 2 4 3 y y 2 20 0 So the solutio to the equatios y y 2 2 4 3 0 04 03 02 20 0 20 0 Estimatio a regressio model eed to solve liear equatios, ad iverse matri is very useful 22 Other basic facts for matrices A + B B + A C(A + B) CA + CB (A ) A (AB) B A (A ) A (AB) B A (A ) (A ) 3 Radom vector ad matrices 2 4 Radom vector Y Y Y 3 6

Expectatio of radom vector E{Y} E{Y } E{ } E{Y 3 } Radom vector The Y Y Y 3, Z Z Z 2 Z 3 E(Y + Z) EY + EZ Variace-covariace Matrix of radom vector Var{Y} E{Y E{Y}Y E{Y} } Var{Y } Cov{Y, } Cov{Y,Y 3 } Cov{,Y } Var{ } Cov{,Y 3 } Cov{Y 3,Y } Cov{Y 3, } Var{Y 3 } I simple liear regressio model, errors are ucorrelated, so Var{E} σ 2 I Proof: for example cosider 3 Var{E} σ 2 0 0 0 σ 2 0 0 0 σ 2 3 Some basic facts If we have a radom vector W equal to a radom vector Y multiplied by a costat matrix A W AY we have E{W} AE{Y} If c is a costat vector, the Var{W} Var{AY} AVar{Y}A E(c + AY)c + AEY ad Var(c + AY)Var(AY)AVar{Y}A I simple liear regressio model, it follows from above Var{Y} σ 2 I 7

32 A illustratio W W E W 2 W 2 Y E{Y } E{ } Y Y 2 Y + E{Y } E{Y 2 } E{Y } + E{ } W Var{ W 2 } Var{Y } Cov{Y, } Cov{,Y } Var{ } 4 Simple liear regressio model (matrix versio) The model with assumptio Y β 0 + β X + ε β 0 + β X 2 + ε 2 Y β 0 + β X + ε E(ε i )0, 2 Var(ε i )σ 2,Cov(ε i,ε j ) 0 for all i j 3 ε i N(0,σ 2 ),i,, are idepedet Recall, the model ca be writte as Y Xβ + E Note that E{E} 0, Var{E} The assumptios ca be rewritte as E(E) 0, σ 2 0 0 0 0 σ 2 0 0 0 0 0 σ 2 σ2 I 2 Var(E) σ 2 I 3 E N(0,σ 2 I) 8

Thus E(Y) Xβ ad Var(Y) σ 2 I The model (with assumptios, 2, ad 3) ca also be writte as Y N(Xβ,σ 2 I) or Y Xβ + E, E N(0,σ 2 I) 4 Least squares estimator b 0, b The ormal equatios ca be writte as i X i i X b0 b 0 + b i X i i i X2 i b b 0 i X i + b i X2 i i Y i i X iy i X X X X 2 X X X 2 X i X i i X i i X2 i X Y X X 2 X Y Y i Y i i X iy i let The the ormal equatio is we ca fid b by b b0 b X Xb X Y b (X X) X Y 42 A example Y 6 5 0 5 3 22 ; X 4 2 3 3 4 9

X X b 6 7 7 55 6 7 7 55, X 8 Y 26 8 26 43 Fitted values ad residuals i matrix form Deote X(X X) X Ŷ Ŷ Ŷ 2 Ŷ by H, wehave b 0 + b X b 0 + b X 2 b 0 + b X e Y Ŷ e e 2 e Ŷ X(X X) X Y Xb Ŷ HY, e (I H)Y 44 Variace-covariace matrix for residuals e Var{e} Var{(I H)Y} (I H)Var{Y}(I H) Var{Y} Var{ε} σ 2 I (I H) I H I H HH X(X X) X X(X X) X X(X X) X H (I H)(I H) I 2H + HH I H Var{e} σ 2 (I H) estimatedbyˆσ 2 (I H) 0

45 Aalysis of variace i matrix form Let the J SST Y Y Y JY Y (I J)Y Proof Proof SSE SST (Y i Ȳ )2 i Y Y ( i i i i, Y Y Y i ) 2 Y Y Y JY i ( i Y i) 2 i e 2 i e e (Y Xb) (Y Xb) Y (I H)Y i Y i SSE (Y Xb) (Y Xb) Y Y 2b X Y + b X Xb Y Y 2b X Y + b X X(X X) X Y Y Y 2b X Y + b X Y Y Y b X Y Y (I H)Y SSR SST SSE Y (H J)Y

46 Variace-covariace matrix for b b (X X) X Y Var{b} (X X) X Var{Y}X(X X) σ 2 (X X) σ 2 + X2 X i (X i X) 2 i (X i X) 2 X i (X i X) 2 i (X i X) 2 where σ 2 ca be estimated by ˆσ 2 MSE 47 Variace for the predicted value Ŷ b 0 + b X Var{Ŷ } X b X Var{b} X σ 2 X (X X) X 2