# Example: ZB-spline basis functions evaluated at a vector of argument values t
t = seq(0,20,l=500)
knots = c(0,2,5,9,14,20)
order = 4
ZBsplineBasis.out = ZBsplineBasis(t,knots,order, basis.plot=TRUE)
# Back-transformation of ZB-spline basis functions from L^2_0 to Bayes space ->
# CB-spline basis functions
CBsplineBasis=NULL
for (i in 1:ZBsplineBasis.out$nbasis)
{
CB_spline = fcenLRinv(t,diff(t)[1:2],ZBsplineBasis.out$ZBsplineBasis[,i])
CBsplineBasis = cbind(CBsplineBasis,CB_spline)
}
matplot(t,CBsplineBasis, type="l",lty=1, las=1,
col=rainbow(ZBsplineBasis.out$nbasis), xlab="t",
ylab="CB-spline basis",
cex.lab=1.2,cex.axis=1.2)
abline(v=knots, col="gray", lty=2)
Run the code above in your browser using DataLab