breedr_splines: Build a splines model

Description Usage Arguments Details Value

View source: R/splines.R

Description

Given the coordinates of the observations, and the degree, this function puts into place a sensible number of spline knots and computes the incidence matrix B and the covariance matrix U

Usage

1
2
3
4
5
6
7
8
9
breedr_splines(
  coordinates,
  n.knots = NULL,
  autofill = TRUE,
  degree = 3,
  sparse = TRUE,
  strategy = "uniformgrid",
  ...
)

Arguments

coordinates

matrix(-like) of observation coordinates

n.knots

numeric. Vector of length two with an integer number of knots in each dimension.

autofill

logical. If TRUE (default) it will try to fill gaps in the rows or columns. Otherwise, it will treat gaps the same way as adjacent rows or columns.

degree

integer. Degree of the B-spline polynomials.

sparse

logical. If TRUE (default) the incidence matrix will be stored in sparse format. Current implementation ignores a value of FALSE.

strategy

character. Strategy for placing spline knots. Only uniformgrid available for the moment.

...

Not used.

Details

Relies on splines::splineDesign(), which uses a C function call to compute the splines coefficients.

sparse matrices take less memory, but also take longer to compute with. This is probably convenient only for really big datasets in comparison with RAM size. The covariance matrix is always stored in sparse format, as it is particularly sparse.

Value

A list with elements incidence.matrix, structure.matrix and structure.type, which is a string indicating either covariance or precision.


famuvie/breedR documentation built on Sept. 6, 2021, 4:50 a.m.