acgm.linkfunction.estim: Local linear estimation of the regression function

Description Usage Arguments Details Author(s) References Examples

View source: R/acgm.R

Description

This function computes the local linear estimation of the regression function.

Usage

1
2
acgm.linkfunction.estim(x, data.X, data.Y, bandwidth,
		kernel.function = kernel.function.epan)

Arguments

x

a numeric vector.

data.X

a numeric data vector used to obtain the nonparametric estimator of the regression function.

data.Y

a numeric data vector used to obtain the nonparametric estimator of the regression function.

bandwidth

bandwidth used to obtain the nonparametric estimator of the regression function.

kernel.function

kernel function used to obtain the nonparametric estimator of the regression function. Default option is "kernel.function.epan" which corresponds to the Epanechnikov kernel function.

Details

Inappropriate bandwidth or x choices can produce "NaN" values in link function estimates.

Author(s)

Romain Azais, Sandie Ferrigno and Marie-Jose Martinez

References

J. T. Alcala, J. A. Cristobal, and W. Gonzalez Manteiga. Goodness-of-fit test for linear models based on local polynomials. Statistics & Probability Letters, 42(1), 39:46, 1999.

R. Azais, S. Ferrigno and M-J Martinez. cvmgof: An R package for Cramer-von Mises goodness-of-fit tests in regression models. Submitted. January 2021.hal-03101612

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
# Uncomment the following code block

# set.seed(1)
#
# # Data simulation
# n = 25 # Dataset size
# data.X = runif(n,min=0,max=5) # X
# data.Y = 0.2*data.X^2-data.X+2+rnorm(n,mean=0,sd=0.3) # Y
#
# ########################################################################
#
# # Estimation of the link function
#
# bandwidth = 0.75 # Here, the bandwidth is arbitrarily fixed
#
# xgrid = seq(0,5,by=0.1)
# ygrid_acgm = acgm.linkfunction.estim(xgrid,data.X,data.Y,bandwidth)
#
# plot(xgrid,ygrid_acgm,type='l',lty=1,lwd=2,xlab='X',ylab='Y',ylim=c(0.25,2.5))
# lines(xgrid,0.2*xgrid^2-xgrid+2,lwd=0.5,col='gray')

cvmgof documentation built on Jan. 16, 2021, 5:40 p.m.