Package 'robustsur'

Title: Robust Estimation for Seemingly Unrelated Regression Models
Description: Data sets are often corrupted by outliers. When data are multivariate outliers can be classified as case-wise or cell-wise. The latters are particularly challenge to handle. We implement a robust estimation procedure for Seemingly Unrelated Regression Models which is able to cope well with both type of outliers. Giovanni Saraceno, Fatemah Alqallaf, Claudio Agostinelli (2021) <arXiv:2107.00975>.
Authors: Claudio Agostinelli [aut, cre] , Giovanni Saraceno [aut]
Maintainer: Claudio Agostinelli <[email protected]>
License: GPL (>= 2)
Version: 0.0-7
Built: 2025-01-15 04:25:08 UTC
Source: https://github.com/cran/robustsur

Help Index


Spectral Decomposition of a kronecker product of a matrix with an identity matrix

Description

Computes eigenvalues and eigenvectors of the kronecker product of a matrix with an identity matrix.

Usage

eigenkronecker(x, n)

Arguments

x

a numeric or complex symmetric matrix whose spectral decomposition is to be computed. Logical matrices are coerced to numeric.

n

dimension of the identity matrix.

Details

Only symmetric matrices are considered.

Value

The spectral decomposition of kronecher product between x and an identity matrix of dimesion n is returned as a list with components

values

a vector containing the eigenvalues.

vectors

a matrix whose columns contain the eigenvectors.

Author(s)

Claudio Agostinelli and Giovanni Saraceno

References

R.A. Horn and C.R. Johnson (1994) Topics in Matrix Analysis, Cambridge University Press. Theorem 4.2.12.

See Also

eigen and kronecker.

Examples

eigenkronecker(x=cbind(c(1,-1), c(-1,1)), n=2)

Summary of surerob estimation

Description

These functions create and print summary results of the estimated equation system.

Usage

## S3 method for class 'surerob'
summary(object, residCov=TRUE, equations=TRUE, ...)
## S3 method for class 'summary.surerob'
print(x, digits=max(3, getOption("digits")-1),
   residCov=x$printResidCov, equations=x$printEquations, ...)

Arguments

object

an object of class surerob.

x

an object of class summary.surerob.

residCov

logical. If TRUE, the residual correlation matrix, the residual covariance matrix, and its determinant are printed.

equations

logical. If TRUE, summary results of each equation are printed. If FALSE, just the coefficients are printed.

digits

number of digits to print.

...

not yet used.

Value

Applying summary on an object of class surerob returns a list of class summary.surerob. An object of class summary.surerob contains all results that belong to the whole system. This list contains one special object: eq. This is a list and contains objects of class summary.lmrob. These objects contain the results that belong to each of the estimated equations.

The objects of classes summary.surerob have the following components

method

estimation method.

residuals

residuals.

residCovEst

residual covariance matrix used for estimation.

residCov

estimated residual covariance matrix.

residCor

correlation matrix of the residuals.

detResidCov

determinant of residCov.

rweights

matrix of robust weights.

eq

a list containing the summary from function summary.lmrob and ssr: residual sum of squares, eqnNo: equation number and eqnLabel: equation label.

df

degrees of freedom, a 2-vector, where the first element is the number of coefficients and the second element is the number of observations minus the number of coefficients.

coefficients

a matrix with columns for the estimated coefficients, their standard errors, t-statistic and corresponding (two-sided) p-values.

ssr_weighted

weighted residual sum of squares.

r.squared

R2R^2 value.

adj.r.squared

adjusted R2R^2 value.

coefCov

estimated covariance matrix of the coefficients.

printResidCov

argument residCov.

printEquations

argument equations.

control

list of control parameters used for the estimation.

call

the matched call of surerob.

Author(s)

Claudio Agostinelli and Giovanni Saraceno

References

Giovanni Saraceno, Fatemah Alqallaf and Claudio Agostinelli (2021?) A Robust Seemingly Unrelated Regressions For Row-Wise And Cell-Wise Contamination, submitted

See Also

surerob

Examples

library(systemfit)
  data("Kmenta")
  eqDemand <- consump~price+income
  eqSupply <- consump~price+farmPrice+trend
  system <- list(demand=eqDemand, supply=eqSupply)
     
  ## Robust estimation
  fitrob <- surerob(system, data=Kmenta)
  summary(fitrob)

Robust estimation for Seemingly Unrelated Regression Models

Description

Robust estimation for Seemingly Unrelated Regression Models in presence of cell-wise and case-wise outliers performed using a three-stage procedure. In the first step estimation of the coefficients in each single-equation model is obtained using a Robust Regression procedure, robust estimation of the residual covariance is obtained by a Two-Step Generalized S-estimator, a weighted least square is performed on the whole system to get final estimates of the regression coefficients.

Usage

surerob(formula, data, control=lmrob.control(), ...)
## S3 method for class 'surerob'
print(x, digits=max(3, getOption("digits")-1), ...)

Arguments

formula

a list of objects of class formula for multiple-equation models; for single-equation models use function lmrob.

data

a list of objects of class data.frame. Each data.frame contains the data for the corresponding model and all the data.frames must have the same number of observations.

control

list of control parameters. The default is constructed by the function lmrob.control, and it is passed to function lmrob.

...

arguments passed to the function TSGS.

x

an object of class surerob.

digits

number of digits to print.

Details

The estimation of systems of equations with unequal numbers of observations is not implemented.

Value

surerob returns a list of the class surerob and contains all results that belong to the whole system. This list contains one special object: "eq". It is a list and contains one object for each estimated equation. These objects are of the class lmrob and contain the results that belong only to the regarding equation.

The objects of the class surerob have the following components:

eq

a list that contains the results that belong to the individual equations.

call

the matched call.

method

estimation method.

rank

total number of linear independent coefficients.

coefficients

vector of all estimated coefficients.

fitted.values

matrix of fitted values.

residuals

matrix of residuals

imp.residuals

imputed residuals from TSGS.

residCovEst

residual covariance matrix used for estimation.

residCov

estimated residual covariance matrix.

rweights

matrix of robust weights.

TSGS

object from function TSGS.

control

list of control parameters used for the estimation.

df.residual

degrees of freedom of the whole system.

y

response observations used in the second step.

x

design matrix used in the second step.

Author(s)

Claudio Agostinelli and Giovanni Saraceno

References

Giovanni Saraceno, Fatemah Alqallaf and Claudio Agostinelli (2021?) A Robust Seemingly Unrelated Regressions For Row-Wise And Cell-Wise Contamination, submitted

See Also

lmrob, lm and systemfit

Examples

library(systemfit)
  data("Kmenta")
  eqDemand <- consump~price+income
  eqSupply <- consump~price+farmPrice+trend
  system <- list(demand=eqDemand, supply=eqSupply)
     
  ## Robust estimation
  fitrob <- surerob(system, data=Kmenta)
  print(fitrob)