KernSec(x, xgridsize=100, xbandwidth, range.x)
x
valuesx
window width, or vector of local window widths, one for each x
, or one for each range.x
, or a vector of length xgridsize
: default=dpik(x)
x
dimension, or a vector giving the x
ordinates: default=range +- 1.5 * mean bandwidth
x
ordinateKernSur
per
density
hist
bkde
bkde2D
dpik
x <- c(2,4,6,8,10)
z <- KernSec(x) # simplest invocation
plot(z$xords, z$yden, type="l")
z <- KernSec(x, xbandwidth=2, range.x=c(0,8))
plot(z$xords, z$yden, type="l")
# local bandwidths
ords <- seq(from=0, to=14, length=100)
bands <- x/15
z <- KernSec(x, xbandwidth=bands, range.x=ords)
plot(z$xords, z$yden, type="l") # should plot a wriggly line
bands <- seq(from=1, to=4, length=100) # improvise a pilot estimate
z <- KernSec(x, xbandwidth=bands, range.x=ords)
plot(z$xords, z$yden, type="l")
Run the code above in your browser using DataLab