MakeGrid | R Documentation |
x
-values between domain knots
Place equidistant grid points on each knot span to produce a grid of x
-values between domain knots, suitable for evaluating B-splines.
MakeGrid(xd, n, rm.dup = FALSE)
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. |
Denote the domain knot sequence by s_0, s_1, s_2, \ldots, s_k, s_{k + 1}
, where (s_j)_1^k
are interior knots and s_0 = a
, s_{k + 1} = b
are domain endpoints. A knot span is the interval between two successive knots, i.e., [s_j, s_{j + 1}]
.
To make a suitable grid on [a, b]
for evaluating B-splines, we can place n
equidistant grid points on each knot span, ending up with n(k + 1)
grid points in total. Interior knots will show up twice in this grid. To keep only one instance, set rm.dup = TRUE
.
A vector of grid points.
Zheyuan Li zheyuan.li@bath.edu
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.