This function computes robust marginal integration procedures for additive models.
margint.rob(
formula,
data,
subset,
point = NULL,
windows,
prob = NULL,
sigma.hat = NULL,
win.sigma = NULL,
epsilon = 1e-06,
type = "0",
degree = NULL,
typePhi = "Huber",
k.h = 1.345,
k.t = 4.685,
max.it = 20,
qderivate = FALSE,
orderkernel = 2,
Qmeasure = NULL
)
A list with the following components:
Estimate for the intercept.
Matrix of estimated additive components (n by p).
Estimate of the residual standard error.
Matrix of estimated additive components for the points listed in the argument point.
A vector of size p showing in each component the estimated intercept that considers only that direction of interest when using the type 'alpha'
method.
Matrix of estimated derivatives of the additive components (only when qderivate is TRUE
) (n by p).
Matrix of estimated derivatives of the additive components for the points listed in the argument point (only when qderivate is TRUE
).
Matrix of explanatory variables.
Vector of responses.
Model formula
an object of class formula
(or one that can be coerced to that class): a symbolic description of the model to be fitted.
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 data
, the variables are taken from environment(formula)
, typically the environment from which the function was called.
an optional vector specifying a subset of observations to be used in the fitting process.
a matrix of points where predictions will be computed and returned.
a vector or a squared matrix of bandwidths for the smoothing estimation procedure.
a vector of probabilities of observing each response (n). Defaults to NULL
.
estimate of the residual standard error. If NULL
we use the mad of the residuals obtained with local medians.
a vector of bandwidths for estimating sigma.hat. If NULL
it uses the argument windows if it is a vector or its diagonal if it is a matrix.
convergence criterion.
three different type of estimators can be selected: type '0'
(local constant on all the covariates), type '1'
(local linear smoother on all the covariates), type 'alpha'
(local polynomial smoother only on the direction of interest).
degree of the local polynomial smoother in the direction of interest when using the estimator of type 'alpha'
. Defaults to NULL
for the case when using estimators of type '0'
or '1'
.
one of either 'Tukey'
or 'Huber'
.
tuning constant for a Huber-type loss function. Defaults to 1.345
.
tuning constant for a Tukey-type loss function. Defaults to 4.685
.
maximum number of iterations for the algorithm.
if TRUE, it calculates g^(q+1)/(q+1)!
for each component only for the type 'alpha'
method. Defaults to FALSE
.
order of the kernel used in the nuisance directions when using the estimator of type 'alpha'
. Defaults to 2
.
a matrix of points where the integration procedure ocurrs. Defaults to NULL
for calcuting the integrals over the sample.
Alejandra Martinez, ale_m_martinez@hotmail.com, Matias Salibian-Barrera
This function computes three types of robust marginal integration procedures for additive models.
Boente G. and Martinez A. (2017). Marginal integration M-estimators for additive models. TEST, 26(2), 231-260. https://doi.org/10.1007/s11749-016-0508-0
function.g1 <- function(x1) 24*(x1-1/2)^2-2
function.g2 <- function(x2) 2*pi*sin(pi*x2)-4
set.seed(140)
n <- 150
x1 <- runif(n)
x2 <- runif(n)
X <- cbind(x1, x2)
eps <- rnorm(n,0,sd=0.15)
regresion <- function.g1(x1) + function.g2(x2)
y <- regresion + eps
bandw <- matrix(0.25,2,2)
set.seed(8090)
nQ <- 80
Qmeasure <- matrix(runif(nQ*2), nQ, 2)
fit.rob <- margint.rob(y ~ X, windows=bandw, type='alpha', degree=1, Qmeasure=Qmeasure)
Run the code above in your browser using DataLab