Given a data vector y in &realn, and a knot specification, minimize ||y &minus &phi||2 for &phi in the set of non-decreasing piece-wise quadratic splines with the specified knots.
The knots themselves may be specified, or a number of (interior) knots specified, which will be placed at equal x quantiles.
The following code has argument y, and returns the least-squares nondecreasing solution.
Given a scatterplot of data vector (x,y) where x,y in &realn, minimize ||y &minus &phi||2, for &phi in the set of convex piece-wise cubic splines with the specified knots.
The knots themselves may be specified, or a number of (interior) knots specified, which will be placed at equal x quantiles.
The following code has arguments x and y and returns the solution.
Given a scatterplot of data vector (x,y) where x,y in &realn, minimize ||y &minus &phi||2 , for &phi in the set of increasing convex piece-wise cubic splines with the specified knots.
The knots themselves may be specified, or a number of (interior) knots specified, which will be placed at equal x quantiles.
The following code has arguments x and y and returns the solution.
Given a scatterplot of data vector (x,y) where x,y in &realn, minimize ||y &minus &phi||2 , for &phi in the set of increasing concave piece-wise cubic splines with the specified knots.
The knots themselves may be specified, or a number of (interior) knots specified, which will be placed at equal x quantiles.
The following code has arguments x and y and returns the solution.