# Generate data
set.seed(1)
x <- seq(-1,1,0.005)
y <- sin(x*pi/2) + rnorm(length(x))
# Fit S-shape
output <- sshapedreg(x,y)
# Plot
plot(output)
# prediction at new design points
xnew=rnorm(5)
predict(output,xnew)
Run the code above in your browser using DataLab