heavyLm: (Multivariate) linear regression under heavy-tailed...

Description Usage Arguments Details Value References Examples

View source: R/lm.R

Description

This function is used to fit linear models considering heavy-tailed errors. It can be used to carry out univariate or multivariate regression.

Usage

1
2
heavyLm(formula, data, family = Student(df = 4), subset, na.action,
  control, model = TRUE, x = FALSE, y = FALSE, contrasts = NULL)

Arguments

formula

an object of class "formula": a symbolic description of the model to be fitted.

data

an optional data frame containing the variables in the model. If not found in data, the variables are taken from environment(formula), typically the environment from which heavyLm is called.

family

a description of the error distribution to be used in the model. By default the Student-t distribution with 4 degrees of freedom is considered.

subset

an optional expression indicating the subset of the rows of data that should be used in the fitting process.

na.action

a function that indicates what should happen when the data contain NAs.

control

a list of control values for the estimation algorithm to replace the default values returned by the function heavy.control.

model, x, y

logicals. If TRUE the corresponding components of the fit (the model frame, the model matrix, the response) are returned.

contrasts

an optional list. See the contrasts.arg of model.matrix.default.

Details

Models for heavyLm are specified symbolically (for additional information see the "Details" section from lm function). If response is a matrix, then a multivariate linear model is fitted.

Value

An object of class "heavyLm" or "heavyMLm" for multiple responses which represents the fitted model. Generic functions print and summary, show the results of the fit.

The following components must be included in a legitimate "heavyLm" object.

call

a list containing an image of the heavyLm call that produced the object.

family

the heavy.family object used, with the estimated shape parameters (if requested).

coefficients

final estimate of the coefficients vector.

sigma2

final scale estimate of the random error (only available for univariate regression models).

Sigma

estimate of scatter matrix for each row of the response matrix (only available for objects of class "heavyMLm").

fitted.values

the fitted mean values.

residuals

the residuals, that is response minus fitted values.

logLik

the log-likelihood at convergence.

numIter

the number of iterations used in the iterative algorithm.

weights

estimated weights corresponding to the assumed heavy-tailed distribution.

distances

squared of scaled residuals or Mahalanobis distances.

acov

asymptotic covariance matrix of the coefficients estimates.

References

Dempster, A.P., Laird, N.M., and Rubin, D.B. (1980). Iteratively reweighted least squares for linear regression when errors are Normal/Independent distributed. In P.R. Krishnaiah (Ed.), Multivariate Analysis V, p. 35-57. North-Holland.

Lange, K., and Sinsheimer, J.S. (1993). Normal/Independent distributions and their applications in robust regression. Journal of Computational and Graphical Statistics 2, 175-198.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# univariate linear regression
data(ereturns)
fit <- heavyLm(m.marietta ~ CRSP, data = ereturns, family = Student(df = 5))
summary(fit)

# multivariate linear regression
data(dialyzer)
fit <- heavyLm(cbind(y1,y2,y3,y4) ~ -1 + centre, data = dialyzer, family = slash(df = 4))
fit

# fixing the degrees of freedom at df = 5
fit <- heavyLm(m.marietta ~ CRSP, data = ereturns, family = Student(df = 5),
  control = heavy.control(fix.shape = TRUE))
summary(fit)

Example output

Linear model under heavy-tailed distributions
 Data: ereturns; Family: Student(df = 2.83727) 

Residuals:
      Min        1Q    Median        3Q       Max 
-0.142237 -0.036156  0.003433  0.041310  0.546533 

Coefficients:
             Estimate Std.Error Z value p-value
(Intercept) -0.0072   0.0082   -0.8876  0.3748
CRSP         1.2637   0.1902    6.6459  0.0000

Degrees of freedom: 60 total; 58 residual
Scale estimate: 0.002520786
Log-likelihood: 71.81295 on 3 degrees of freedom
Call:
heavyLm(formula = cbind(y1, y2, y3, y4) ~ -1 + centre, data = dialyzer, 
    family = slash(df = 1.2294))
Converged in 71 iterations

Coefficients:
         y1        y2        y3        y4       
centre1  540.0177  971.5955 1404.2510 1876.3671
centre2  464.4656  845.0920 1259.5509 1683.8693
centre3  590.9750  856.7526 1273.4876 1660.6286

Degrees of freedom: 40 total; 37 residual
Linear model under heavy-tailed distributions
 Data: ereturns; Family: Student(df = 5) 

Residuals:
      Min        1Q    Median        3Q       Max 
-0.144574 -0.037252  0.002193  0.041296  0.542015 

Coefficients:
             Estimate Std.Error Z value p-value
(Intercept) -0.0064   0.0086   -0.7475  0.4547
CRSP         1.2951   0.2000    6.4747  0.0000

Degrees of freedom: 60 total; 58 residual
Scale estimate: 0.003182504
Log-likelihood: 70.75718 on 3 degrees of freedom

heavy documentation built on Oct. 30, 2019, 9:48 a.m.

Related to heavyLm in heavy...