ip | R Documentation |
A symbolic routine to define that the underlying mean curve has an inflection-point in the formula argument to changept.
ip(x, sh = 1)
x |
The predictor vector. |
sh |
If sh is |
The vector "x" with three attributes, i.e., nm: the name of x; categ: the category of the change-point, "inflect"; sh: the shape constraint on the estimated curve: 1
(convex-concave) or -1
(concave-convex).
The nm and categ attributes are used in the plot routine; the sh attribute is used to set up a shape-constrained regression.
Xiyue Liao
tp
, jp
# the underlying mean curve is a non-decreasing growth curve
# with an inflection point at .5 and it is convex-concave
n = 100
x = seq(1/n, 1, length = n)
set.seed(123)
y = 5 * (1 + tanh(10 * (x - .5))) + rnorm(n, sd = 1)
ans = changept(y ~ ip(x, sh = 1), fir = TRUE)
plot(ans)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.