Description Usage Arguments Value Examples
This function generates the basis for tensor-product splines over a triangular prism partition.
1 2 3 4 5 6 7 8 9 10 11 12 | basis.tensor(
ss,
tt,
V,
Tri,
d = 2,
r = 1,
time.knots,
time.bound,
rho = 3,
line.up = FALSE
)
|
ss |
If |
tt |
If |
V |
The |
Tri |
The triangulation matrix of dimention |
d |
The degree of piecewise polynomials – default is 2, and usually |
r |
The smoothness parameter – default is 1, and 0 ≤ |
time.knots |
The vector of interior time.knots for univariate spline.
|
time.bound |
The vector of two. The boundary of univariate spline.
|
rho |
The order of univaraite spline.
|
line.up |
The indicator of whether the observed points are temporally lined up or not – default is |
A list of vectors and matrices, including:
Psi |
The spline basis function of dimension |
Psi.Q2 |
The spline basis function after QR decomposition |
H |
The smoothness matrix for bivariate spline. |
Q2 |
The Q2 matrix after QR decomposition of the smoothness matrix |
H.all |
The smoothness matrix for tensor-product spline. |
Q2.all |
The Q2 matrix after QR decomposition of the smoothness matrix |
dimB |
The number of bivariate spline basis functions. |
dimU |
The number of univariate spline basis functions. |
P1, P2 |
The penalty matrices from energy functions. |
K1, K2 |
The penalty matrices from energy functions QR decomposition. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | # load need libraries.
# Packages BPST and Triangulation could be downloaded from github.
rm(list = ls())
library(devtools)
install_github("funstatpackages/BPST")
install_github("funstatpackages/Triangulation")
library(Triangulation)
library(TPST)
data(Tr1)
data(V1)
ngrid.x=40
ngrid.y=20
ngrid.t=10
xx=seq(-0.89,3.39,length.out=ngrid.x)
yy=seq(-0.89,0.89,length.out=ngrid.y)
ss=expand.grid(xx,yy)
tt=(0:(ngrid.t-1))/(ngrid.t-1)
Data=data.frame(x=rep(ss[,1],ngrid.t),y=rep(ss[,2],ngrid.t),
t=rep(tt,each=dim(ss)[1]))
knots=c(0.2,0.4,0.6,0.8)
Boundary.knots=c(0,1)
d <- 2
r <- 1
rho <- 3
Basis1 <- basis.tensor(ss = ss, tt = tt, V = V1, Tri = Tr1,
d = d, r = r, time.knots = knots, rho = rho,
time.bound = Boundary.knots, line.up = TRUE)
Basis2 <- basis.tensor(ss = Data[,1:2], tt = Data[,3],
V = V1, Tri = Tr1, d = d, r = r,
time.knots = knots, rho = rho,
time.bound = Boundary.knots, line.up = FALSE)
which(Basis1$Psi.Q2 != Basis2$Psi.Q2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.