basis: Bivariate Spline Basis Function

View source: R/basis.R

basisR Documentation

Bivariate Spline Basis Function

Description

This function generates the basis for bivariate spline over triangulation.

Usage

basis(V, Tr, d = 5, r = 1, Z, Hmtx = TRUE, Kmtx = TRUE, QR = TRUE, TA = TRUE)

Arguments

V

The N by two matrix of vertices of a triangulation, where N is the number of vertices. Each row is the coordinates for a vertex.

Tr

The triangulation matrix of dimention nT by three, where nT is the number of triangles in the triangulation. Each row is the indices of vertices in V.

d

The degree of piecewise polynomials – default is 5, and usually d is greater than one. -1 represents piecewise constant.

r

The smoothness parameter – default is 1, and 0 \le r < d.

Z

The cooridinates of dimension n by two. Each row is the coordinates of a point.

Hmtx

The indicator of whether the smoothness matrix H need to be generated – default is TRUE.

Kmtx

The indicator of whether the energy matrix K need to be generated – default is TRUE.

QR

The indicator of whether a QR decomposition need to be performed on the smoothness matrix – default is TRUE.

TA

The indicator of whether the area of the triangles need to be calculated – default is TRUE.

Details

This R program is modified based on the Matlab program written by Ming-Jun Lai from the University of Georgia and Li Wang from the Iowa State University.

Value

A list of vectors and matrice, including:

B

The spline basis function of dimension n by nT*{(d+1)(d+2)/2}, where n is the number of observationed points, nT is the number of triangles in the given triangulation, and d is the degree of the spline. If some points do not fall in the triangulation, the generation of the spline basis will not take those points into consideration.

Ind.inside

A vector contains the indexes of all the points which are inside the triangulation.

H

The smoothness matrix.

Q2

The Q2 matrix after QR decomposition of the smoothness matrix H.

K

The thin-plate energy function.

tria.all

The area of each triangle within the given triangulation.

Examples

# example 1
xx = c(-0.25, 0.75, 0.25, 1.25)
yy = c(-0.25, 0.25, 0.75,1 .25)
Z = cbind(xx, yy)
d = 4; r = 1;
V0 = rbind(c(0, 0), c(1, 0), c(1, 1), c(0, 1))
Tr0 = rbind(c(1, 2, 3), c(1, 3, 4))
basis(V0, Tr0, d, r, Z)

FIRST-Data-Lab/BPST documentation built on Sept. 18, 2023, 7:31 a.m.