ps: Function for setting up p-spline smooths

Description Usage Arguments Examples

View source: R/design_matrices.R

Description

Function for setting up p-spline smooths

Usage

1
2
ps(x, norder, k, data, by = NULL, ref = NULL, width = NULL,
  delta = 1e-07, center = TRUE)

Arguments

x

vector evaluation points (typically time)

norder

scalar order of B-spline bases (order k is degree k-1)

k

scalar k+1 is order of finite difference matrix

data

dataset in which to evaluate arguments

by

optional character string designating varying coefficient

ref

optional reference level of by variable

width

scalar width of B-spline bases

delta

scalar place upper knot in B-spline basis at max(x) + delta

center

TRUE/FALSE if True, impose centering constrain on non-variable coefficient models

Examples

1
2
3
4
5
6
7
library(psplinesl1)
data(simData)

# setup p-spline matrices
X <- list(ps(x = "x", data = simData, 
             norder = 2, k = 1, width = 0.05,
             center = TRUE))

bdsegal/psplinesl1 documentation built on July 22, 2019, 11:38 a.m.