Displaying 1 result from an estimated 1 matches for "btens".
Did you mean:
tens
2008 Jul 29
1
tensor product of equi-spaced B-splines in the unit square
...program (it works in a 2-dimensional setting)
library(splines)
# set the break-points
Knots = seq(-1,1,length=10)
# number of splines
M = (length(Knots)-4)^2
# short cut to splineDesign function
bspline = function(x) splineDesign(Knots,x,outer.ok = T)
# bivariate tensor product of bspline
btens = function(x) t(bspline(x[1]))%*%bspline(x[2])
# numebr of points to plot
ng = 51
# create vectors for plotting
xgr = seq(-1,1,length=ng)
xgr2 = expand.grid(xgr,xgr)
# generate random coef. of linear combination
bet = rnorm(M)
# create matrix for contour-type plot
Bx = apply(xg...