# groc: groc method In groc: Generalized Regression on Orthogonal Components

## Description

Generalized regression on orthogonal components.

## Usage

 1 2 3 4 5 6 ## Default S3 method: groc(formula, ncomp, data, subset, na.action, plsrob = FALSE, method = c("lm", "lo", "s", "lts"), D = NULL, gamma = 0.75, Nc = 10, Ng = 20, scale = FALSE, Cpp = TRUE, model = TRUE, x = FALSE, y = FALSE, sp = NULL, ...) groc(...)

## Arguments

 formula a model formula. Most of the lm formula constructs are supported. See below. ncomp the number of components (orthogonal components) to include in the model. data an optional data frame with the data to fit the model from. subset an optional vector specifying a subset of observations to be used in the fitting process. na.action a function which indicates what should happen when the data contain missing values. plsrob logical. If TRUE, we use the D=covrob measure of dependence with the least trimmed squares method="lts". method character giving the name of the method to use. The user can supply his own function. The methods available are linear models, "lm", local polynomials, "lo", smoothing splines, "s", and least trimmed squares, "lts". D function with two arguments, each one being a vector, which measures the dependence between two variables using n observations from them. If NULL, the covariance measure will be used. The user can supply his own function. gamma parameter used with the option plsrob=TRUE. It defines the quantile used to compute the "lts" regression. The default gamma=0.75 gives a breakdown of 25% for a good compromise between robustness and efficiency. The value gamma=0.5 gives the maximal breakdown of 50%. Nc Integer, Number of cycles in the grid algorithm. Ng Integer, Number of points for the grid in the grid algorithm. scale Logical, Should we scale the data. Cpp Logical, if TRUE this function will use a C++ implementation of the grid algorithm. The FALSE value should not be used, unless to get a better understanding of the grid algorithm or to compare the speed of computation between R and C++ versions of this algorithm model a logical. If TRUE, the model frame is returned. x a logical. If TRUE, the model matrix is returned. y a logical. If TRUE, the response is returned. sp A vector of smoothing parameters can be provided here. Smoothing parameters must be supplied in the order that the smooth terms appear in the model formula. Negative elements indicate that the parameter should be estimated, and hence a mixture of fixed and estimated parameters is possible. 'length(sp)' should be equal to 'ncomp' and corresponds to the number of underlying smoothing parameters. ... further arguments to be passed to or from methods.

## Value

 Y vector or matrix of responses. fitted.values an array of fitted values. residuals residuals T a matrix of orthogonal components (scores). Each column corresponds to a component. R a matrix of directions (loadings). Each column is a direction used to obtain the corresponding component (scores). Gobjects contain the objects produced by the fit of the responses on the orthogonal components. Hobjects contain the objects produced by the "lts" fit of each deflated predictors on the orthogonal components. Hobjects are produced when plsrob=TRUE. B matrix of coefficients produced by the "lm" fit of each deflated predictors on the last component. B is produced when plsrob=FALSE. Xmeans a vector of means of the X variables. Ymeans a vector of means of the Y variables. D Dependence measure used. V a matrix whose columns contain the right singular vectors of the data. Computed in the preprocessing to principal component scores when the number of observations is less than the number of predictors. dnnames dimnames of 'fitted.values' ncomp the number of components used in the modelling. method the method used. scale Logical. TRUE if the responses have been scaled. call the function call. terms the model terms. plsrob Logical. If plsrob=TRUE, a robust partial least squares fit. model if model=TRUE, the model frame.

## Author(s)

Martin Bilodeau ([email protected]) and Pierre Lafaye de Micheaux ([email protected]) and Smail Mahdi ([email protected])

## References

Martin Bilodeau, Pierre Lafaye de Micheaux, Smail Mahdi (2015), The R Package groc for Generalized Regression on Orthogonal Components, Journal of Statistical Software, 65(1), 1-29,
http://www.jstatsoft.org/v65/i01/