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

Filter by
Sorted by
Tagged with
1 vote
1 answer
23 views

Positive Semidefinite Kernel in RKHS

The following shows part of the page 170 of The Element of Statistical Learning that I want to make clear. The solution can be characterized in two equivalent ways $$\min_{c_j}\sum_{i=1}^N(y_i - \...
jason 1's user avatar
  • 175
11 votes
2 answers
909 views

Do fractional polynomials have any advantages over restricted cubic splines?

My understanding is that fractional polynomials and restricted cubic splines serve similar purposes. However, cubic splines are much more widely used outside statistics, and I have a better (...
Mohan's user avatar
  • 627
1 vote
1 answer
67 views

Regularization Problem and Reproducing Kernel Hilbert Space

The following shows part of the page 169 of The Element of Statistical Learning that I want to make clear. We have $$\min_{f \in \mathcal H_K}[\sum_{i = 1}^NL(y_i, f(x_i)) + \lambda\Vert f\Vert_{\...
jason 1's user avatar
  • 175
0 votes
0 answers
14 views

Knots in regression and the dummy variable trap

I am running a knot-like type of regression and have a couple of questions: Imagine that we are working with daily data that spans over $3$ years. Consider the following model: $y_t = \beta_{0, t} + ...
richard baws's user avatar
0 votes
0 answers
31 views

Why does a 1-knot spline regression have 3 coefficients?

I've been learning about spline regressions, and I'm trying out a statsmodels negative binomial spline regression as a changepoint detector for a time series of count data. I'm pretty confused about ...
NateV's user avatar
  • 139
0 votes
0 answers
41 views

splines ns() identifiability

I would like to understand what are the identifiability constraints implemented by ns() in R. I know that common approaches are dropping intercept or some summation ...
GAMer's user avatar
  • 113
1 vote
0 answers
22 views

Hoe to choose a spline for expression data (mRNA and proteins)

I'm using timeOmics to model a time series of expression data on mRNA and proteins data. The amount of samples is rather small (7 groups, 2-7 samples per group) but the features space is rather large (...
Sebastian Hesse's user avatar
1 vote
1 answer
51 views

Knots selection testing for Natural Cubic Splines model in R

I have a dataset of Japan's Mortality rate and want to fit a natural cubic spline to this mortality data. The choice of knots are subjectively chosen at 10, 20, 30,...,90. I want to know whether or ...
JaFranke's user avatar
3 votes
1 answer
60 views

mgcv gam P-value vs plotted confidence intervals

I am trying to figure out how to explain the apparent discrepancy between P-values and plotted confidence intervals in mgcv. See for example the plot below that comes from a model that considers the ...
dean's user avatar
  • 333
3 votes
1 answer
60 views

Splines, logistic regression and sample size considerations

I have around 500 observations with a binary outcome at 25% prevalence and will be building an internally validated prediction model. I want to use splines to model non linearity in my continuous ...
blueberry's user avatar
0 votes
0 answers
15 views

Integrating splines over a set of cells

Let $f(s) = \sum_{i=1}^p \beta_i \phi_i(s)$ such that $f: \mathbb{R}^2 \mapsto \mathbb{R}_+$ and the $\phi_i$ are splines (B-splines or Thin-plate splines) and suppose we are interested in $W\subset ...
BelwarDissengulp's user avatar
2 votes
1 answer
75 views

choice of m (order of derivative) for MGCV splines

I am working on a project that aims to estimate the association between a certain marker in blood and risk of an adverse cardiovascular outcome. Conventionally, a clinical threshold for the marker has ...
dean's user avatar
  • 333
1 vote
0 answers
10 views

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's user avatar
  • 33
0 votes
0 answers
13 views

Doubts about Computations for Splines (B-splines) in The Elements of Statistical Learning

On page 186, the augmented knot $τ$ is used and it says that $τ$ takes all equal values and is equal to $ξ_0$ and $ξ_{K+1}$. Next, the definition of the basis function $B_{i,m}$ says that $x$ takes 1 ...
abraxas's user avatar
  • 33
0 votes
0 answers
13 views

Cubic spline with circular predictor [duplicate]

I have a set of observations $y_i$ for a set of values of the independent variable $x_i$. $x_i$ takes values of angles, so it is a circular variable. Is there some method to perform cubic splines or ...
dherrera's user avatar
  • 1,027
1 vote
0 answers
43 views

Interaction between two splines in regression analysis

I am modelling differences between the risk of getting chronic kidney disease (CKD) between two groups, group A and B. I have very long follow-up time, approx. 30 years. The trouble is that CKD ...
Themistokles's user avatar
1 vote
0 answers
23 views

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 + ...
RJH's user avatar
  • 11
1 vote
0 answers
70 views

Time varying coefficients with splines in Cox model

I am wondering whether it is valid to fit spline interactions between time and predictor variables (either categorical or continuous) in a Cox model. I am having difficulties specifying this model, ...
user167591's user avatar
2 votes
1 answer
148 views

mgcv: Use of s() or te() with interactions in GAMs?

I am trying to model CO2 fluxes (fco2) using a number of environmental parameters using a GAM in mgcv. Specifically, I have leaf temperature (tl), vapour pressure deficit (vpd), and soil water content ...
J-M's user avatar
  • 23
1 vote
1 answer
27 views

Splines with a knot that varies by factor level

I have data that reaches a peak then declines. While I might do this as segmented or spline regression, there is a complication. The position of the knot appears to differ depending on the level of a ...
Bryan's user avatar
  • 1,170
0 votes
0 answers
7 views

Selecting sparse number of predictors each derived from a non-sparse b-spline in time

I have observations that I would like to model as responses at stations to slowly time-varying inputs at 80 candidate locations, few (perhaps 5-10?) of which are active and significant. I have ...
Eli S's user avatar
  • 201
3 votes
0 answers
130 views

Longitudinal RCT modeling of continuous time

I have data from an intervention study (10 clinics, 5 control, 5 treatment). The outcome is counts, and we have monthly data at baseline, treatment active phase, and post treatment phase. The number ...
user167591's user avatar
0 votes
1 answer
35 views

How to construct cardinal spline bases

I would like to know how to algebraically construct cardinal spline bases, as I would like to make a prediction with a natural cubic spline model which uses them; however, the only source I have found ...
Florent H's user avatar
  • 153
0 votes
0 answers
55 views

Restricted Cubic Spline-RCSPLINE macro

I have to manually create basis functions for a variable but SAS doesn't seem to have a procedure to do it. I am using Frank Harrell's macro RCSPLINE but the basis variables are not identical to ...
Pam G's user avatar
  • 13
0 votes
0 answers
23 views

Adjusting splines for covariates

I consider fitting cubic splines in R. Question: How can I include covariates in my spline model? The first few lines of my toy dataset are as follows ...
user7064's user avatar
  • 2,173
0 votes
0 answers
21 views

What is the basis generally used in software for the natural cubic splines?

Of course there are many natural cubic spline bases, but reading through documentation (mgcv, splines in R and patsy, scipy.interpolate and csaps in Python) sheds no light on which ones are used in ...
qp212223's user avatar
  • 163
2 votes
1 answer
44 views

Recovering nonlinear functional effects (in a GAM framework) using spline design matrices

I designed a simulation example to understand how splines can work in modeling non-linear functional effects of covariates in a regression framework. I generated the data from the following model: $$ ...
hbaghishani's user avatar
1 vote
0 answers
97 views

Non-linear model where the prediction is computationally fast

I am looking for a fast model that can fit several predictors $X$ to a non-linear response $y$. To show examples of the non-linearity of the response, I have generated the plots below by sampling ...
Florent H's user avatar
  • 153
11 votes
4 answers
1k views

Use of splines in parameter estimation

The question here is about a passage in the very frequently (10,000+) cited paper by Storey and Tibshirani "Statistical significance for genomewide studies" (https://doi.org/10.1073/pnas....
Elmar Zander's user avatar
1 vote
1 answer
181 views

Restricted Cubic Spline interpretation and missing estimate?

I am running a RBS with 5 knots and I have 2 difficulties. I get only 5 estimates: 1 for the intercept, one for the linear term, and 3 for the knots. However, since I have 5 knots I should have 4 ...
FrAiello's user avatar
0 votes
0 answers
39 views

How are the TPRS functions estimated in GAM using the mgcv package in R? [duplicate]

I have generated a dataset with two covariates x1 and x2 and have fitted a gam model with k=5. The R code is as follows: ...
T_S's user avatar
  • 21
1 vote
0 answers
158 views

Reconstruct a natural cubic spline from its fitted coefficients

Consider a predictor $X$ that predicts a non-linear response $y$. A natural cubic spline with $K$ knots can be fit to $y$. Several different linear basis expansions in $X$ can be used to fit the ...
Florent H's user avatar
  • 153
0 votes
0 answers
19 views

Equation of a natural spline vs just a spline

A spline of order $r$ (with $K$ knots) can be written as: $$f(x) = \sum_{i=0}^{r-1}\beta_i x^{i} + \sum_{j=1}^K b_j(x-\kappa_{j})^{r-1}_+$$ A natural spline is defined as a spline that has order $2r$ ...
AyamGorengPedes's user avatar
2 votes
0 answers
73 views

How to compute P-splines penalties with Harville's algorithm?

I am trying to understand how to actually implement the Harville-Fellner-Schall algorithm for the estimation of the P-splines penalties presented in Appendix E (Sec. E.2) of Marx and Eilers [1]. Let ...
Arrigo Benedetti's user avatar
2 votes
0 answers
40 views

How to use generalized additive models where all the functions to estimate are the same?

I've this kind of equation that I'd like to estimate using R : $t_i = \alpha_1 f(x_{1i}, y_{1i})+\alpha_2 f(x_{2i},y_{2i})+\epsilon_i$. $t_i \in [0,1]$. $\alpha_1$ and $\alpha_2$ are known. I observe $...
Leaflet_shiny's user avatar
0 votes
1 answer
93 views

Regression splines- how to use them inside a model?

First of all, apologies but my stats knowledge is limited and based on very isolated topics! From what I understand, regression splines are used when the covariates "aren't linear". What ...
Wojty's user avatar
  • 53
1 vote
0 answers
58 views

Natural Spline Interpolation in R [closed]

I am trying to construct a natural cubic spline interpolation using R and test it with a Runge test function. I have implemented the following code; however, the interpolation is not passing through ...
j1234's user avatar
  • 11
5 votes
1 answer
212 views

Spline basis explicitly including a linear term; basis functions generated by the default call to "s()" function of mgcv package

I'm curious about the basis functions generated by the call to "s()" function with default parameter values, but even more specifically I'm curious about a smoother for a single variable ...
UsDAnDreS's user avatar
  • 139
1 vote
0 answers
40 views

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&...
esefik's user avatar
  • 11
0 votes
0 answers
33 views

Interpreting cubic splines graph where plot doesn't go to final knot

I have this plot where I found that the best degree of freedom is 8, as it minimizes the SSE when predicted from the training data. However, the graph does not go into the final 8th knot in the spline....
Sam's user avatar
  • 1
0 votes
0 answers
56 views

Optimising a piecewise polynomial model's objective function under constraints

Consider a piecewise polynomial model, the model takes the form \begin{align} Y &= g(X)+\epsilon\\ &\approx \begin{cases} \alpha_0+\alpha_1X, & \text{if $X<c$}\\ \beta_0+\beta_1X, & ...
ccy's user avatar
  • 76
3 votes
1 answer
213 views

Functional analysis in R with fda

I'm working with time series data for drug response. And, I wanted to as is there are some alternative ways to analyse it since the FDA package in R is not working in my case. The type of my data is ...
Rosa Maria's user avatar
1 vote
1 answer
350 views

Presenting spline terms from a Cox model

In the Survival vignette entitled "Spline terms in a Cox model" https://cran.r-project.org/web/packages/survival/vignettes/splines.pdf on page 3 there is this graph: The plot is showing the ...
user167591's user avatar
2 votes
2 answers
312 views

Linear spline and 'interaction' p value

Wondering if someone can help clarify my intuition on this. Say you have a continuous covariate and a binary grouping variable and you introduce an interaction term between the two in a basic ...
LucaS's user avatar
  • 517
1 vote
1 answer
191 views

How to identify significant variables in a binary logistic regression?

I am a beginner in statistics and R. I want to run a binary logistic regression to understanding (modeling) factors affecting nest-site selection in a bird species. I have Presence/Absence(0,1) data ...
Mostafa Ahmadi's user avatar
2 votes
1 answer
430 views

Restricted cubic spline looks like a linear curve, but p for nonlinear < 0.001

I am analyzing a association between a frailty index and care needs using the cox model. I use R and use rms package to fit restricted cubic spline. This is my R code. ...
li jiaqi's user avatar
0 votes
0 answers
47 views

Identifiability of simple varying coefficient model

I am working with this simple, bivariate varying coefficient model: $$ d(x_i,y_i) = s(y_i)x_i + c(y_i) + o(x_i) + w_i, \qquad i=1,\ldots m, $$ where $x$ and $y$ are covariates, $d(x,y)$ is a data ...
Arrigo Benedetti's user avatar
0 votes
0 answers
229 views

Knots in splines method, ns and rcs in R [duplicate]

Actually I want to use "ns" method but since I have a problem (Error in visualize splines logistic regression with ns) to visualize log odds with "ns" method I forced to use "...
Mostafa Ahmadi's user avatar
2 votes
0 answers
33 views

Approaches to (non-linear) meta-regression to estimate the conditional population distribution of $y$ based on aggregate data

I want to estimate the distribution of a variable in certain subgroups of the population based on pooling of aggregate data reported in various observational studies. For simplicity, assume there is a ...
user9794's user avatar
  • 216
0 votes
0 answers
25 views

comparison of goodness-of-fit under robust circumstances

I have fitted respectively a zero-knot, a one-knot and a two-knot linear spline to my data, and I need some index of goodness-of-fit for model selection. The crucial point is that the splines are ...
zyy's user avatar
  • 125

1
2 3 4 5
13