Professional Documents
Culture Documents
Sudarshan Kumar
(1)
Likelihood function of Y
(,
2)
=
=1
2 2
( )2
22
( )2
2)
2)
(, = ln(2 +
2
2 2
(2)
(3)
=1
For maximization
( ) 2
=
=0
2 2
(4)
=1
# 2. Compute beta_hat
Y<-Payment
X<-Claims
beta_h<- (Y)%*%(X)/ ((X)%*%(X))
beta_h
## [1,] 5016.056
#estimate of Beta
=1
=1 2
(5)
=
=
=1
=1 2
=1 (X i + )
=1 2
(6)
=1
=1 2 =1
+
=
+
=1 2
=1 2
=1 2
We can see it clearly =1 = 0 , (it is nothing but
representation of equation 4
=
2
= =
(=1 )2
(8)
2
=1 2
( =1( )2 + =1 =1( )( ))
(7)
(9)
2
=1 2
=1 2
=1 2
(10)
=1 2
Using equation 3 :
(,
2)
( )2
= ln(2 2 ) +
2 2
2
=1
( )2
=0
2 2 2
2 4
=1
(11)
(12)
1
1
=> = ( )2 = 2
=1
=1
(Estimating by replacing )
2
=1
=1
1
1
2
2 = = 2 2 + 2 2
=1
=1
=1
(14)
1
= ( 2 2 + 2 2 )
This yield
=1
(=1 )2
1
= ( 2 2
+
2 )
2 2
=1 2
=1 =1
=1
=1
2 =
1
(
=1 2
=1
2
=1
(17)
= X i +
(18)
= ()X i +
This implies
(19)
= ()X i + 2 ()Xi
=1
=1
=1
=1
(20)
=1
=1
=1
=1
2
= 2 + 2 2 ( ) X i
2
(15)
(16)
= X i +
(13)
(21)
=
=1
2
=1 2
=1
=1
+ 2
X i = 2 + 2 2 2
=1 2
2
(22)
=1
(23)
2 = ( 1) 2
=1
(24)
2
=1
is biased
R code for b, c, d
Q1.b C and D standard error of regression and coefficient
e<- Y- beta_h * X
ESS<- t(e)%*%e #error sum of squares
ESS
##
[,1]
## [1,] 2.073899e+13
sigma2_hat<- ESS/(2182-1) #standard error of regression
sigma2_hat
##
[,1]
## [1,] 9508935471
SE_hat = sqrt(sigma2_hat)
# SD for beta hat
SD_beta_hat<- sqrt(sigma2_hat/(t(X)%*%(X)))
SD_beta_hat
##
[,1]
## [1,] 10.02538
MLEsigma2_hat=ESS/(2182)
MLEsigma2_hat
#MLE estimate of standard error of regression
##
[,1]
## [1,] 9504577572
= ,
(25)
=1
2
= (
)
=1 2
=1 2
Rcode
Q1.E 95 % confidence interval of Beta
LB=beta_h-1.96*SD_beta_hat
UB=beta_h+1.96*SD_beta_hat
LB
##
[,1]
## [1,] 4996.406
UB
##
[,1]
## [1,] 5035.705
=> =
Hence if we create a new variable distance *claim then its a normal linear regression model
R code for model formulation
(26)
newdata=Claims*Kilometres
X=newdata
reg=lm(Y~X+0)
summary(reg)
##
##
##
##
##
##
##
##
##
##
##
##
##
##
##
##
##
Call:
lm(formula = Y ~ X + 0)
Residuals:
Min
1Q
-4854422
-19780
Median
0
3Q
10879
Max
9436080
Coefficients:
Estimate Std. Error t value Pr(>|t|)
X 2109.22
20.55
102.6
<2e-16 ***
--Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 434600 on 2181 degrees of freedom
Multiple R-squared: 0.8285, Adjusted R-squared: 0.8284
F-statistic: 1.053e+04 on 1 and 2181 DF, p-value: < 2.2e-16