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

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

1
vote
1answer
32 views

Why do cubic splines need to be continuous at the first and second derivative, but discontinuous at the third?

I'm working through Introduction to Statistical Learning and came upon this: One can show that adding a term of the form $ \beta_4h(x,\xi)$ to the model (7.8) $$y_i = \beta_0 + \beta_1x_i + \...
4
votes
0answers
43 views

When to choose regression splines over smoothing splines? [duplicate]

I am currently studying how to model covariates beyond linearity in order to use them with GAMs for regression / classification purposes. Talking about splines, two types were presented: regression ...
0
votes
0answers
8 views

Determine confidence in estimate from past estimates

I have a population on the order of 10,000 samples. These samples represent individual estimates of a variable, and for each estimate I also have the actual value of the variable. For each sample I ...
0
votes
0answers
9 views

contrast in plotHR for spline HR plot

I am using plotHR to plot spline with hazard ratio - I would like to set my reference point using 'cntrst'. In R: plotHR(mfit, term="td_macce30d_map", plot.bty="o", xlim=c(50, 110), xlab="MAP (mm Hg)...
8
votes
1answer
121 views

How different are restricted cubic splines and penalized splines?

I am reading a lot about using splines in various regression problems. Some books (e.g. Hodges Richly Parrameterized Linear Models) recommend penalized splines. Others (e.g. Harrell Regression ...
3
votes
1answer
23 views

How does one intuitively interpret significance of splines/GAM term?

Consider the data dput here. I can predict y from x using a cubic spline: ...
0
votes
1answer
41 views

splinefun build in function in R-programming

> t<-seq(0,1,len=5) > x<-matrix(c(1.3,2.3,21,2.4,3.8,9,4.5,11.3,4.2,7.8),2) > s1 <- splinefun(t, colMeans(x), method = "monoH.FC") > plot(s1) ...
0
votes
0answers
18 views

Vector of slopes in spline

I want to fit a hermite spline, I saw a build in splinefunH function in R https://www.rdocumentation.org/packages/stats/versions/3.5.3/topics/splinefun. But I don't understand how to find the vector ...
1
vote
1answer
36 views

Censoring linearly splined predictor in regression

I'm developing a logistic regression where one of the independent variables has a non-linear relationship to the probability of the event occurring. I have created linear splines based on this ...
2
votes
3answers
130 views

Problems interpreting GAM output

I have been advised to run General Additive Models to be able to describe trends in my data, my data being animal harvest numbers by year. I have done so, but have a problem with interpreting the ...
2
votes
0answers
85 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
22 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
24 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
43 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 ...
1
vote
0answers
20 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
53 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
37 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
84 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
105 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
51 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
92 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
1answer
179 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
26 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
29 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
78 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
24 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
67 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
83 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
87 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
182 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
21 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
35 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
72 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
53 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
40 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
172 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
27 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
31 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
51 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
56 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
153 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
27 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
113 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
218 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
61 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
92 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)=...