sshapedreg | R Documentation |
This function computes the least squares S-shaped regression estimator and its corresponding inflection point by a sequential mixed primal-dual bases algorithm.
sshapedreg(x,y)
x |
a numeric vector that contains all the design points. NB. for the current version, we require all values to be distinct (but not necessarily in ascending order). |
y |
a numeric vector that contains the values of the response with respect to the design points. |
For more details, see Sshaped
.
An object of class sshaped
, which contains the following fields:
x |
covariates copied from input |
y |
response copied from input |
fitted |
the fitted values of the regression function with respect to the design points. |
rss |
the value of the minimised residual sum of squares of the fit |
inflection |
the estimated location of the inflection point |
shape |
the shape enforced in the fit, here equals " |
x<-seq(-1,1,0.005) y<-sin(x*pi/2) + rnorm(length(x)) output<-sshapedreg(x,y) plot(output) xnew=rnorm(5); predict(output,xnew)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.