np | R Documentation |
np
accepts one or two numeric vectors of equal length as inputs. From these inputs, univariate or bivariate smoothing design matrices are produced. Currently available basis functions are truncated polynomials and thin plate splines.
When bivariate smoothing is selected, np
calls create_bivariate_design
.
np(x1, x2 = NULL, num_knots = NULL, knots = NULL, basis = "tps", degree = 3)
x1 |
numeric vector |
x2 |
optional vector for bivariate non-parametric function |
num_knots |
optional number of knots |
knots |
optional numeric vector of knots |
basis |
character vector for basis function. |
degree |
for truncated polynomial basis function |
list with the following elements:
X
parametric design matrix
Z
non-parametric design matrix
knots
numeric vector of knots for the model
Xnms
names of parameters passed to np
basis
selected basis function
degree
degree for truncated polynomial basis function
Ruppert, David, Matt P. Wand, and Raymond J. Carroll. Semiparametric Regression. No. 12. Cambridge university press, 2003. Section 5.6.
Matt Wand (2018). SemiPar: Semiparametric Regression. R package version 1.0-4.2.
x1 <- rnorm(100) res <- np(x1, num_knots=10, basis="trunc.poly", degree=2) res
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.