| coef.lgspline | R Documentation |
Returns the per-partition polynomial coefficient lists from a fitted lgspline model.
## S3 method for class 'lgspline'
coef(object, ...)
object |
A fitted lgspline model object. |
... |
Not used. |
Coefficient names reflect the polynomial expansion terms, e.g.:
intercept
v: linear term for predictor v
v_^2: quadratic term
v^3: cubic term
_v_x_w_: two-way interaction
Column/variable names replace numeric indices when available.
To get all coefficients as a single matrix:
Reduce('cbind', coef(model_fit)).
A list of per-partition coefficient vectors. Returns NULL with a
warning if object$B is not found.
lgspline
set.seed(1234)
t <- runif(1000, -10, 10)
y <- 2*sin(t) + -0.06*t^2 + rnorm(length(t))
model_fit <- lgspline(t, y)
coefficients <- coef(model_fit)
print(coefficients[[1]])
print(Reduce('cbind', coefficients))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.