Description Usage Arguments Details Value
This function fits an optimal spline function to the given data set after choosing optimal degree of the polynomial and optimal number of knots by cross-validation.
1 | fitSpline.cv(x, y)
|
x |
independent variable values. |
y |
dependent variable values |
The equation of a spline with degree p and q knots ξ_1, ξ_2, ..., ξ_q is
y = β_0 + β_1 * x + β_2 * x^2 + ... + β_p * x^p + γ_1 * (pos(x - ξ_1))^p + ... + γ_q * (pos(x - ξ_q))^p
where pos(u) = u * I(u > 0).
A list containing the following objects.
f.hat |
fitted values. |
p |
degree of the fitted polynomial. |
q |
number of knots. |
beta |
estimated coefficients of the polynomial. |
gamma |
estimated coefficients of the truncated polynomial. |
knots |
location of the knots. |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.