b: Defining smooths in PLBPSM formulae

Description Usage Arguments Value Examples

Description

Function used in definition of smooth terms within plbpsm model formulae. The function does not evaluate a (spline) smooth - it exists purely to help set up a model using spline based smooths.

Usage

1
2
3
b(..., d = NULL, r = NULL, V = NULL, Tr = NULL, b = NULL,
  nt = NULL, Holes = NULL, B = NULL, Q2 = NULL, K = NULL,
  ind = NULL, lambda = NULL, fx = FALSE, id = NULL)

Arguments

...

a list of variables that are the covariates that this smooth is a function of.

d

degree of polynomials.

r

smoothness and r ≤q d

V

an N by two matrix that lists vertices with the ith row storing in Cartesian coordinates for the ith vertex. N is the number of vertices.

Tr

a K by three matrix that each row represents one triangle. All the elements are the integers that stand for the indices of vertices in V. K is the number of triangles.

b

Boundary of the domain of sample points.

nt

A parameter controls the number of total triangles.

Holes

Information of holes of polygon.

B

Bernstein basis matrix

Q2

The Q matrix from QR decomposition of the constraint matrix.

K

Energy matrix for constructing penalty matrix

ind

An ordering indices of observation points, in which the cnt[j]+1th to cnt[j+1]th elements are indices of points in the jth triangle.

lambda

The default set of smoothing penalty parameter to be chosen from

fx

indicates whether the term is a fixed d.f. regression spline (TRUE) or a penalized regression spline (FALSE).

id

An identifying label or number for the smooth, linking it to other smooths. Defaults to NULL for no linkage.

Value

These smooth.spec objects define bivariate smooths and are turned into bases and penalties by BasisCon functions. The returned object contains the following items:

d

degree of polynomials.

r

smoothness and r≤q d.

V

an N by two matrix that lists vertices with the ith row storing in Cartesian coordinates for the ith vertex. N is the number of vertices.

Tr

a K by three matrix that each row represents one triangle. All the elements are the integers that stand for the indices of vertices in V. K is the number of triangles.

ind

An ordering indices of observation points corresponding to index of triangles.

B

Bernstein basis matrix

K

Energy matrix for constructing penalty matrix

lambda

The default set of smoothing penalty parameter to be chosen from

term

An array of text strings giving the names of the covariates that the term is a function of.

fixed

TRUE if the term is to be treated as a pure regression spline (with fixed degrees of freedom); FALSE if it is to be treated as a penalized regression spline

dim

The dimension of the smoother - i.e. the number of covariates that it is a function of.

label

A suitable text label for this smooth term.

id

An identifying label or number for the smooth, linking it to other smooths. Defaults to NULL for no linkage.

Examples

1
2
3
4
5
library(GgAM)
data(eg1pop_dat)
V=eg1pop_dat[['V2']]
Tr=eg1pop_dat[['T2']]
res <- b(x1,x2,d=2,r=1,V=V,Tr=Tr,lambda=0)

funstatpackages/GgAM documentation built on Nov. 4, 2019, 12:59 p.m.