Download as pdf or txt
Download as pdf or txt
You are on page 1of 45

Econometrics for Actuary

Minh Nguyen

NEU - Faculty of Mathematical Economics

Ngày 27 tháng 9 năm 2021

1 / 45
COURSE CONTENTS

1. CATEGORICAL DEPENDENT VARIABLES (4)


2. GENERALIZED LINEAR MODELS (2)

3. NON-STATIONARY TIME SERIES (1)

4. ARIMA MODELS (2)

5. ARCH – GARCH MODELS(2)

2 / 45
Session 0: Review Econometrics I

I Want to see the impact of X on y



d = 0.5 − 0.1price + 0.2income; R 2 = 0.82
 sale

0.01 0.02 0.03



P
I Assumptions

I Steps: (theory,data, visualization) =


⇒ run =
⇒ diagnose =
⇒ use

3 / 45
Session 0: Review Econometrics I

I Example:

I lnsale
\ = 0.5 − 0.1hhsize + 0.2lnincome

d = 0.5 + 0.1income − 0.02income 2 ;


I sale

I sale
d = 0.5 + 0.15income + 0.1female

I How good: R 2 , s 2 , predicted error.

4 / 45
Session 0: Assumptions

I F1. E (y |X ) = X β

I F2. x1 , .., xn non-stochastic variables

I F3. V (yi |Xi ) = σ 2

I F4. yi random variable, independent

I F5. yi normally distributed

I Then OLS estimators will be the best: unbiased, smallest


variance.

5 / 45
Section 1: Categorical dependent variables - Ch11

1.1 Binary dependent variables

1.2 Logistic and Probit regression models

1.3 Inference for Logistic model

1.4 Nominal dependent variables

1.5 Ordinal dependent variables

6 / 45
1.1 Binary dependent variables (1)

I Interested in whether or not a person hires an attorney when


claiming

 1 if the person hires an attorney

I y=
 0 otherwise

I y: the dependent variable.

I Interested in pi = P(y = 1|x = xi )

I Also have: E (y |x = xi ) = 1.p(y = 1|xi ) + 0p(y = 0|xi ) = pi

I We can write: E (y |xi ) = pi = β0 + β1 lossi

I Linear probability model

7 / 45
1.1 Binary dependent variables (2)

I E (y |x) = p = β0 + β1 loss

I Drawbacks of the Linear probability model:

I RHS may be > 1 or < 0 - due to the linearity property

I y does not follow a Normal distribution

I y = {0; 1}, hence residual analysis is meaningless

I Think of non-linear models

8 / 45
1.2 Logistic regression models (1)

e β0 +β1 loss
I p=
1 + e β0 +β1 loss
I The RHS is in between (0,1)

I It is non-linear
e β0 +β1 x1 +..βk xk eX β
I p= =
1 + e β0 +β1 x1 +..βk xk 1 + eX β
I Logit model

I Meaning of βj ?

9 / 45
1.2 Logistic regression models: example (2)

exp −1+0.38
At loss = 10, P(y = 1) = = 0.35
1 + exp −1+0.38

10 / 45
1.2 Logistic regression models: marginal effect (3)

I Q: Calculate marginal impact of loss

e β0 +β1 los+
I p=
1 + e β0 +β1 loss
I Marginal effect of loss:

∂p
I = p(1 − p)β1
∂loss
I Marginal impact is not a constant

I ∂p = p(1 − p)β1 ∂loss

11 / 45
1.2 Logistic regression models: marginal effect (4)

exp −1+0.38
At loss = 10, P(y = 1) = = 0.35
1 + exp −1+0.38
At loss = 10, if loss ⇑ by one, P(y = 1) ⇑
0.35(1 − 0.35)(−0.1) = −0.02
At loss = 10, if loss ⇑ by m, P(y = 1) ⇑
0.35(1 − 0.35)(−0.1)m = −0.02

12 / 45
1.2 Logistic regression models: odd ratio (5)

p
I odd = = e β0 +β1 loss
1−p
I Meaning of the odd:
p
I ln(odd) = ln( ) = β0 + β1 loss
1−p
I If loss ⇑ 1 unit, ln(odd) ⇑ by β1 unit, odd ⇑ by e1β times

I ln(oddn ) = ln(oddo ) + β1

13 / 45
1.2 Logistic regression models: odd ratio (5)

p
I odd = = e β0 +β1 loss
1−p
I Meaning of the odd:
p
I ln(odd) = ln( ) = β0 + β1 loss
1−p
I If loss ⇑ 1 unit, ln(odd) ⇑ by β1 unit, odd ⇑ by e1β times
oddn
I ln(oddn ) = ln(oddo ) + β1 ; = ⇒ ln( ) = β1 ;
oddo

14 / 45
1.2 Logistic regression models: odd ratio (5)

p
I odd = = e β0 +β1 loss
1−p
I Meaning of the odd:
p
I ln(odd) = ln( ) = β0 + β1 loss
1−p
I If loss ⇑ 1 unit, ln(odd) ⇑ by β1 unit, odd ⇑ by e1β times
oddn
I ln(oddn ) = ln(oddo ) + β1 ; = ⇒ ln( ) = β1 ; ;
oddo
oddn

= = e β1 ;
oddo

15 / 45
1.2 Logistic regression models: odd ratio (5)

p
I odd = = e β0 +β1 loss
1−p
I Meaning of the odd:
p
I ln(odd) = ln( ) = β0 + β1 loss
1−p
I If loss ⇑ 1 unit, ln(odd) ⇑ by β1 unit, odd ⇑ by e1β times
oddn
I ln(oddn ) = ln(oddo ) + β1 ; = ⇒ ln( ) = β1 ; ;
oddo
oddn

= ⇒ oddn = e β1 oddo
= e β1 ; =
oddo
I odd ⇑ e β1 times

16 / 45
1.2 Logistic regression models: example 6

I If loss increases by one unit , the ln(odd) of hiring vs not


hiring decreases by 0.01

I Or the odd decreases by 0.9 time

17 / 45
1.3 Estimation and Inference: the b
I Use ML method 
 1 − pi

if yi =0
I Likelihood of i-th observation: ;
if yi =1

p
i

 ln(1 − pi ) if yi =0

I or loglikelihood
if yi =1

 lnp
i
I Or: LLi = yi ln(pi ) + (1 − yi )ln(1 − pi )
I Given a (independent) data set {(y1 , x1 ), .., (yn , xn )}
I L(data) = LL1 × LL2 ... × LLn =
Pn
i=1 yi lnpi + (1 − yi )ln(1 − pi ) = LL(β)

I Find bj that maximizes the LL


18 / 45
1.3 Estimation and Inference: var (b)

0
I I (b) =
P
i pi (1 − pi )xi xi : Information matrix (estimated)

I (second derivative of the LL w.r.t β)

I var (b) = I (b)−1

I MLE: consistent, asymptotically normal, asym. efficient

19 / 45
1.3 Estimation and Inference: pseudo R 2

I Goodness of fit:

LL(bmodel )
I McFadden pseudoR 2 = 1 − :
LL(null)

LL(bmodel ) − Lnull
I pseudo − R 2 =
LLmax − LLnull

20 / 45
1.3 Estimation and Inference: the whole model

I Overall fit test: The log likelihood ratio test

I H0 : β = 0 vs H0 : β 6= 0;

I LRT = 2(LL(bmodel ) − LLnull )

I LLnull the log-likelihood without any x

I If H0 is true, LRT follows a χ2 (k).

I If P-value of LRTob is small, then reject H0

21 / 45
1.3-1 Use of the result

I Predict the p = P(y = 1|X ) given x

I Estimate marginal contribution of x on p


∂p
I = p(1 − p)βj
∂xj
∂p
I |x ,..,x = pi (1 − pi )βj
∂xj 1,i k,i
I The MC of xj on p depends on the value of all x1,i , .., xk,i

I Often calculate at some points or at means

22 / 45
1.3-2 Practice with R

I Data set = autobi

I Command: glm(y ∼ x1, data = dataset, family = ”binomial”)

I Read again all the main components: coefficients, likelihood,


null-likelihood, pseudo R 2

I CI, LRT test

I Command:
glm(y ∼ x1 + x2, data = dataset, family = ”binomial”)

23 / 45
1.3-3 Tutorial 1
Using "autobi" data set. Regress a logistic regression with
"attorney" as the y, marital status and loss as x.

1. Are marital status and loss statistically significant?

2. If the signs are as expected?

3. Predict the values of P(y =1) for each observation

4. Predict P(y=1) at marital = 1, loss = 8 using R commands

5. Retrieve McFadden R 2

6. What is Likelihood of the model, of the Null model?

7. Conduct the Likelihood ratio test to see if the model is


statistically significant.
24 / 45
1.3-4 Model testing - evaluation (1)

I Q: is the function form appropriate?

25 / 45
1.3-4 Model testing - evaluation (1)

I Q: is the function form appropriate? Use linktest

I Idea of the linktest: if the model is appropriate, "other


variables" would be not significant if added in.

I Other variables: X 2 ; Xi × Xj

I Step1: estimate the model, get hat = Xb

I Step2: estimate model Y on hat, hat 2

I Step3: if coeff on hat 2 is not significant, the model is


appropriate.

26 / 45
1.3-5 Model testing - evaluation (2)

I If the model is good enough

I Compare the actual value and predicted value of y

I Step1: predict p

I Step2: translate the p into yes/no

I Step3: check the number of correct yes and correct no

27 / 45
1.2* Probit model

I Model P(y = 1|x) = F (X β)

I Command: glm(formula = ATTORNEY LOSS, family =


(binomial(link = "probit")), data = autobi)

28 / 45
1.2* Probit model- practice

I Compare b from the two models

I Compare p-hat from the two models

I Compare yes-no table from the two models

29 / 45
1.4 Nominal dependent variable - Multinomial logit model

I Situation: Different packages in insurance, A, B and C

I P(Yi = 1|X ) = Pi,1 , P(Yi = 2|X ) = Pi,2 ; P(Yi = 3|X ) = Pi,3

I Multinomial logit model

I C choice; P(Yi = c|X ) = Pi,c


e Xi,c βc
I Pi,c = P(Yi = c|X ) =
e Xi,1 β1 + ... + e Xi,C βC
Pi,c
I oddi,c = ; ln(oddi,c ) = X βc
Pi,1

30 / 45
1.5 Ordinal dependent variable - ordinal logit model

I Situation:
 Different J choices, can be ranked as 1,2„ C
1 1
P(y = 1|X ) = −

i

1 + e −α1 +X β 1 + e −α0 +X β





 1 1
 P(yi = 2|X ) =
 −
1 + e −α2 +X β 1 + e −α1 +X β




 ..



 P(yi = C |X ) = 1 1


1 + e −αC +X β 1 + e −αJ−1 +X β
I In which α0 = −∞ ≤ α1 ≤ .. ≤ αC = ∞
P(yi ≤ s)
I oddi (s) := = exp −(−αs +X β)
P(yi > s)
I Ordered logit model

I ln(odd(j)) = αj + β1 X1 + .. + βk Xk

31 / 45
Section 2: GLM models - Ch12

2.1 Introduction

2.2 GLM models - distributions

2.3 GLM models - link functions

2.4 Estimation

2.5 Assumption revise

2.6 Goodness of fit

32 / 45
2.1 Introduction

I Linear regression model: E (y |X ) = µ = β0 + β1 x1 + .. + βk xk

I Linear (the RHS)

I y: normally distributed

I We generalize two aspects

I (1) Not just µ, but a function of it: g (µ)

I (2) y may not be N distributed

33 / 45
2.2 GLM - Linear exponential family distribution

y θ − b(θ)
I Definition: f (y , θ, Φ) = exp( + S(y , Φ))
Φ
I y: dependent variable

I θ: parameter of interest

I Φ scale parameter

I y: can be discrete, continuous or mixed.

34 / 45
2.2 GLM - Linear exponential family distribution

y θ − b(θ)
I Definition: f (y , θ, Φ) = exp( + S(y , Φ))
Φ
I Check with Normal distribution
2 1 (y − µ)2 )
I f (y , µ, σ ) = √ exp(−
2πσ 2 2σ 2
1 y 2 − 2y µ + µ2
I =√ exp(− )
2πσ 2 2σ 2
y µ − 0.5µ2 y2 2 ))
I = exp( − − 0.5ln(2πσ
σ2 2σ 2
I Hence,
y2
θ = µ, Φ = σ , b(θ) = 0.5θ , S(y , Φ) = 2 + 0.5ln(2πσ 2 )
2 2

I Normal distribution belongs the family

35 / 45
2.2 GLM - Linear exponential family distribution

I N(µ, σ 2 ); Gamma distribution, Exponential distribution,

I Bernoulli, Binomial, Poisson distribution, ..

I For each distribution, b(.), S(.) are given.

36 / 45
2.2 GLM - Linear exponential family distribution

I Mean E (y ) = b 0 (θ)

I Variance V (y ) = Φb 00 (θ)

I Example, if y ∼ N(µ, σ 2 ), then θ = µ; Φ = σ 2 , b(θ) = 0.5θ2

I Then E (y ) = θ = µ

I Var (y ) = Φ × 1 = σ 2

37 / 45
2.3 GLM - Link functions (1)

I LM: E (y |X ) = µ = X β.

I GLM: replace µ by g(.) function:

I g (µ) = X β

I g(.) the link function


µ
I g(.) could be: I (µ); ln(µ); ln( ) etc..
1−µ
I Inverse link function: µ = g (−1) (X β) = g (−1) (η)

38 / 45
2.3 GLM - Canonical Link functions (2)


 µ = b 0 (θ)

I We have
 µ = g (−1) (η)

I Canonical link functions: g (.) = b 0 (.)(−1)

39 / 45
2.3 GLM - Canonical Link functions (3)

I Canonical link functions: g (.) = b 0 (.)(−1)

I With N(µ, σ 2 ) : b(θ) = 0.5θ2 ; b 0 (θ) = θ

⇒ b 0 (.): identity function; Hence, Inverse of b 0 (.): identity


I =
function

I g (µ) = µ

I Check with Bernoulli distribution? (do it yourself)

40 / 45
2.3 GLM - Canonical Link functions (4)

Distribution Mean function b 0 (θ) Canonical link g (µ)


Normal θ µ
eθ µ
Bernoulli logit(µ) = ln( )
1 + eθ 1−µ
Poisson eθ ln(µ)

41 / 45
2.4 GLM - Estimation (1)

I Model: g (µ) = X β
y θ − b(θ)
I Distribution: f (y , θ, Φ) = exp( + S(y , Φ))
Φ
I With canonical link, we have: θ = η = X β
yX β − b(X β)
I So: f (y , θ, Φ) = exp( + S(y , Φ))
Φ
I Use MLE

42 / 45
2.4 GLM - Estimation (2)

Distribution Mean Variance


Bernoulli p p(1-p)
p(1 − p)
Binomial np
n
Poisson E(y) = λ V(y) = λ
Normal µ σ2
I Relation between the mean and the variance

43 / 45
2.5 GLM - Assumption revise

LM GLM
E (y ) = X β g (µ) = X β
X: non-stochastic Same
V (yi ) = σ 2 Not required
{yi }: independent Same
{yi } ∼ N(µ, σ 2 ) Linear exponential family

44 / 45
2.6 GLM - goodness of fit

I Null model: one parameter to be estimated

I Saturated model: n parameter to be estimated

I Deviance: the lower the better

45 / 45

You might also like