Types of Regression
Types of Regression
04.10.2009
Agnieszka Prochenka
Introduction
Agnieszka Prochenka
Linear Regression
i 2 =
n
X
2
(yi xi0 )
i=1
Agnieszka Prochenka
Linear Regression
R function
lm(formula, data, subset, weights,. . . )
Agnieszka Prochenka
Linear Regression
R function
lm(formula, data, subset, weights,. . . )
However, in some conditions the linear regression doesnt work
well:
1
2
Agnieszka Prochenka
1 X
(yi xiT b)2 + P (b1 , . . . , bp )
2n
n
i=1
where
P =
p
X
1
i=1
(1
)bj2
+ |bj |
Agnieszka Prochenka
R function
W pakiecie glmnet:
glmnet(x, y, weights, alpha,nlambda, lambda.min , lambda,. . . )
glmnet$a0 ; glmnet$beta
Agnieszka Prochenka
R function
W pakiecie glmnet:
glmnet(x, y, weights, alpha,nlambda, lambda.min , lambda,. . . )
glmnet$a0 ; glmnet$beta
literature: Friedman, Hastie, Tibshirani, Regularization Paths
for Generalized Linear Models via Coordinate Descent,
Stanford University, May 2008
Agnieszka Prochenka
K-neighbors model
Agnieszka Prochenka
Robust regression
M estimator
M estimator minimizes a function:
n
X
(ei ) =
i=1
n
X
(yi xi0 )
i=1
Agnieszka Prochenka
Robust regression
M estimator
M estimator minimizes a function:
n
X
(ei ) =
i=1
n
X
(yi xi0 )
i=1
H (e) =
for |e| 6 k ;
k |e| 21 e2 , for |e| > k .
1 2
2e ,
Agnieszka Prochenka
Robust regression
Bisquare
B (e) =
3
1 1 ( ke )2
, for |e| 6 k ;
k2
6
k2
6 ,
Agnieszka Prochenka
Robust regression
R function
W pakiecie RLMM:
rlm(x, y, weights, psi = psi.huber,. . . )
Agnieszka Prochenka
Mice example p n
In this example the X matrix has dimensions n=54, p=1000 and
comes from real genetic data of mice, y was simulated.
Agnieszka Prochenka
Agnieszka Prochenka
Mice example p n
Measuring theP
goodness of fit with the mean of the squared
2 , we get:
errors RSS = ni=1 (yt i xi0 )
model
lasso
elastic net
ridge
k neighbors
RSS
3.21
2.45
2.37
165.49
Agnieszka Prochenka
My masters thesis
This is an example:
Agnieszka Prochenka
1 2 ...
1 ...
2 1 ...
... ... ... ...
Choosing
For the given data list I estimate the parameters for different
models and check which fit best (for example which minimizes
the sum of the squared loss). This is an example of what can
come out:
Agnieszka Prochenka
Agnieszka Prochenka
Agnieszka Prochenka