linear model. formal definition general linear model

16
Linear Model 0 - residual or error

Upload: alexandra-carpenter

Post on 13-Jan-2016

230 views

Category:

Documents


5 download

TRANSCRIPT

Page 1: Linear Model. Formal Definition General Linear Model

Linear Model

𝜖 𝑖

𝛽0

𝑦 𝑖

𝑥𝑖

𝛽 𝑖

- residual or error

Page 2: Linear Model. Formal Definition General Linear Model

Formal Definition

• , - observed values of covariate variables (i.e. temperature, precipitation)

• - observed value of the response variable (i.e. tree height)

• - y intercept:

Page 3: Linear Model. Formal Definition General Linear Model

General Linear Model

•  

y = 0.1983x - 0.3216R² = 0.9694

-1

0

1

2

3

4

5

6

1 2 3 4 5 6 7 8 9 1011121314151617181920212223242526

Page 4: Linear Model. Formal Definition General Linear Model

General Linear Model

• Can transform the predictor values to linearize the relationship between the predictors and the response

• Also changes the variance so it only should be done if the variance is not uniform and is made uniform by the transform

Page 5: Linear Model. Formal Definition General Linear Model

Polynomial Regression

•  

Page 6: Linear Model. Formal Definition General Linear Model

Need More

• Not all phenomenon follow linear response

• Not all residuals are normally distributed• This leads:

– GLMs: Single function, specified regression distribution

– GAMs: Multiple functions– “Non-parametric” approaches: function is

determined by the computer

Page 7: Linear Model. Formal Definition General Linear Model

GLM

• Generalized Linear Model– Not to be confused with a general linear

model• Allows a linear model to be related to the

response variable via a “Link” function. • Also requires to be from a defined

probability distribution

Page 8: Linear Model. Formal Definition General Linear Model

Generalized Linear Models

• - a random variable with some probability distribution– Related to the response values

• - error – Residuals

– Linear model without the intercept• - Expected value of

– Predicted value (no error)

Page 9: Linear Model. Formal Definition General Linear Model

Generalized Linear Models

– Linear model without the error• is a “link” function• = )• Random component is from a known

probability distribution

Page 10: Linear Model. Formal Definition General Linear Model

Common Functions in R

• Probability Distribution (Link Function)• Binomial (link = "logit")

– True/false, alive/dead• Gaussian (link = "identity")

– Continuous, normal• Gamma (link = "inverse")

– Seed distribution, distance from…• Poisson (link = "log")

– Counts

Page 11: Linear Model. Formal Definition General Linear Model

Normal Distribution

WikipediaAKA “Gaussian” Distribution

Page 12: Linear Model. Formal Definition General Linear Model

Binomial

Number of successes of yes/no experiments Wikipedia

Page 13: Linear Model. Formal Definition General Linear Model

Poisson

Number of events in time T, k=number of occurrences Wikipedia

Page 14: Linear Model. Formal Definition General Linear Model

Gamma Distribution

Wait times, seed distribution, etc. Wikipedia

Page 15: Linear Model. Formal Definition General Linear Model

Deviance

• Where:– = Maximum log-likelihood for model– = Maximum log-likelihood for the most

complex model possible (i.e. fits observed data perfectly)

Page 16: Linear Model. Formal Definition General Linear Model

Degrees of Freedom

• number of observations• number of parameters (branches)• Degrees of freedom =