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

A symbolic routine to define that the systematic component *η* is smooth, increasing and concave in a predictor in a formula argument to cgam. This is the smooth version.

1 | ```
s.incr.conc(x, numknots = 0, knots = 0, space = "E")
``` |

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

`numknots` |
The number of knots used to constrain |

`knots` |
The knots used to constrain |

`space` |
A character specifying the method to create knots. It will not be used if the user specifies the |

"s.incr.conc" returns the vector "x" and imposes on it five attributes: name, shape, numknots, knots and space.

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 "s.incr.conc"; the shape attribute is 14("smooth, increasing and concave"). According to the value of the vector itself and its shape, numknots, knots and space attributes, the cone edges will be made by C-spline basis functions in Meyer (2008). The cone edges are a set of basis employed in the hinge algorithm.

Note that "s.incr.conc" does not make the corresponding cone edges itself. It sets things up to a subroutine called makedelta in cgam.

See references cited in this section for more details.

The vector x with five attributes, i.e., name: the name of x; shape: 14("smooth, increasing and concave"); numknots: the numknots argument in "s.incr.conc"; knots: the knots argument in "s.incr.conc"; space: the space argument in "s.incr.conc".

Mary C. Meyer and Xiyue Liao

Meyer, M. C. (2013b) A simple new algorithm for quadratic programming with applications in statistics. *Communications in Statistics 42(5)*, 1126–1139.

Meyer, M. C. (2008) Inference using shape-restricted regression splines. *Annals of Applied Statistics 2(3)*, 1013–1033.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ```
data(cubic)
# extract x
x <- - cubic$x
# extract y
y <- - cubic$y
# regress y on x with the shape restriction: "smooth, increasing and concave"
ans <- cgam(y ~ s.incr.conc(x))
knots <- ans$knots[[1]]
# make a plot
par(mar = c(4, 4, 1, 1))
plot(x, y, cex = .7, xlab = "x", ylab = "y")
lines(x, ans$muhat, col = 2)
legend("topleft", bty = "n", "smooth, increasing and concave fit", col = 2, lty = 1)
legend(-.3, 4, bty = "o", "knots", pch = "X")
points(knots, 1:length(knots)*0+min(y), pch = "X")
``` |

cgam documentation built on Feb. 16, 2018, 1:01 a.m.

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.