unireg
objects."plot"(x, onlySpline=FALSE, type="l", xlab="x", ylab=NULL, col="black", ...)
"unireg"
, a result of unireg
."l"
is used for the fitted spline.ylab=NULL
(default), prespecified labels like "Fitted unimodal spline function" (depending on the constraint) are used.plot
function.unireg
,predict.unireg
,points.unireg
x <- sort(rep(0:5,20))
n <- length(x)
set.seed(41333)
func <- function(mu){rnorm(1,mu,0.05)}
y <- sapply(dchisq(x,3),func)
# fit with default settings
fit <- unireg(x, y, g=5)
# short overview of the fitted spline
fit
# plot of fitted spline with and without data
plot(fit, col="orange")
plot(fit, onlySpline=TRUE)
Run the code above in your browser using DataLab