lps.variance

0th

Percentile

compute the variance of the local polynomial regression function

To compute the variance of the local polynomial regression function

Keywords
smooth
Usage
lps.variance(y,x,gridsize, bw, method="Rice")
Arguments
y,x

Two numerical vectors: y is the response and x is the predictor.

bw

Smoothing parameter. Is used only when method='Wasserman' or method='heteroscedastic'.

gridsize

The size of a vector of grid points where the variance of r(x) is to be estimated. This parameter is needed only when method='heteroscedastic'.

method

We use four method to compute the variance of r(x): Method 1) Larry Wasserman--nearly unbiased. This method based on an lps object; Method 2) Rice 1984 Method 3) Gasser et al (1986) -- a variation of method 3. Method 4) For heteroscedastic errors. Need to estimate based on an lpr object. Yu and Jones (2004). Defaulty method: Rice.

Value

the variance of r(x).

Aliases
  • lps.variance
Examples
# NOT RUN {
n = 100
x=rnorm(n)
y=x^2+rnorm(n)
bw = lps.variance
par(mfrow=c(1,1))
out=lpsmooth(y,x)
#plot(out, scb=TRUE, type='l')
vrx = lps.variance(y,x)
out=lpsmooth(y,x,sd.y=sqrt(vrx), bw=0.5)
plot(y~x, pch='.')
lines(out, col=2)

x0 = seq(min(x),  max(x), length=100)
y0 = x0^2
lines(y0~x0, col=4)

 
# }
Documentation reproduced from package bda, version 14.1.4, License: Unlimited

Community examples

Looks like there are no examples yet.