workshop 10 4 generalized linear models
play

Workshop 10.4: Generalized linear models Murray Logan 16 Aug 2016 - PowerPoint PPT Presentation

Workshop 10.4: Generalized linear models Murray Logan 16 Aug 2016 Linear models Homogeneity of variance 2 . 0 0 . . 2 0 . 2 ) y i = 0 + 1 x i + i i N ( 0 , . V =


  1. Workshop 10.4: Generalized linear models Murray Logan 16 Aug 2016

  2. Linear models Homogeneity of variance   σ 2 . 0 0 ··· . .  σ 2  0 . ··· σ 2 )   y i = β 0 + β 1 × x i + ε i ε i ∼ N ( 0 , . V = cov = . . .   . . σ 2 � �� � � �� �  . .  ··· Linearity Normality σ 2 0 . ··· ··· Zero covariance (=independence) . . .

  3. Other data types • Binary - only 0 and 1 (dead/alive) (present/absent) • Proportional abundance - range from 0 to 100 • Count data - min of zero

  4. Linear models 12 a) b) Present 1.0 ● ● ● ● ● ● ● ● ● 10 Predicted probability 0.8 of presence 8 Frequency 0.6 6 0.4 4 0.2 Absent 2 ● ● ● ● ● ● ● ● ● ● ● 0.0 0 0.0 0.4 0.8 X • expected values outside logical bounds • response not normally distributed

  5. Logistic models 12 b) b) Present 1.0 ● ● ● ● ● ● ● ● ● 10 0.8 8 Frequency 0.6 6 0.4 4 0.2 Absent 2 0.0 ● ● ● ● ● ● ● ● ● ● ● 0 0.0 0.4 0.8 X • expected values outside logical bounds • response not normally distributed

  6. Section 1 Exponential family distributions

  7. Gaussian distribution Virtually unbound measurements (weight, lengths etc) Probability density function Cumulative density function µ = 25, σ 2 = 5 µ = 25, σ 2 = 2 µ = 10, σ 2 = 2 0 5 10 15 20 25 30 35 40 0 5 10 15 20 25 30 35 40 2 σ 2 π e − ( x − µ )2 1 f ( x | µ , σ 2 ) = 2 σ 2 √

  8. Binomial distribution Presence/absence and data bound to the range [0,1] Probability density function Cumulative density function n = 50 n = 20 n = 3 0 5 10 15 20 25 30 35 40 0 5 10 15 20 25 30 35 40 ( n ) p k (1 − p ) n − k f ( k | n , p ) = p

  9. Poisson distribution Count data (or count derivatives - like low densities) Probability density function Cumulative density function λ = 25 λ = 15 λ = 3 0 5 10 15 20 25 30 35 40 0 5 10 15 20 25 30 35 40 f ( x | λ ) = e − λ λ x x !

  10. Negative Binomial Count data (or count derivatives - like low densities) Probability density function Cumulative density function n = 25 n = 10 n = 1.5 0 5 10 15 20 25 30 35 40 0 5 10 15 20 25 30 35 40 µ x ω ω f ( x | µ , ω ) = Γ( x + ω ) Γ( ω ) x ! × ( µ + ω ) µ + ω

  11. General linear models Homogeneity of variance   σ 2 . 0 0 ··· . .  σ 2  0 . ··· σ 2 )   y i = β 0 + β 1 × x i + ε i ε i ∼ N ( 0 , . V = cov = .  . .  . . σ 2 � �� � � �� �  . .  ··· Linearity Normality σ 2 . 0 ··· ··· Zero covariance (=independence) . . . E ( Y ) = β 0 + β 1 x 1 + ... + β p x p + ε , ε ∼ Dist ( ... ) ���� � �� � Link function Systematic

  12. General linear models E ( Y ) = β 0 + β 1 x 1 + ... + β p x p + e ���� ���� � �� � Random Link function Systematic • Random component. E ( Y i ) ∼ N ( µ i , σ 2 ) A nominated distribution (Gaussian, Poisson, Binomial, Gamma, Beta,฀)

  13. General linear models E ( Y ) = β 0 + β 1 x 1 + ... + β p x p + e ���� ���� � �� � Random Link function Systematic • Random component. • Systematic component β 0 + β 1 x 1 + ... + β p x p • Link function

  14. Generalized linear models Response variable Probability Distribu- Link function Model name tion Continuous Gaussian identiy: Linear regression measurements µ Binary,proportions Binomial logit: Logistic regression ( ) π log 1 − π probit: Probit regression ∫ α + β . X ( 2 Z 2 ) 1 − 1 exp dZ √ 2 π −∞ complimentary: Logistic regression log ( − log (1 − π )) Quasi-binomial logit: Logistic regression ( ) π log 1 − π Counts Poisson log: Poisson regression / log- log µ linear model Negative binomial Negative binomial ( ) µ log µ − θ regression Quasi- log: Poisson regression poisson log µ

  15. OLS Parameter estimates 6 8 10 12 14 Sum of squares µ =10 ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● 6 8 10 12 14 Parameter estimates

  16. Maximum Likelihood 2 σ 2 π e − ( x − µ )2 1 f ( x | µ , σ 2 ) = 2 σ 2 √ 2 ln σ 2 − ∑ 2 ln L ( µ , σ 2 ) = − n 2 ln (2 π ) − n 1 i =1 ( x i − µ ) 2 2 σ 2 Maximum likelihood estimates: ∑ n x = 1 µ = ¯ ˆ i =1 x i n σ 2 = 1 ∑ n x ) 2 ˆ i =1 ( x i − ¯ n

  17. Maximum Likelihood Parameter estimates 6 8 10 12 14 Log−likelihood µ =10 ● ● ● ● ● 6 6 6 8 8 8 10 10 10 12 12 12 14 14 14 Parameter estimates

Recommend


More recommend