MakeGrid {gps} | R Documentation |
Make a grid of
-values between domain knots
Description
Place equidistant grid points on each knot span to produce a grid of -values between domain knots, suitable for evaluating B-splines.
Usage
MakeGrid(xd, n, rm.dup = FALSE)
Arguments
xd |
domain knot sequence. |
n |
number of equidistant grid points on each knot span. |
rm.dup |
if FALSE, interior knots will appear twice on the grid; if TRUE, they will appear only once. |
Details
Denote the domain knot sequence by , where
are interior knots and
,
are domain endpoints. A knot span is the interval between two successive knots, i.e.,
.
To make a suitable grid on for evaluating B-splines, we can place
equidistant grid points on each knot span, ending up with
grid points in total. Interior knots will show up twice in this grid. To keep only one instance, set
rm.dup = TRUE
.
Value
A vector of grid points.
Author(s)
Zheyuan Li zheyuan.li@bath.edu
Examples
require(gps)
## 4 domain knots: two interior knots 0.5 and 1.5 in domain [0, 3]
xd <- c(0, 0.5, 1.5, 3)
## interior knots will appear twice
MakeGrid(xd, 5, rm.dup = FALSE)
## interior knots only appear once
MakeGrid(xd, 5, rm.dup = TRUE)