DemoNull {gps}R Documentation

Demonstrate the null space of P-splines

Description

Cubic P-splines set up with non-uniform B-splines and a 2nd order standard or general difference penalty are fitted to observations simulated from y = x. Should the resulting standard or general P-splines have the correct null space, the limiting fit at \lambda = +\infty 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. Results show that standard P-splines have an incorrect and unpredictable limiting behavior that is sensitive to knot locations, whereas general P-splines have a correct and consistent limiting behavior.

Usage

DemoNull(n, k, gps = FALSE)

Arguments

n

number of simulated observations from y = x.

k

number of interior knots to place.

gps

if TRUE, fit general P-splines; if FALSE, fit standard P-splines.

Value

This function has no returned values.

Author(s)

Zheyuan Li zheyuan.li@bath.edu

Examples

require(gps)

## standard P-splines
DemoNull(n = 100, k = 10, gps = FALSE)

## general P-splines
DemoNull(n = 100, k = 10, gps = TRUE)

[Package gps version 1.2 Index]