margint.cl: Classic marginal integration procedures for additive models

View source: R/rmargint-fn.R

margint.clR Documentation

Classic marginal integration procedures for additive models

Description

This function computes the standard marginal integration procedures for additive models.

Usage

margint.cl(
  formula,
  data,
  subset,
  point = NULL,
  windows,
  epsilon = 1e-06,
  prob = NULL,
  type = "0",
  degree = NULL,
  qderivate = FALSE,
  orderkernel = 2,
  Qmeasure = NULL
)

Arguments

formula

an object of class formula (or one that can be coerced to that class): a symbolic description of the model to be fitted.

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 data, the variables are taken from environment(formula), typically the environment from which the function was called.

subset

an optional vector specifying a subset of observations to be used in the fitting process.

point

a matrix of points where predictions will be computed and returned.

windows

a vector or a squared matrix of bandwidths for the smoothing estimation procedure.

epsilon

convergence criterion.

prob

a vector of probabilities of observing each response (n). Defaults to NULL.

type

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

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'.

qderivate

if TRUE, it calculates g^(q+1)/(q+1)! for each component only for the type 'alpha' method. Defaults to FALSE.

orderkernel

order of the kernel used in the nuisance directions when using the estimator of type 'alpha'. Defaults to 2.

Qmeasure

a matrix of points where the integration procedure ocurrs. Defaults to NULL for calcuting the integrals over the sample.

Details

This function computes three types of classical marginal integration procedures for additive models, that is, considering a squared loss function.

Value

A list with the following components:

mu

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 point.

mul

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.

g.derivative

Matrix of estimated derivatives of the additive components (only when qderivate is TRUE) (n by p).

prediction.derivate

Matrix of estimated derivatives of the additive components for the points listed in the argument point (only when qderivate is TRUE).

Xp

Matrix of explanatory variables.

yp

Vector of responses.

formula

Model formula

Author(s)

Alejandra Martinez, ale_m_martinez@hotmail.com, Matias Salibian-Barrera

References

Chen R., Hardle W., Linton O.B. and Severance-Lossin E. (1996). Nonparametric estimation of additive separable regression models. Physica-Verlag HD, Switzerland. Linton O. and Nielsen J. (1995). A kernel method of estimating structured nonparametric regression based on marginal integration. Biometrika, 82(1), 93-101. Severance-Lossin E. and Sperlich S. (1999). Estimation of derivatives for additive separable models. Statistics, 33(3), 241-265. Tjostheim D. and Auestad B. (1994). Nonparametric identification of nonlinear time series: Selecting significant lags. Journal of the American Statistical Association, 89(428), 1410-1430.

Examples

function.g1 <- function(x1) 24*(x1-1/2)^2-2
function.g2 <- function(x2) 2*pi*sin(pi*x2)-4
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.cl <- margint.cl(y ~ X, windows=bandw, type='alpha', degree=1, Qmeasure=Qmeasure)


rmargint documentation built on Oct. 24, 2023, 1:06 a.m.