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.

502 questions
49
votes
2 answers

Are splines overfitting the data?

My problem: I recently met a statistician that informed me that splines are only useful for exploring data and are subjected to overfitting, thus not useful in prediction. He preferred exploring with simple polynomials ... As I’m a big fan of…
Max Gordon
  • 5,616
  • 8
  • 30
  • 51
41
votes
1 answer

Intuition behind tensor product interactions in GAMs (MGCV package in R)

Generalized additive models are those where $$ y = \alpha + f_1(x_1) + f_2(x_2) + e_i $$ for example. the functions are smooth, and to be estimated. Usually by penalized splines. MGCV is a package in R that does so, and the author (Simon Wood)…
generic_user
  • 11,981
  • 8
  • 40
  • 63
31
votes
2 answers

Comparing smoothing splines vs loess for smoothing?

I wish to better understand the pros/cons for using either loess or a smoothing splines for smoothing some curve. Another variation of my question is if there is a way to construct a smoothing spline in a way that will yield the same results as…
Tal Galili
  • 19,935
  • 32
  • 133
  • 195
25
votes
1 answer

Setting knots in natural cubic splines in R

I have data with many correlated features, and I want to start by reducing the features with a smooth basis function, before running an LDA. I'm trying to use natural cubic splines in the splines package with the ns function. How do I go about…
Belmont
  • 1,273
  • 3
  • 12
  • 16
24
votes
5 answers

Why is the use of high order polynomials for regression discouraged?

I've read many times on this site that high order polynomials (generally more than third) shouldn't be used in linear regression, unless there is a substantial justification to do so. I understand the issues about extrapolation (and prediction at…
Marco Rudelli
  • 550
  • 1
  • 11
23
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
  • 820
  • 1
  • 7
  • 18
23
votes
6 answers

Advanced regression modeling examples

I'm looking for an advanced linear regression case study illustrating the steps required to model complex, multiple non-linear relationships using GLM or OLS. It is surprisingly difficult to find resources going beyond basic school examples: most of…
22
votes
2 answers

The definition of natural cubic splines for regression

I am learning about splines from the book "The Elements of Statistical Learning Data Mining, Inference, and Prediction" by Hastie et al. I found on page 145 that Natural cubic splines are linear beyond the boundary knots. There are $K$ knots,…
Durin
  • 964
  • 2
  • 7
  • 17
22
votes
1 answer

Can splines be used for prediction?

I cannot be specific about the nature of the data as it is proprietary, but suppose we have data like this: Each month, some people sign up for a service. Then, in each subsequent month, those people may upgrade the service, discontinue the service…
Peter Flom
  • 94,055
  • 35
  • 143
  • 276
21
votes
4 answers

How should I check the assumption of linearity to the logit for the continuous independent variables in logistic regression analysis?

I am confused with the assumption of linearity to the logit for continuous predictor variables in logistic regression analysis. Do we need to check for the linear relationship while screening for potential predictors using univariable logistic…
21
votes
3 answers

Splines vs Gaussian Process Regression

I'm know that Gaussian Process Regression (GPR) is an alternative to using splines for fitting flexible nonlinear models. I would like to know in which situations would one be more suitable than the other, especially in the Bayesian regression…
ved
  • 962
  • 5
  • 15
20
votes
1 answer

Can lmer() use splines as random effects?

Say we're working on a random effects model of some count data over time, and we want to control for some trends. Normally, you'd do something like: lmer(counts ~ dependent_variable + (1+t+I(t^2)|ID), family="poisson") to include a quadratic shape…
Fomite
  • 21,264
  • 10
  • 78
  • 137
19
votes
2 answers

What are the advantages / disadvantages of using splines, smoothed splines, and gaussian process emulators?

I am interested in learning (and implementing) an alternative to polynomial interpolation. However, I am having trouble finding a good description of how these methods work, how they relate, and how they compare. I would appreciate your input on…
David LeBauer
  • 7,060
  • 6
  • 44
  • 89
19
votes
2 answers

Visualizing a spline basis

Textbooks typically have nice example plots of of the basis for uniform splines when they're explaining the topic. Something like a row of little triangles for a linear spline, or a row of little humps for a cubic spline. This is a typical…
Patrick Caldon
  • 1,523
  • 10
  • 11
19
votes
3 answers

Fitting multivariate, natural cubic spline

note: with no correct answers after a month, I have reposted to SO Background I have a model, $f$, where $Y=f(\textbf{X})$ $\textbf{X}$ is an $n \times m$ matrix of samples from $m$ parameters and $Y$ is the $n \times 1$ vector of model…
1
2 3
33 34