Title: | Robust Backfitting |
---|---|
Description: | A robust backfitting algorithm for additive models based on (robust) local polynomial kernel smoothers. It includes both bounded and re-descending (kernel) M-estimators, and it computes predictions for points outside the training set if desired. See Boente, Martinez and Salibian-Barrera (2017) <doi:10.1080/10485252.2017.1369077> and Martinez and Salibian-Barrera (2021) <doi:10.21105/joss.02992> for details. |
Authors: | Matias Salibian-Barrera [aut, cre], Alejandra Martinez [aut] |
Maintainer: | Matias Salibian-Barrera <[email protected]> |
License: | GPL (>=3.0) |
Version: | 2.1.1 |
Built: | 2025-03-06 05:20:19 UTC |
Source: | https://github.com/msalibian/rbf |
A robust backfitting algorithm for additive models.
Matias Salibian-Barrera, Alejandra Martinez
Maintainer: Matias Salibian-Barrera <[email protected]>
Boente G, Martinez A, Salibian-Barrera M. Robust estimators for additive models using backfitting. Journal of Nonparametric Statistics, 2017; 29:744-767. https://doi.org/10.1080/10485252.2017.1369077
This function computes the standard backfitting algorithm for additive models.
backf.cl( formula, data, subset, point = NULL, windows, epsilon = 1e-06, degree = 0, prob = NULL, max.it = 100 )
backf.cl( formula, data, subset, point = NULL, windows, epsilon = 1e-06, degree = 0, prob = NULL, max.it = 100 )
formula |
an object of class |
data |
an optional data frame, list or environment (or object coercible
by as.data.frame to a data frame) containing the variables in the model.
If not found in |
subset |
an optional vector specifying a subset of observations to be used in the fitting process. |
point |
matrix of points where predictions will be computed and returned. |
windows |
vector of bandwidths for the local polynomial smoother, one per explanatory variable. |
epsilon |
convergence criterion. Maximum allowed relative difference between consecutive estimates |
degree |
degree of the local polynomial smoother. Defaults to |
prob |
vector of probabilities of observing each response (length n).
Defaults to |
max.it |
Maximum number of iterations for the algorithm. |
This function computes the standard backfitting algorithm for additive models, using a squared loss function and local polynomial smoothers.
A list with the following components:
alpha |
Estimate for the intercept. |
g.matrix |
Matrix of estimated additive components (n by p). |
prediction |
Matrix of estimated additive components for the points listed in
the argument |
Matias Salibian-Barrera, [email protected], Alejandra Martinez
Hasie, TJ and Tibshirani, RJ. Generalized Additive Models, 1990. Chapman and Hall, London.
data(airquality) tmp <- backf.cl(Ozone ~ Solar.R + Wind + Temp, data=airquality, subset=complete.cases(airquality), windows=c(130, 9, 10), degree=1)
data(airquality) tmp <- backf.cl(Ozone ~ Solar.R + Wind + Temp, data=airquality, subset=complete.cases(airquality), windows=c(130, 9, 10), degree=1)
This function computes a robust backfitting algorithm for additive models
backf.rob( formula, data, subset, windows, point = NULL, epsilon = 1e-06, degree = 0, sigma.hat = NULL, prob = NULL, max.it = 50, k.h = 1.345, k.t = 4.685, type = "Huber" )
backf.rob( formula, data, subset, windows, point = NULL, epsilon = 1e-06, degree = 0, sigma.hat = NULL, prob = NULL, max.it = 50, k.h = 1.345, k.t = 4.685, type = "Huber" )
formula |
an object of class |
data |
an optional data frame, list or environment (or object coercible
by as.data.frame to a data frame) containing the variables in the model.
If not found in |
subset |
an optional vector specifying a subset of observations to be used in the fitting process. |
windows |
vector of bandwidths for the local polynomial smoother, one per explanatory variable. |
point |
matrix of points where predictions will be computed and returned. |
epsilon |
convergence criterion. Maximum allowed relative difference between consecutive estimates |
degree |
degree of the local polynomial smoother. Defaults to |
sigma.hat |
estimate of the residual standard error. If |
prob |
vector of probabilities of observing each response (length n).
Defaults to |
max.it |
Maximum number of iterations for the algorithm. |
k.h |
tuning constant for a Huber-type loss function. |
k.t |
tuning constant for a Tukey-type loss function. |
type |
one of either |
This function computes a robust backfitting algorithm for additive models using robust local polynomial smoothers.
A list with the following components:
alpha |
Estimate for the intercept. |
g.matrix |
Matrix of estimated additive components (n by p). |
prediction |
Matrix of estimated additive components for the points listed in
the argument |
sigma.hat |
Estimate of the residual standard error. |
Matias Salibian-Barrera, [email protected], Alejandra Martinez
Boente G, Martinez A, Salibian-Barrera M. Robust estimators for additive models using backfitting. Journal of Nonparametric Statistics, 2017; 29:744-767. https://doi.org/10.1080/10485252.2017.1369077
data(airquality) tmp <- backf.rob(Ozone ~ Solar.R + Wind + Temp, data=airquality, subset=complete.cases(airquality), windows=c(136.7, 8.9, 4.8), degree=1)
data(airquality) tmp <- backf.rob(Ozone ~ Solar.R + Wind + Temp, data=airquality, subset=complete.cases(airquality), windows=c(136.7, 8.9, 4.8), degree=1)
backf
This function returns the deviance of the fitted additive model using one of the three
classical or robust marginal integration estimators, as computed with backf.cl
or
backf.rob
.
## S3 method for class 'backf' deviance(object, ...)
## S3 method for class 'backf' deviance(object, ...)
object |
an object of class |
... |
additional other arguments. Currently ignored. |
A real number.
Alejandra Mercedes Martinez [email protected]
backf
This function returns the fitted values given the covariates of the original sample under an additive model using a classical or robust marginal integration procedure estimator computed with backf.cl
or backf.rob
.
## S3 method for class 'backf' fitted.values(object, ...)
## S3 method for class 'backf' fitted.values(object, ...)
object |
an object of class |
... |
additional other arguments. Currently ignored. |
A vector of fitted values.
Alejandra Mercedes Martinez [email protected]
Description of the additive model formula extracted from an object of class backf
.
## S3 method for class 'backf' formula(x, ...)
## S3 method for class 'backf' formula(x, ...)
x |
an object of class |
... |
additional other arguments. Currently ignored. |
A model formula.
Alejandra Mercedes Martinez [email protected]
This function evaluates an Epanechnikov kernel
k.epan(x)
k.epan(x)
x |
a vector of real numbers |
This function evaluates an Epanechnikov kernel
A vector of the same length as x
where each entry is
0.75 * (1 - x^2)
if x < 1
and 0 otherwise.
Matias Salibian-Barrera, [email protected], Alejandra Martinez
x <- seq(-2, 2, length=10) k.epan(x)
x <- seq(-2, 2, length=10) k.epan(x)
backf
Plot method for objects of class backf
.
## S3 method for class 'backf' plot(x, ask = FALSE, which = 1:np, ...)
## S3 method for class 'backf' plot(x, ask = FALSE, which = 1:np, ...)
x |
an object of class |
ask |
logical value. If |
which |
vector of indices of explanatory variables for which partial residuals plots will be generaetd. Defaults to all available explanatory variables. |
... |
additional other arguments. Currently ignored. |
Alejandra Mercedes Martinez [email protected]
tmp <- backf.rob(Ozone ~ Solar.R + Wind + Temp, data=airquality, subset=complete.cases(airquality), windows=c(136.7, 8.9, 4.8), degree=1) plot(tmp, which=1:2)
tmp <- backf.rob(Ozone ~ Solar.R + Wind + Temp, data=airquality, subset=complete.cases(airquality), windows=c(136.7, 8.9, 4.8), degree=1) plot(tmp, which=1:2)
backf
.This function returns the fitted values given the covariates of
the original sample under an additive model using the classical or
robust backfitting approach computed with backf.cl
or
backf.rob
.
## S3 method for class 'backf' predict(object, ...)
## S3 method for class 'backf' predict(object, ...)
object |
an object of class |
... |
additional other arguments. Currently ignored. |
A vector of fitted values.
Alejandra Mercedes Martinez [email protected]
The default print method for a backf
object.
## S3 method for class 'backf' print(x, ...)
## S3 method for class 'backf' print(x, ...)
x |
an object of class |
... |
additional other arguments. Currently ignored. |
A real number.
Alejandra Mercedes Martinez [email protected]
This function evaluates the first derivative of Huber's loss function.
psi.huber(r, k = 1.345)
psi.huber(r, k = 1.345)
r |
a vector of real numbers |
k |
a positive tuning constant. |
This function evaluates the first derivative of Huber's loss function.
A vector of the same length as x
.
Matias Salibian-Barrera, [email protected], Alejandra Martinez
x <- seq(-2, 2, length=10) psi.huber(r=x, k = 1.5)
x <- seq(-2, 2, length=10) psi.huber(r=x, k = 1.5)
This function evaluates the first derivative of Tukey's bi-square loss function.
psi.tukey(r, k = 4.685)
psi.tukey(r, k = 4.685)
r |
a vector of real numbers |
k |
a positive tuning constant. |
This function evaluates the first derivative of Tukey's bi-square loss function.
A vector of the same length as x
.
Matias Salibian-Barrera, [email protected], Alejandra Martinez
x <- seq(-2, 2, length=10) psi.tukey(r=x, k = 1.5)
x <- seq(-2, 2, length=10) psi.tukey(r=x, k = 1.5)
backf
This function returns the residuals of the fitted additive model using
the classical or robust backfitting estimators, as computed with backf.cl
or
backf.rob
.
## S3 method for class 'backf' residuals(object, ...)
## S3 method for class 'backf' residuals(object, ...)
object |
an object of class |
... |
additional other arguments. Currently ignored. |
A vector of residuals.
Alejandra Mercedes Martinez [email protected]
Summary method for class backf
.
## S3 method for class 'backf' summary(object, ...)
## S3 method for class 'backf' summary(object, ...)
object |
an object of class |
... |
additional other arguments. Currently ignored. |
This function returns the estimation of the intercept and also the five-number summary and the mean of the residuals for both classical and robust estimators. For the classical estimator, it also returns the R-squared. For the robust estimator it returns a robust version of the R-squared and the estimate of the residual standard error.
Alejandra Mercedes Martinez [email protected]