DemoNull | R Documentation |
Demonstrate the limiting behaviour of a P-spline at \lambda = +\infty
. A cubic P-spline set up with non-uniform B-splines and 2nd order difference penalty is fitted to observations simulated from y = x
. If this P-spline has the correct null space, its limiting fit will be a straight line regardless of knot locations. In this demo, non-uniform knots from different distributions (primarily Beta distributions with varying shape parameters) are attempted. The result shows that when handling non-uniform B-splines, standard P-spline has an incorrect and unpredictable limiting behavior that is sensitive to knot locations, whereas general P-spline has a correct and consistent limiting behavior.
DemoNull(n, k, gps = FALSE)
n |
number of simulated observations from |
k |
number of interior knots to place. |
gps |
TRUE to fit general P-spline; FALSE to fit standard P-spline. |
This function has no returned values.
Zheyuan Li zheyuan.li@bath.edu
require(gps.mgcv)
## standard P-spline
DemoNull(n = 100, k = 10, gps = FALSE)
## general P-spline
DemoNull(n = 100, k = 10, gps = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.