Docsity

Classical Regression with Model Selection: Understanding the Principles and Techniques - P, Assignments of Statistics

Toggle sidebar
bg1
STA 6857—Introduction to Chapter 2 and Classical
Regression with Model Selection (§2.1, 2.2)
Classical Regression in the Time Series Context (§1.2) Model Selection Homework 2b
Outline
1Classical Regression in the Time Series Context (§1.2)
2Model Selection
3Homework 2b
Arthur Berg STA6857—Introduction to Chapter 2 and Classical Regression with Model Selection (§2.1, 2.2) 2/ 19
Classical Regression in the Time Series Context (§1.2) Model Selection Homework 2b
Linear Regression Model
Definition (Classical Linear Regression Model)
The model
xt=β1zt1+β2zt2+· ·· +βqztq +wt
where zt1,zt1,...,ztq are known, β1, β2, . . . , βqare unknown fixed
regression coefficients, and wt
iid
∼ N(0, σ2)is called the classical linear
regression model.
Assumptions to be relaxed:
Normality of the error process (wt)
Independence of the errors
Knowledge of the appropriate inputs zt1,zt1,...,ztq — Model
selection
Arthur Berg STA6857—Introduction to Chapter 2 and Classical Regression with Model Selection (§2.1, 2.2) 4/ 19
Classical Regression in the Time Series Context (§1.2) Model Selection Homework 2b
Estimating a Trend
The most standard linear regression model is simply fitting a line:
xt=β1+β2t+wt
i.e. q=2, zt1=1, and zt2=t.
Example (Global Warming???)
ˆ
xt=−12.186 +.006t
Arthur Berg STA6857—Introduction to Chapter 2 and Classical Regression with Model Selection (§2.1, 2.2) 5/ 19
pf3
pf4

Partial preview of the text

Download Classical Regression with Model Selection: Understanding the Principles and Techniques - P and more Assignments Statistics in PDF only on Docsity!

STA 6857—Introduction to Chapter 2 and Classical

Regression with Model Selection (§2.1, 2.2)

Classical Regression in the Time Series Context (§1.2) Model Selection Homework 2b

Outline

(^1) Classical Regression in the Time Series Context (§1.2)

(^2) Model Selection

(^3) Homework 2b

Arthur Berg STA 6857—Introduction to Chapter 2 and Classical Regression with Model Selection (§2.1, 2.2) 2/ 19

Classical Regression in the Time Series Context (§1.2) Model Selection Homework 2b

Linear Regression Model

Definition (Classical Linear Regression Model)

The model

xt = β 1 zt 1 + β 2 zt 2 + · · · + βq ztq + wt

where zt 1 , zt 1 ,... , ztq are known, β 1 , β 2 ,... , βq are unknown fixed

regression coefficients, and wt

iid ∼ N ( 0 , σ

2 ) is called the classical linear

regression model.

Assumptions to be relaxed:

Normality of the error process (wt )

Independence of the errors

Knowledge of the appropriate inputs zt 1 , zt 1 ,... , ztq — Model

selection

Classical Regression in the Time Series Context (§1.2) Model Selection Homework 2b

Estimating a Trend

The most standard linear regression model is simply fitting a line:

xt = β 1 + β 2 t + wt

i.e. q = 2, zt 1 = 1, and zt 2 = t.

Example (Global Warming???)

x^ ˆt = − 12. 186 +. 006 t

R Code

globtemp = ts(scan("mydata/globtemp.dat"), start=1856)

Read 142 items

gtemp=window(globtemp, start=1900) fit = lm(gtemp~time(gtemp), na.action=NULL)

summary(fit)

Call:

lm(formula = gtemp ~ time(gtemp), na.action = NULL)

Residuals:

Min 1Q Median 3Q Max

-0.30352 -0.09671 0.01132 0.08289 0.

Coefficients:

Estimate Std. Error t value Pr(>|t|)

(Intercept) -1.219e+01 9.032e-01 -13.49 <2e-16 ***

time(gtemp) 6.209e-03 4.635e-04 13.40 <2e-16 ***


Signif. codes: 0 ’’ 0.001 ’’ 0.01 ’’ 0.05 ’.’ 0.1 ’ ’ 1

Residual standard error: 0.1298 on 96 degrees of freedom

Multiple R-Squared: 0.6515, Adjusted R-squared: 0.

F-statistic: 179.5 on 1 and 96 DF, p-value: < 2.2e-

Arthur Berg STA 6857—Introduction to Chapter 2 and Classical Regression with Model Selection (§2.1, 2.2) 6/ 19

R Code II

plot(gtemp, type="o", ylab="Global Temperature Deviation")

abline(fit)

plot(fit$res)

Arthur Berg STA 6857—Introduction to Chapter 2 and Classical Regression with Model Selection (§2.1, 2.2) 7/ 19

Classical Regression in the Time Series Context (§1.2) Model Selection Homework 2b

Minimize Residual Sum of Squares (RSS)

The basic principle behind linear regression is the minimization of the

residual sum of squares — minimizing the sum of squared residuals.

RSS =

∑^ n

t= 1

(xt − β 1 zt 1 − β 2 zt 2 − · · · − βq ztq )

2

︸ ︷︷ ︸

residuals^2

This is just a calculus problem where differentiation is used to

minimize the RSS function over the different β’s.

Vector differentiation is required in this case, so we will omit the

derivation of the minimization of (?).

Classical Regression in the Time Series Context (§1.2) Model Selection Homework 2b

Matrix Representation of Linear Regression

From the general model

xt = β 1 zt 1 + β 2 zt 2 + · · · + βq ztq + wt

for t = 1 ,... , n, we derive the equations

   

x 1 = β 1 z 11 + β 2 z 12 + · · · + βq z 1 q + w 1

x 2 = β 1 z 21 + β 2 z 22 + · · · + βq z 2 q + w 2

. . .

xn = β 1 zn 1 + β 2 zn 2 + · · · + βq znq + wn

x 1

x 2

. . .

xn

x

z 11 z 12 · · · z 1 q

z 21 z 22 · · · z 2 q

..................

zn 1 zn 2 · · · znq

Z

β 1

β 2

. . .

βq

β

w 1

w 2

. . .

wn

w

The F Distribution

Derived by George Snedecor (1881 – 1974)

Named in honor of Sir Ronald Fisher (1890 – 1962)

Arthur Berg STA 6857—Introduction to Chapter 2 and Classical Regression with Model Selection (§2.1, 2.2) 15/ 19

Model Selection with the F-Statistic

Forward Step — Start with a minimal model. Increase the model by

adding in the variable which produces the largest F-statistic. Repeat

until the no additional variable added produces a significant F-statistic.

Backward Step — Start with a full model. Decrease the model by

removing the variable which gives the smallest contribution. Repeat

until all remaining variables are significant.

Forward/Backward Step — Increase the model by adding in the

variable which produces the largest F-statistic. Decrease the model

by removing weakest variable as long as its contribution is not

significant. Repeat until the no additional variables added produces

a significant F-statistic and all variables in the model are significant.

Example

Minimal Model: xt = β 1 + wt

Complete Model: xt = β 1 + β 2 t + β 3 t^2 + β 4 sin t + wt

Use the above procedures to find a model in between the minimal and complete models like:

xt = β 1 + β 4 sin t + wt.

Arthur Berg STA 6857—Introduction to Chapter 2 and Classical Regression with Model Selection (§2.1, 2.2) 16/ 19

Classical Regression in the Time Series Context (§1.2) Model Selection Homework 2b

Textbook Reading

Read the following sections from the textbook

§2.3 (Exploratory Data Analysis)

Classical Regression in the Time Series Context (§1.2) Model Selection Homework 2b

Textbook Problems

Do the following exercises from the textbook