acgm.bandwidth.selection.linkfunction

From cvmgof v1.0.0 by
0th

Percentile

Bandwidth selection of the link function under the null hypothesis

This function computes the optimal bandwidth of the link function under the null hypothesis

Usage
acgm.bandwidth.selection.linkfunction(data.X.H0, data.Y.H0, linkfunction.H0,
		kernel.function = kernel.function.epan, verbose = TRUE)
Arguments
data.X.H0

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

data.Y.H0

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

linkfunction.H0

regression function under the null hypothesis

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.

verbose

If TRUE, the R function plots the link function (regression function) under the null hypothesis and the local linear link function estimation on a same graph. Default option is TRUE.

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 Cram<U+00E9>r-von Mises goodness-of-fit tests in regression models. 2018. Preprint in progress.

Aliases
  • acgm.bandwidth.selection.linkfunction
Examples
# NOT RUN {
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

########################################################################

# Bandwidth selection under H0

# We generate a dataset under H0 to estimate the optimal bandwidth under H0

linkfunction.H0 = function(x){0.2*x^2-x+2}

data.X.H0 = runif(n,min=0,max=5)
data.Y.H0 = linkfunction.H0(data.X.H0)+rnorm(n,mean=0,sd=0.3)

h.opt.acgm = acgm.bandwidth.selection.linkfunction(data.X.H0 , data.Y.H0,linkfunction.H0)

# }
Documentation reproduced from package cvmgof, version 1.0.0, License: CeCILL

Community examples

Looks like there are no examples yet.