inla.mesh.basis: Basis functions for inla.mesh

Description Usage Arguments Author(s) See Also Examples

View source: R/mesh.R

Description

Calculate basis functions on a 1d or 2d inla.mesh

Usage

1
2
3
4
5
6
7
8
9
inla.mesh.basis(mesh,
                type="b.spline",
                n=3,
                degree=2,
                knot.placement="uniform.area",
                rot.inv=TRUE,
                boundary="free",
                free.clamped=TRUE,
                ...)

Arguments

mesh

An inla.mesh.1d or inla.mesh object.

type

b.spline (default) for B-spline basis functions, sph.harm for spherical harmonics (available opnly for meshes on the sphere)

n

For B-splines, the number of basis functions in each direction (for 1d meshes n must be a scalar, and for planar 2d meshes a 2-vector). For spherical harmonics, n is the maximal harmonic order.

degree

Degree of B-spline polynomials. See inla.mesh.1d.

knot.placement

For B-splines on the sphere, controls the latitudinal placements of knots. "uniform.area" (default) gives uniform spacing in sin(latitude), "uniform.latitude" gives uniform spacing in latitudes.

rot.inv

For spherical harmonics on a sphere, rot.inv=TRUE gives the rotationally invariant subset of basis functions.

boundary

Boundary specification, default is free boundaries. See inla.mesh.1d for more information.

free.clamped

If TRUE and boundary is "free", the boundary basis functions are clamped to 0/1 at the interval boundary by repeating the boundary knots.

...

Author(s)

Finn Lindgren finn.lindgren@gmail.com

See Also

inla.mesh.1d inla.mesh.2d

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
n = 100
loc = matrix(runif(n*2), n, 2)
mesh = inla.mesh.2d(loc, max.edge=0.05)
basis = inla.mesh.basis(mesh, n=c(4,5))

proj = inla.mesh.projector(mesh)
image(proj$x, proj$y, inla.mesh.project(proj, basis[,7]))

if (require(rgl)) {
  plot(mesh, rgl=TRUE, col=basis[,7], draw.edges=FALSE, draw.vertices=FALSE)
}

inbo/INLA documentation built on Dec. 6, 2019, 9:51 a.m.