Questions tagged [splines]

Splines are flexible functions, knit together from polynomial parts, used for approximation or smoothing. This tag is for any kind of spline (eg, B-splines, regression splines, thin-plate splines, etc).

See Wikipedia for further references.

627 questions
27
votes
3 answers

Interpreting spline results

I'm trying to fit a spline for a GLM using R. Once I fit the spline, I want to be able to take my resulting model and create a modeling file in an Excel workbook. For example, let's say I have a data set where y is a random function of x and the…
Eric
  • 970
  • 1
  • 9
  • 19
14
votes
2 answers

Proper terminology for what happens at knots in a cubic spline function

Linear splines are easy to discuss. Knots are where the slopes change, and only one level of continuity is enforced. When discussing cubic splines (with the usual 3 levels of continuity) or natural cubic splines (linear tail restricted cubic…
Frank Harrell
  • 91,879
  • 6
  • 178
  • 397
8
votes
2 answers

what is the advantage of b-splines over other splines?

I only read that it is due to numerical reasons, e.g. on http://einspline.sourceforge.net/background.shtml, but I don't really get it. Can someone please explain it more simple? Is it because they are made of linear combinations? If so, why/how is…
Ben
  • 3,443
6
votes
1 answer

Avoiding a spline dip

First off, I'm not very experienced in math techniques, so I am wide open to suggestions. I am working with a set of data in R. I have a curve (mostly linear at first, peaking suddenly, then decreasing.) I want to smooth it out, so I used a spline…
Valerie S
  • 225
5
votes
1 answer

What is the fitted model for a smoothing spline?

There are a number of useful answers about how to use the fitted model for a smoothing spline to make predictions given a data frame of predictor variables, such as to this question. But, I'm struggling to comprehend what the fitted model is.…
3
votes
1 answer

Smoothing spline

What effect would it have on a smoothing spline to use the third (or fourth) derivative for the penalty term? Specifically, what would be the effect on the RSS if the tuning parameter were to be varied from 0 to infinity? $$ RSS=∑(y_i−f(x_i))^2 +…
gopal-m
  • 31
  • 2
3
votes
1 answer

What is the difference between a model tree and a spline fit?

In my understanding, a model tree recursively partitions a dataset, and then uses a linear regression model at each leaf node. On the other hand, a regression spline adds various piecewise polynomials together to reach a final model. Assuming that…
orange1
  • 587
2
votes
1 answer

For B-spline what does $\sum_{i=0,n}N_{i,k}(t)=1$ mean?

For B-spline what does $\sum_{i=0,n}N_{i,k}(t)=1$ mean? I don't understand what this means cause $N_{i,k}(t)$ are basis functions so what does it mean for them to all sum up to 1?
2
votes
0 answers

Knots in restricted cubic splines as free parameters or pre-assigned?

On p. 26 of Regression Modelling Strategies (2nd ed.) Frank Harrell argues against letting the knots in a RCS be free parameters and for setting them in advance, at various quintiles. He cites several reasons including instability of estimates,…
Peter Flom
  • 119,535
  • 36
  • 175
  • 383
1
vote
2 answers

How to find X value for slope of zero from a natural cubic spline in RStudio

I have a scatter plot that I've fitted with a natural cubic spline with 4 knots using ns(), pictured below: I would like to find the value of x where the slope is zero at the abline pictured below: Is there a straightforward way to do this in…
lilleyb
  • 13
  • 3
1
vote
0 answers

Can you tell me how the recursive computational spline basis functions of Computations for Splines (B-splines) can be used on natural cubic spline?

I'm more confused as to which $N(X)$ of the natural spline the recursively derived basis function corresponds to
abraxas
  • 33
1
vote
0 answers

Why not use discrete Laplacian for the smoothing penalty in multidimensional p-splines?

Papers I have read about p splines in multiple dimensions use some variation of the following idea. The spline is a surface $u(x_1, x_2)$ that that minimizes the objective function $\sum w(u - u')^2 + \lambda_{x_1}\sum(D_{x_1} u)^2 +…
1
vote
0 answers

Degrees of freedom in the npreg ss function

I am using the ss function from the npreg package in R to fit a smoothing cubic spline to my data, where the smoothing parameter is selected by the REML method. The "equivalent degrees of freedom" that is returned after fitting the model is…
esefik
  • 11
1
vote
1 answer

Can I use restricted cubic splines to model non-linear relationships if the underlying variable is not normally distributed?

I am estimating the association between an exposure ("time in therapeutic range", possible values from 0% to 100%)) and time to a binary outcome ("chronic kidney disease"). I would like to assess potential non-linear relationships between the…
LfB
  • 11
1
vote
1 answer

With the same number of knots, will the cubic Truncated power basis (cubic spline) produce the same results as B-spline?

I wrote a thesis on expanding a model with cubic truncated power basis and B-spline. In the defense, one professor pointed out that I should get the same results with the two methods when the number of knots are the same. She said that she referred…
xyz
  • 11
1
2