Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
The results are in! See what nearly 90,000 developers picked as their most loved, dreaded, and desired coding languages and more in the 2019 Developer Survey.

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).

0
votes
0answers
10 views

Thin Plate Regression Splines mgcv

I am struggling on the understanding of thin plate regression splines. I already found a very helpful answer here in cross-validated: smoothing methods for gam in mgcv package but I still have some ...
2
votes
1answer
16 views

understanding derivatives of a regression spline

I am trying to understand why regression splines are continuous at their knots Suppose I am fitting a regression spline $$ E[Y|X] = \alpha + \beta_1 x + \beta_2 (x - t)^+ $$ where $(x - t)^+ = \...
1
vote
0answers
21 views

How to measure the amount of confounding in tensor interaction in GAMs?

I am interested in fitting an additive model with tensor interaction terms. This construction is described in Wood (2006) and used in the mgcv ...
0
votes
0answers
12 views

Interpretation of cox.zph Output with Smoothing Splines in R

In Luke Keele's paper, "Covariate Functional Form in Cox Models", Dr. Keele carries out two Grambsch and Therneau non-proportionality tests, that is, one for a model without splines and one for a ...
0
votes
0answers
11 views

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 ...
1
vote
0answers
47 views

Smoothing splines as basis expansion

I am following the discussion on chapter 5 of Elements of statistical learning which discusses basis expansion using splines. The data set I used is the Ozone data which can be found at :http://web....
1
vote
0answers
21 views

how many knots used in bs() [closed]

If I fit the following model to some data m_splines <- lm(data$y ~ bs(data$x, df = 6)) how do I know how many knots have been used for the cubic spline?
0
votes
1answer
48 views

Natural spline term in GAM

Is it advisable to use natural regression spline basis? I learned that in R the supported smoothers in gam are the lo, ...
0
votes
0answers
16 views

Simulating data for Spline Regression

I am making some simulation in order to show the performance of the Spline Regression vs other methods like Smoothing Splines, Hodric Prescott filter, etc., I would like to knot if it's better to ...
0
votes
0answers
43 views

natural cubic spline with four degrees of freedom

The following image was clipped from the text book "An introduction to statistical learning": My question is why it's 4 dof? In the book, the reason is given as: 4There are actually five knots, ...
0
votes
1answer
46 views

Regression for curve fitting

For a curve generated from dataset points, split the curve into parts and obtain the best-fit degree of polynomial,coeffcients and the interval/range of the split through implementation in python.I am ...
0
votes
1answer
53 views

FIND KNOTS IN REGRESSION

To find the knots automatically in piecewise polynomial regression, which concept is BEST, cubic splines or k fold cross-validation in python
2
votes
0answers
101 views

Difference between s() and ti() terms in mgcv package when applied to one variable

I am using the mgcv package in R to fit logistic GAMs to survey data. In one of my models I use an interaction between two covariates. I am currently trying to fit ...
0
votes
0answers
21 views

Inestability of BIC when selecting nested models

Currently I am working with spline regression and a method for selecting knots adaptively. My method gives me a set of potential knots that generally has a large number of elements. Following He et al....
1
vote
0answers
28 views

R: creating (non-B) splines?

I want to replicate in R figures 5.1 and 5.2 of the Elements of Statistical learning (Hastie et al), . The authors show how to derive a cubic splines. These splines are not in the B-basis. Can I use ...
0
votes
0answers
42 views

Comparing AIC, BIC and HQC for selection of nested model

I am working with spline regression and in this step what I want to do is to somehow reduce the number of knots by applying backward selection. Technically what I am doing is to delete sequentially ...
0
votes
0answers
23 views

Do we need ergodic-stationarity of the response variable in OLS spline regression?

I was wondering if we need the response variable to be ergodic stationarity when estimating an OLS spline regression. My intuition tells me that it's not needed but I would like to have a confirmation ...
10
votes
5answers
3k views

Why should binning be avoided at all costs?

So I've read a few posts about why binning should always be avoided. A popular reference for that claim being this link. The main getaway being that the binning points (or cutpoints) are rather ...
1
vote
0answers
58 views

LASSO regression: which method is better for selecting $\lambda$ in this case?

I am currently working on a method for adaptive knot placement in Spline regression. Following Osborne et.al. (1998), Yuan et.al. (2014) I am interested in using LASSO regression to select a subset of ...
0
votes
0answers
50 views

Multivariate Adaptive Regression Splines interpreting hinge coefficients

I am learning MARS using the earth package in R. I read about MARS on page 321 of The Elements of Statistical Learning https://web.stanford.edu/~hastie/Papers/ESLII.pdf and the tutorial here http://...
0
votes
0answers
18 views

Piece wise Polynomial Regression [duplicate]

It's wide known that for polynomial interpolation Chebyshev sites (as knots) are almost optimal, we can show that using those the Lebesgue constant is near to the lower bound. Is that claim also ...
4
votes
0answers
82 views

Estimating Spline curve by OLS. Is a good idea to fix the knots at Chebyshev sites?

I am writing my master's degree thesis on a novel method for fixing knots in an adaptive way and while reading the literature I've found many references to the so-called Chebyshev sites. This sites or ...
0
votes
0answers
118 views

degree of freedom for natural n-spline

According to the statistical learning book ISLR (or ESL), we know that the degrees of freedom (df) for (common) $n$-spline (regression spline, based on the $n$-polynomial) with $K$ knots is $$(n+1)(K+...
0
votes
0answers
20 views

thin-plate spline projection pursuit regression?

Is projection pursuit regression limited to univariate smoothing splines only? I am essentially looking for a multivariate ppr method. Is there such a method that searches for the most curved surfaces ...
0
votes
0answers
34 views

Estimation of function using Spline Interpolation

My problem is the following: Estimate the function from given data (below) and show that the estimated function has the following properties: (i) $f(0)=0$ (ii) $f(x)>0, x>0$ and $f(x)<0, x<...
2
votes
1answer
57 views

GAM using a cyclic spline improves residual structure but reduces fit

I'm working on a dataset monitoring soil moisture levels throughout the summer. The general trend in the data is the following: When I use a GAM with default thin-plate spline and AR(1)process there ...
1
vote
1answer
44 views

How to achieve linear relationship between predictors and logit of outcome?

Prior to conducting a logistic regression of the 0/1 likelihood of a nest hatching or failing as a function of 9 continuous predictors, I plotted each of the standardized (mean = 0, SD = 1) predictors ...
1
vote
0answers
37 views

Adaptive knot selection for B-spline fitting

When fitting a B-spline for regression purposes I've seen a lot of cases where knots are fixed uniformly ,but in some situations this could lead to poor estimations because the behaviour of the curve ...
2
votes
1answer
105 views

Construct piece-wise linear mixed effect models

I'm looking at the BMACS dataset(data(BMACS)), and is trying to construct a local constant fit without covariates using base functions B1(t) = 1 for t < 2, B2(t) = 1 for 2 <=t <4 and B3(t) = ...
2
votes
0answers
25 views

Non-linear regression. Obtain B.spline coefficients using Fourier Transform?

I came up with a idea to estimate the coefficients of a B-spline fit by using the Fourier Transform but I don't know if it makes any sense to estimate them in this way. Given that $$s(x)=\sum_kc(k)\...
1
vote
0answers
28 views

Thin Plate Regression Spline Problem

I fitted a Thin Plate Regression Spline into some non-linear relationships and I get good results, but I had problems in the tails of the distributions. Someone knows what could be the cause of this ...
0
votes
1answer
36 views

Fixed effects model for surface growth

I am trying to fully understand and reproduce the paper Normative brain size variation and brain shape diversity in humans, in which the authors have used brain surface measurements from many ...
2
votes
0answers
48 views

why not chosing always a spline?

I'm having a quite simple question: Why is a spline fit not the best choice everytime? In other words: How do I separate a spline fit from a kernel smoother or a polynomial in a meaningful way? I'm ...
1
vote
0answers
48 views

Natural Splines and Smoother Matrix

In the context of smoothing splines, one can show that the Reinsch form is given by: $ \hat{y} = N (N^{T}N +\lambda \Omega)^{-1}N^{T} y = (I+ \lambda K)^{-1}y $ where (1) $K = (N^{T})^{-1}\Omega N^{-...
6
votes
1answer
133 views

Why are natural splines almost always cubic?

By natural spline, I mean a regression spline that's linear at the boundary (i.e. the regions where X is smaller than the smallest knot or larger than the largest knot). I know that for smoothing ...
1
vote
1answer
25 views

Partial spline. Reference

I have a well done and perfectly working protocol to smooth my experimental data. I do the following: I have a variable of size 1000. Iteratively I choose random 100 points and spline them using the ...
2
votes
1answer
90 views

GAM interaction- how to interpret

I am working with a GAM model (based on a negative binomial distribution): model_n = gam(y ~ x1 +x2+ x3+x4 + s(x5)+x6+s(acc, by=ses)+x7+x8+ x9+x10, data=totalfinals, family=negbin(3)...
1
vote
1answer
165 views

How to interpret the natural spline value in GLM

This is a very basic question but I couldn't figure it out. I am using R to predict premium based on current premium. ...
2
votes
1answer
52 views

Show that solution to cubic smoothing spline reduces to regular least squares minimization as $\lambda$ approaches infinity

I am asked to show that the solution to a smoothing splines problem of the form $$ \text{PRSS}(f,\lambda) = \sum_{i=1}^N\left[y_i-f(x_i)\right]^2 + \lambda \int f''(t)^2 dt, $$ with $$ f(x) = \sum_{j=...
1
vote
1answer
74 views

Generalized additive models - formula for basis functions

I'm trying to understand the basics of GAMs. Wood's book "Generalized Additive Models: an introduction with R" introduces GAMs via a cubic spline basis $b_j(x)$ (see p. 122), where $b_1(x)=1, b_2(x)=...
1
vote
1answer
140 views

Interpretation of Tensor product splines with multiple terms and their standard errors?

I am trying to understand the tensor product splines such as ...
0
votes
0answers
57 views

GAM and Bayes models

I am wondering whether GAMs with splines can be translated into simpler models. Splines require a lot of coding if you don't use existing functions. Imagine you have a time series model $y_t = a + ...
1
vote
1answer
317 views

Extracting significance of gam smoothing terms

I have a time course data to which I'd like to fit a gam and have easy interpretability, and by that I mean obtaining coefficient...
0
votes
0answers
24 views

Best method for a prediction model with a spline term

I would like to run a prediction model on a dataset of about 500- outcome is binary. One of my continuous predictors is non-linear and I am interested in a total of 7 predictors. What is the best ...
0
votes
0answers
24 views

How can I do monotonic smoothing in R? [duplicate]

I would like to create a monotonic smoothing function to transform vectors such that I reduce their spikes (i.e., noise) while maintaining their trend. The problem I am encountering with standard ...
0
votes
0answers
70 views

Generalized Additive Models: How to fit models with the LMS method by Cole?

I have some problems to understand the univariate generalized models that were proposed by Cole (1992). My question is how the fitting procedure works described in the appendix. More specific, how to ...
3
votes
2answers
216 views

Cox PH model: managing continuous variables and linearity assumption

In an epidemiological study, I'm using martingale plot to assess the linearity of continuous variables. Here are the Martingale Residuals (from Null Model) using R's ...
0
votes
0answers
15 views

Interpreting cox.zph from a spline

I'm trying to follow the steps outlined in Like Keele's paper, "Proportionally Difficult: Testing for Nonproportional Hazards in Cox Models." He encourages one to first identify if a nonlinear spline ...
-1
votes
0answers
88 views

Interpreting cox.zph from a spline

I'm trying to follow the steps outlined in Like Keele's paper, "Proportionally Difficult: Testing for Nonproportional Hazards in Cox Models." He encourages one to first identify if a nonlinear spline ...
1
vote
1answer
117 views

Poor regression results of neural networks on 2d benchmark data (compared to spline interpolation)

I try to understand for which regression tasks neural networks might be useful. One benchmark for me is to reproduce the ability of scipy.interpolate.griddata: ...