powered by
## S3 method for class 'pspline': print(x, \dots)
x
rbpspline
print
n <- 200 x <- runif(n) fun <- function(x) sin(3 * pi * x) y <- fun(x) + rnorm(n, 0, sqrt(0.4)) knots <- quantile(x, prob = 1:31 / 32) fitted <- rbpspline(y, x, knots = knots, degree = 3) fitted
Run the code above in your browser using DataLab