Description Usage Arguments Details See Also Examples
Plots a bidimensional projection of the data and chosen boxes.
1 2 3 4 5 6 7 8 9 10 11 |
object |
A 'prim' object. |
select |
A vector of length 1 or 2 indicating the input variables(s)
to plot. Default to the two first ones.
If a single variable is selected, plot it against |
npeel |
Integer vector indicating the number of peeling iteration of boxes to plot. |
support |
Numeric vector with values between 0 and 1 indicating the support of boxes to plot. |
yfun |
Numeric vector indicating the value of the objective function of the boxes to plot. |
npaste |
Integer vector indicating the number of pasting iteration of boxes to plot. |
ypalette |
A palette of colors for representing the |
box.args |
A list of arguments to be passed to
|
... |
Additional graphical parameters for
|
Several boxes can be displayed at once, selected by one of the
arguments npeel
, support
, yfun
or npaste
(when relevant). Note that the arguments in box.args
allow
giving different parameters to each displayed box.
peeling
for peeling trajectories.
1 2 3 4 5 6 7 8 9 10 11 12 | # A simple bump
set.seed(12345)
x <- matrix(runif(2000), ncol = 2, dimnames = list(NULL, c("x1", "x2")))
y <- 2 * x[,1] + 5 * x[,2] + 10 * (x[,1] >= .8 & x[,2] >= .5) +
rnorm(1000)
# Peeling with alpha = 0.05 and beta.stop = 0.05
peel_res <- peeling(y, x, beta.stop = 0.05)
# Automatically choose the best box
chosen <- jump.prim(peel_res)
# Plot the resulting box
plot_box(peel_res, pch = 16, ypalette = hcl.colors(10),
support = chosen$final.box$support, box.args = list(lwd = 2))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.