Displaying 1 result from an estimated 1 matches for "xgr2".
Did you mean:
gr2
2008 Jul 29
1
tensor product of equi-spaced B-splines in the unit square
...(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(xgr2,1,btens)
Bmat = matrix(t(Bx)%*%bet,ng)
# plot the result
contour(xgr,xgr,Bmat)
persp(xgr,xgr,Bmat,theta=15)
any of you have a better idea (ie more...