| spde_mesh_1d | R Documentation |
k quadratic B-spline basis functions on evenly spaced knots, over the
range of the covariate widened by a fifth on each side. The widening is the
one-dimensional counterpart of the outer extension of a two-dimensional
mesh: fmesher's default boundary condition is Neumann, under which a field
whose knots stop at the data has its variance inflated by a third or more at
the two ends. A fifth of the spread of the covariate is about one range at
the starting value used in smooth.construct.spde.smooth.spec(), which
is the same rule of thumb used for the offset in two dimensions.
spde_mesh_1d(x, k)
x |
The covariate |
k |
Basis dimension, as passed to |
A degree-2 mesh has one basis function fewer than it has knots, so k
knots would not give k of them; k keeps its mgcv meaning of a
basis dimension here, and k + 1 knots are laid down.
The default of 15 is above mgcv's 10, because k is a resolution here
and not a cap on wiggliness: with the widening, 15 knots put the knot
spacing at about half the range the smoother starts from, in the spirit of
max.edge in two dimensions. Ten of them leave the knots further apart
than that range, and it collapses towards zero as a result.
An fm_mesh_1d with k basis functions
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.