Note that the minimum is always zero. We are thus mainly interested in the point where the minimum is reached.
minPenalty(knots = NULL, dist.range = c(-6, 6), by.knots = 0.3, sdspline = NULL,
difforder = 3, init.c,
maxiter = 200, rel.tolerance = 1e-10, toler.chol = 1e-15, toler.eigen = 1e-3,
maxhalf = 10, debug = 0, info = TRUE)knots the knots
are determined as c(seq(0, dist.range[2], by = by.knots), seq(0, dist.range[1], by = -by.knots)).
The sequence of knots is sorted and multiple enknots.sdspline >= 1 it is chanrel.tolerance and if both
constraints are satisfied up to rel.tolerance<eval.Gspline.optimum <- minPenalty(knots=seq(-4.2, 4.2, by = 0.3), sdspline=0.2, difforder=3)
where <- optimum$spline
print(where)
show <- eval.Gspline(where, seq(-4.2, 4.2, by=0.05))
plot(show, type="l", bty="n", lwd=2)Run the code above in your browser using DataLab