The package constructs and predicts the general P-splines of Li and Cao (2022) <arXiv:2201.06808> in mgcv by defining a new 'gps' smooth class (see ?gps.smooth). A general P-spline f(x) is specified as s(x, bs = 'gps', ...) in a formula and estimated using mgcv's model fitting functions, namely gam (generalized additive models, or GAMs), bam (GAMs for big data) and gamm (GAMs as mixed-effect models). General P-splines are state-of-the-art penalized B-splines. Unlike the standard P-splines of Eilers and Marx (1996) <doi:10.1214/ss/1038425655> that only make sense for uniform B-splines on equidistant knots, they are properly defined for non-uniform B-splines on irregularly spaced knots, thanks to their powerful general difference penalty that accounts for uneven knot spacing. The package also contains functions for fitting and benchmarking different penalized B-splines (see ?Fit4BS and ?SimStudy) and a case study of smoothing Bone Mineral Content longitudinal data (see ?BMC).
Package details |
|
---|---|
Author | Zheyuan Li [aut, cre] (<https://orcid.org/0000-0002-7434-5947>), Jiguo Cao [fnd] (<https://orcid.org/0000-0001-7417-6330>), Ahmed Elhakeem [dtc] (<https://orcid.org/0000-0001-7637-6360>) |
Maintainer | Zheyuan Li <zheyuan.li@bath.edu> |
License | GPL-3 |
Version | 1.3 |
URL | https://github.com/ZheyuanLi/gps.mgcv |
Package repository | View on GitHub |
Installation |
Install the latest version of this package by entering the following in R:
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.