Kernel density ridge estimation
Kernel density ridge estimation for 2- to 3-dimensional data.
kdr(x, y, H, p=1, max.iter=400, tol.iter, tol.seg, min.seg.size, keep.path=FALSE, gridsize, xmin, xmax, binned, bgridsize, w, fhat, density.cutoff, verbose=FALSE)
x |
matrix of data values |
y |
matrix of initial values |
p |
dimension of density ridge |
H |
bandwidth matrix/scalar bandwidth. If missing,
|
max.iter |
maximum number of iterations. Default is 400. |
tol.iter |
distance under which two successive iterations are
considered convergent. Default is 0.001*min marginal IQR of |
tol.seg |
distance under which two segments are considered
to form one segment. Default is 0.01*max marginal IQR of |
min.seg.size |
minimum length of a segment of a density
ridge. Default is |
keep.path |
flag to store the density gradient ascent paths. Default is FALSE. |
gridsize |
vector of number of grid points |
xmin,xmax |
vector of minimum/maximum values for grid |
binned |
flag for binned estimation. |
bgridsize |
vector of binning grid sizes |
w |
vector of weights. Default is a vector of all ones. |
fhat |
kde of |
density.cutoff |
density threshold under which the |
verbose |
flag to print out progress information. Default is FALSE. |
Kernel density ridge estimation is based on reduced dimension kernel mean shift. See Ozertem & Erdogmus (2011).
If y
is missing, then it defaults to the grid of size
gridsize
spanning from xmin
to xmax
.
If the bandwidth H
is missing, then
the default bandwidth is the plug-in selector for the density gradient
Hpi(x,deriv.order=2)
. Any bandwidth that is suitable for the
density Hessian is also suitable for the kernel density ridge.
A kernel density ridge set is an object of class kdr
which is a list with fields:
x,y |
data points - same as input |
end.points |
matrix of final iterates starting from |
H |
bandwidth matrix |
names |
variable names |
tol.iter,tol.clust,min.seg.size |
tuning parameter values - same as input |
binned |
flag for binned estimation |
names |
variable names |
w |
vector of weights |
path |
list of density gradient ascent paths where |
Ozertem, U. & Erdogmus, D. (2011), Locally defined principal curves and surfaces, Journal of Machine Learning Research, 12, 1249-1286.
if(interactive()){ library(maps) data(quake) quake <- quake[quake$prof==1,] ## Pacific Ring of Fire quake$long[quake$long<0] <- quake$long[quake$long<0] + 360 quake <- quake[, c("long", "lat")] data(plate) ## tectonic plate boundaries plate <- plate[plate$long < -20 | plate$long > 20,] plate$long[plate$long<0 & !is.na(plate$long)] <- plate$long[plate$long<0 & !is.na(plate$long)] + 360 dr.quake <- kdr(x=quake, xmin=c(70,-70), xmax=c(310, 80)) map("world2", xlim=c(85, 305), ylim=c(-70, 70), lty=2) lines(plate[,1:2], col=3, lwd=2) points(dr.quake$end.points, cex=0.5, pch=16, col=2)}
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.