Bob
Bob

Reputation: 1459

How to make a monotonically increasing smooth spline while specifying the number of knots and fixing endpoints of the spline?

I would like to fit a monotonically increasing smooth spline to monotonically increasing data while specifying the number of knots and giving start and endpoints.

This question (How to make monotonic (increasing) smooth spline with smooth.spline() function?) explains how to make a monotonically increasing spline, but not while specifying the number of knots or endpoints.

The functions bs and smooth.spline give me sufficient control over the spline function, but don't produce a monotonically increasing spline.

The functions spline and splinefun, with Hyman filtering, can produce a monotonically increasing spline, but do not allow control over the number of knots.

For replication purposes, the code y <- 1 - (1 / cumsum(abs(rnorm(25)))) produces data that looks like my data.

Upvotes: 0

Views: 96

Answers (0)

Related Questions