Description Usage Arguments Details Value Author(s) References See Also Examples

A symbolic routine to define that a surface is decreasing in two predictors in a formula argument to wps.

1 |

`x1` |
A numeric predictor which has the same length as the response vector. |

`x2` |
A numeric predictor which has the same length as the response vector. |

`numknots` |
A vector of the number of knots used to constrain |

`knots` |
A list of two vectors of knots used to constrain |

`space` |
A vector of the character specifying the method to create knots for |

"dd" returns the vectors "x1" and "x2", and imposes on each vector six attributes: name, shape, numknots, knots, space and decreasing.

The name attribute is used in the subroutine plotpersp; the numknots, knots and space attributes are the same as the numknots, knots and space arguments in "dd"; the shape attribute is "wps_dd"(doubly-decreasing); the decreasing values for both vectors are TRUE. According to the value of the vector itself and its shape, numknots, knots, space and decreasing attributes, the cone edges will be made by warped-plane spline basis functions in Meyer (2016). The cone edges are a set of basis employed in the hinge algorithm.

Note that "dd" does not make the corresponding cone edges itself. It sets things up to a subroutine called makedelta_wps in wps.

See references cited in this section for more details.

The vectors *x_1* and *x_2*. Each of them has six attributes, i.e., name: names of *x_1* and *x_2*; shape: "wps_dd"(doubly-decreasing); numknots: the numknots argument in "dd"; knots: the knots argument in "dd"; space: the space argument in "dd"; decreasing: two logical values indicating the monotonicity of the isotonically-constrained surface with respect to *x_1* and *x_2*, which are both TRUE.

Mary C. Meyer and Xiyue Liao

Meyer, M. C. (2016) Estimation and inference for isotonic regression in two dimensions, using warped-plane splines.

1 2 3 4 5 6 7 8 9 10 11 12 13 | ```
# generate data
n <- 100
set.seed(123)
x1 <- runif(n)
x2 <- runif(n)
y <- -4 * (x1 + x2) + rnorm(n, sd = .2)
# regress y on x1 and x2 under the shape-restriction: "doubly-decreasing"
# using the penalized estimator
ans <- wps(y ~ dd(x1, x2), pnt = TRUE)
# make a 3D plot of the constrained surface
plotpersp(ans)
``` |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs in the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.