The General Linear Model. The Simple Linear Model Linear Regression.

Slides:



Advertisements
Similar presentations
Modeling of Data. Basic Bayes theorem Bayes theorem relates the conditional probabilities of two events A, and B: A might be a hypothesis and B might.
Advertisements

11-1 Empirical Models Many problems in engineering and science involve exploring the relationships between two or more variables. Regression analysis.
General Linear Model With correlated error terms  =  2 V ≠  2 I.
A. The Basic Principle We consider the multivariate extension of multiple linear regression – modeling the relationship between m responses Y 1,…,Y m and.
The Simple Regression Model
CmpE 104 SOFTWARE STATISTICAL TOOLS & METHODS MEASURING & ESTIMATING SOFTWARE SIZE AND RESOURCE & SCHEDULE ESTIMATING.
Linear regression models
Simple Regression. Major Questions Given an economic model involving a relationship between two economic variables, how do we go about specifying the.
Ch11 Curve Fitting Dr. Deshi Ye
Objectives (BPS chapter 24)
1 Chapter 2 Simple Linear Regression Ray-Bing Chen Institute of Statistics National University of Kaohsiung.
© 2010 Pearson Prentice Hall. All rights reserved Least Squares Regression Models.
The Simple Linear Regression Model: Specification and Estimation
Maximum likelihood (ML) and likelihood ratio (LR) test
Chapter 10 Simple Regression.
Simple Linear Regression
1 Chapter 3 Multiple Linear Regression Ray-Bing Chen Institute of Statistics National University of Kaohsiung.
Chapter 13 Introduction to Linear Regression and Correlation Analysis
Maximum likelihood (ML) and likelihood ratio (LR) test
The Simple Regression Model
Fall 2006 – Fundamentals of Business Statistics 1 Chapter 13 Introduction to Linear Regression and Correlation Analysis.
Chapter Topics Types of Regression Models
1 Simple Linear Regression Chapter Introduction In this chapter we examine the relationship among interval variables via a mathematical equation.
Linear and generalised linear models
Linear and generalised linear models
Linear and generalised linear models Purpose of linear models Least-squares solution for linear models Analysis of diagnostics Exponential family and generalised.
11-1 Empirical Models Many problems in engineering and science involve exploring the relationships between two or more variables. Regression analysis.
Correlation and Regression Analysis
The Neymann-Pearson Lemma Suppose that the data x 1, …, x n has joint density function f(x 1, …, x n ;  ) where  is either  1 or  2. Let g(x 1, …,
Regression and Correlation Methods Judy Zhong Ph.D.
Introduction to Linear Regression and Correlation Analysis
1 1 Slide © 2005 Thomson/South-Western Slides Prepared by JOHN S. LOUCKS St. Edward’s University Slides Prepared by JOHN S. LOUCKS St. Edward’s University.
Applications The General Linear Model. Transformations.
Introduction to Linear Regression
Chap 12-1 A Course In Business Statistics, 4th © 2006 Prentice-Hall, Inc. A Course In Business Statistics 4 th Edition Chapter 12 Introduction to Linear.
Chapter 11 Linear Regression Straight Lines, Least-Squares and More Chapter 11A Can you pick out the straight lines and find the least-square?
Inference for Regression Chapter 14. Linear Regression We can use least squares regression to estimate the linear relationship between two quantitative.
1 11 Simple Linear Regression and Correlation 11-1 Empirical Models 11-2 Simple Linear Regression 11-3 Properties of the Least Squares Estimators 11-4.
Brief Review Probability and Statistics. Probability distributions Continuous distributions.
Chapter 8: Simple Linear Regression Yang Zhenlin.
Multivariate Data. Descriptive techniques for Multivariate data In most research situations data is collected on more than one variable (usually many.
Brief Review Probability and Statistics. Probability distributions Continuous distributions.
Brief Review Probability and Statistics. Probability distributions Continuous distributions.
Linear Regression Linear Regression. Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. Purpose Understand Linear Regression. Use R functions.
Stats & Summary. The Woodbury Theorem where the inverses.
Week 21 Order Statistics The order statistics of a set of random variables X 1, X 2,…, X n are the same random variables arranged in increasing order.
Week 21 Statistical Model A statistical model for some data is a set of distributions, one of which corresponds to the true unknown distribution that produced.
1 AAEC 4302 ADVANCED STATISTICAL METHODS IN AGRICULTURAL RESEARCH Part II: Theory and Estimation of Regression Models Chapter 5: Simple Regression Theory.
Statistics 350 Lecture 2. Today Last Day: Section Today: Section 1.6 Homework #1: Chapter 1 Problems (page 33-38): 2, 5, 6, 7, 22, 26, 33, 34,
Econometrics III Evgeniya Anatolievna Kolomak, Professor.
Estimation Econometría. ADE.. Estimation We assume we have a sample of size T of: – The dependent variable (y) – The explanatory variables (x 1,x 2, x.
Linear Regression Hypothesis testing and Estimation.
The “Big Picture” (from Heath 1995). Simple Linear Regression.
STA302/1001 week 11 Regression Models - Introduction In regression models, two types of variables that are studied:  A dependent variable, Y, also called.
The simple linear regression model and parameter estimation
11-1 Empirical Models Many problems in engineering and science involve exploring the relationships between two or more variables. Regression analysis.
REGRESSION G&W p
Probability Theory and Parameter Estimation I
Correlation and Simple Linear Regression
Simple Linear Regression - Introduction
Correlation and Simple Linear Regression
6-1 Introduction To Empirical Models
Correlation and Simple Linear Regression
Simple Linear Regression
Simple Linear Regression and Correlation
Created by Erin Hodgess, Houston, Texas
Regression Models - Introduction
Correlation and Simple Linear Regression
Correlation and Simple Linear Regression
Presentation transcript:

The General Linear Model

The Simple Linear Model Linear Regression

Suppose that we have two variables 1. Y – the dependent variable (response variable) 2. X – the independent variable (explanatory variable, factor)

X, the independent variable may or may not be a random variable. Sometimes it is randomly observed. Sometimes specific values of X are selected

The dependent variable, Y, is assumed to be a random variable. The distribution of Y is dependent on X The object is to determine that distribution using statistical techniques. (Estimation and Hypothesis Testing)

These decisions will be based on data collected on both variable Y (the dependent variable) and X (the independent variable). Let (x 1, y 1 ), (x 2, y 2 ), …,(x n, y n ) denote n pairs of values measured on the independent variable (X) and the dependent variable (Y) The scatterplot: The graphical plot of the points: (x 1, y 1 ), (x 2, y 2 ), …,(x n, y n )

Assume that we have collected data on two variables X and Y. Let ( x 1, y 1 ) ( x 2, y 2 ) ( x 3, y 3 ) … ( x n, y n ) denote the pairs of measurements on the on two variables X and Y for n cases in a sample (or population)

1.independent random variables. 2.Normally distributed. 3.Have the common variance, . 4.The mean of y i is  i =  +  x i The assumption will be made that y 1, y 2, y 3 …, y n are Data that satisfies the assumptions above is to come from the Simple Linear Model

Each y i is assumed to be randomly generated from a normal distribution with mean  i =  +  x i and standard deviation . yiyi  +  x i  xixi

When data is correlated it falls roughly about a straight line.

The density of y i is: The joint density of y 1,y 2, …,y n is:

Estimation of the parameters the intercept  the slope  the standard deviation  (or variance  2 )

The Least Squares Line Fitting the best straight line to “linear” data

Let Y = a + b X denote an arbitrary equation of a straight line. a and b are known values. This equation can be used to predict for each value of X, the value of Y. For example, if X = x i (as for the i th case) then the predicted value of Y is:

Define the residual for each case in the sample to be: The residual sum of squares (RSS) is defined as: The residual sum of squares (RSS) is a measure of the “goodness of fit of the line Y = a + bX to the data

One choice of a and b will result in the residual sum of squares attaining a minimum. If this is the case than the line: Y = a + bX is called the Least Squares Line

To find the Least Squares estimates, a and b, we need to solve the equations: and

Note: or and

Note: or

Hence the optimal values of a and b satisfy the equations: and From the first equation we have: The second equation becomes:

Solving the second equation for b: and where and

Note: and Proof

Summary: Slope and intercept of the least squares Line and

Maximum Likelihood Estimation of the parameters the intercept  the slope  the standard deviation 

Recall The joint density of y 1,y 2, …,y n is: = the Likelihood function

the log Likelihood function To find the maximum Likelihood estimates of ,  and  we need to solve the equations:

These are the same equations for the least squares line which have solution: becomes

The third equation: becomes

Summary: Maximum Likelihood Estimates and

A computing formula for the estimate of  2 and Hence

Now Hence

It also can be shown that Thus, the maximum likelihood estimator of  2, is a biased estimator of  2. This estimator can be easily converted into an unbiased estimator of  2 by multiply by the ratio n/(n – 2)

Estimators in Linear Regression and

The major computation is :

Computing Formulae:

Application Of Statistical Theory to simple Linear Regression We will now use statistical theory to prove optimal properties of the estimators. Recall, the joint density of y 1,y 2, …,y n is:

Also and Thus all three estimators are functions of the set of complete sufficient statistics. If they are also unbiased then they are Uniform Minimum Variance Unbiased (UMVU) estimators (using the Lehmann-Scheffe theorem)

and We have already shown that s 2 is an unbiased estimator of  2. We need only show that: are unbiased estimators of  and .

Thus are unbiased estimators of  and .

Also Thus

The General Linear Model

Consider the random variable Y with 1. E[Y] =  1 X 1 +  2 X  p X p (alternatively E[Y] =  0 +  1 X  p X p, intercept included) and 2. var(Y) =  2 where  1,  2,...,  p are unknown parameters and X 1,X 2,..., X p are nonrandom variables. Assume further that Y is normally distributed.

Thus the density of Y is: f(Y|  1,  2,...,  p,  2 ) = f(Y| ,  2 )

Now suppose that n independent observations of Y, (y 1, y 2,..., y n ) are made corresponding to n sets of values of (X 1,X 2,..., X p ) - (x 11,x 12,..., x 1p ), (x 21,x 22,..., x 2p ),... (x n1,x n2,..., x np ). Then the joint density of y = (y 1, y 2,... y n ) is: f(y 1, y 2,..., y n |  1,  2,...,  p,  2 ) =

Thus is a member of the exponential family of distributions And is a Minimal Complete set of Sufficient Statistics.

Matrix-vector formulation The General Linear Model

Geometrical interpretation of the General Linear Model

Geometical interpretation of the General Linear Model

Estimation The General Linear Model

Least squares estimates of  Let

The Equations for the Least squares estimates

Written out in full These equations are called the Normal Equations

Matrix development of the Normal Equations Now The Normal Equations

Summary (the Least Squares Estimates) The Least Squares estimates satisfy The Normal Equations

Note: Some matrix properties Rank rank(AB) = min(rank(A), rank(B)) rank(A) ≤ min(# rows of A, # cols of A ) rank(A) = rank(A) Consider the normal equations

then the solution to the normal equations

Maximum Likelihood Estimation General Linear Model

The General Linear Model

The Maximum Likelihood estimates of  and  2 are the values that maximize or equivalently

This yields the system of linear equations (The Normal Equations)

yields the equation:

If [X'X] -1 exists then the normal equations have solution: and

Summary and

Comments The matrices are symmetric idempotent matrices also

Comments (continued)

Geometry of Least Squares

Example Data is collected for n = 15 cases on the variables Y (the dependent variable) and X 1, X 2, X 3 and X 4. The data and calculations are displayed on the next page:

Properties of The Maximum Likelihood Estimates Unbiasedness, Minimum Variance

Note: and Thus is an unbiased estimator of. Since is also a function of the set of complete minimal sufficient statistics, it is the UMVU estimator of. (Lehman-Scheffe)

Note: where In general

Thus: where

Thus:

Let Then Thus s 2 is an unbiased estimator of  2. Since s 2 is also a function of the set of complete minimal sufficient statistics, it is the UMVU estimator of  2.

Distributional Properties Least square Estimates (Maximum Likelidood estimates)

1.If then where A is a q × p matrix Recall ~

The General Linear Model and The Estimates

Theorem Proof

Finally and

Thus are independent. Summary

Example Data is collected for n = 15 cases on the variables Y (the dependent variable) and X 1, X 2, X 3 and X 4. The data and calculations are displayed on the next page:

Compare with SPSS output Estimates of the coefficients

The General Linear Model with an intercept

Consider the random variable Y with 1. E[Y] =  0 +  1 X 1 +  2 X  p X p (intercept included) and 2. var(Y) =  2 where  1,  2,...,  p are unknown parameters and X 1,X 2,..., X p are nonrandom variables. Assume further that Y is normally distributed.

The matrix formulation (intercept included) Then the model becomes Thus to include an intercept add an extra column of 1’s in the design matrix X and include the intercept in the parameter vector

The matrix formulation of the Simple Linear regression model

and Now

thus

Finally Thus

The Gauss-Markov Theorem An important result in the theory of Linear models Proves optimality of Least squares estimates in a more general setting

Assume the following model Linear Model We will not necessarily assume Normality. Consider the least squares estimate of is an unbiased linear estimator of

The Gauss-Markov Theorem Assume Consider the least squares estimate of, an unbiased linear estimator of and Let denote any other unbiased linear estimator of

Proof Now

Now is an unbiased estimator of if Also Thus

Thus The Gauss-Markov theorem states that is the Best Linear Unbiased Estimator (B.L.U.E.) of

Hypothesis testing for the GLM The General Linear Hypothesis

Testing the General Linear Hypotheses The General Linear Hypothesis H 0 :h 11  1 + h 12  2 + h 13  h 1p  p = h 1 h 21  1 + h 22  2 + h 23  h 2p  p = h 2... h q1  1 + h q2  2 + h q3  h qp  p = h q where h 11  h 12, h 13,..., h qp and h 1  h 2, h 3,..., h q are known coefficients. In matrix notation

Examples 1.H 0 :  1 = 0 2.H 0 :  1 = 0,  2 = 0,  3 = 0 3.H 0 :  1 =  2

Examples 4.H 0 :  1 =  2,  3 =  4 5.H 0 :  1 = 1/2(  2 +  3 ) 6.H 0 :  1 = 1/2(  2 +  3 ),  3 = 1/3(  4 +  5 +  6 )

TheLikelihood Ratio Test The joint density of is: The likelihood function The log-likelihood function

Defn (Likelihood Ratio Test of size  ) Rejects H 0 :   against the alternative hypothesis H 1 :   . when and K is chosen so that

Note We will maximize. The Lagrange multiplier technique will be used for this purpose

We will maximize.

or finally or

Thus the equations for are Now or and