modalreg(x, y, xfix=seq(min(x),max(x),l=50), a, b, deg = 0, iter = 30, P = 2,
start = "e", prun = TRUE, prun.const = 10, plot.type = c("p", 1),
labels = c("", "x", "y"), pch=20, ...)"q": proportional to quantiles; "e": equidistant; "r": random.
All, "q", "e", and "r", give starting points whic1/(prun.const*(max(x)-min(x))*(max(y)-min(y)))."p", "l", and "n". If equal to "n", no plotted output
is given at all. If equal to "p", fitted curvecde.bandwidths.[P x length(xfix)]- matrix with fitted j-th branch
in the j-th row ($1 \le j \le P$)a and b.[P x length(xfix)]- matrix with estimated kernel densities. This will only be computed if prun=TRUE.deg=1.
Hence, deg=0 is recommended. For bandwidth selection, the
hybrid rule introduced by Bashtannyk and Hyndman (2001) is employed
if deg=0. This corresponds to the setting method=1 in
function cde.bandwidths. For deg=1 automatic bandwidth
selection is not supported.Bashtannyk, D.M., and Hyndman, R.J. (2001) "Bandwidth selection for kernel conditional density estimation". Computational Statistics and Data Analysis, 36(3), 279-298.
cde.bandwidthslane2.fit <- modalreg(lane2$flow, lane2$speed, xfix=(1:55)*40, a=100, b=4)Run the code above in your browser using DataLab