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
0 votes
0 answers
6 views

How to extract the penalty term from the GAMM function in R and what is used to estimate the penalty terms

Good afternoon all, I'm working on some log GDP data and I am testing out a Generalized Additive Mixed Model for it with a penalized cubic regression spline. I am using the GAMM function from the mgcv ...
user avatar
1 vote
1 answer
43 views

Confirming cubic spline was done on imputed datasets (imputed by mice Package) and the estimate is the pooled based on Rubin's rule

I am performing restricted cubic spline (Cox proportional hazard ratio) after imputing 10 datasets using mice package. My variables as follow: Outcome: DM Exposure: BMI time to events: time Covariates:...
user avatar
  • 25
0 votes
0 answers
30 views

Lspline and bs produce very different coefficients for linear splines - which is preferred?

In the vignette for the lspline package in R it says that the package computes Linear splines with convenient parametrisations ...
user avatar
5 votes
1 answer
344 views

Motivating use of Bayesian splines in excess mortality estimation

I'm reading this paper estimating excess deaths induced by the pandemic. That is, roughly, it constructs a model to estimate how many deaths (from all causes) would have occurred if the pandemic had ...
user avatar
1 vote
1 answer
33 views

How to fit piecewise linear splines or natural cubic splines in mgcv

How do GAMs generate forecasts that are outside the range of the training data? I often need to use regression models for extrapolated forecasts, where the values of the predictors are outside their ...
user avatar
4 votes
2 answers
67 views

Determining spline basis dimension using Wood's statistical test

In Simon Wood's book Generalized Additive Models (2nd ed.) on page 243, he describes the following procedure for checking that the basis dimension is too small: Fortunately informal checking that the ...
user avatar
  • 1,023
0 votes
0 answers
35 views

How to set the number of knots in a regression spline

I want to fit fit a cubic regression spline and select the optimal number of knots via grid search. In other words, I want to find the optimal number of knots that minimizes the average test Mean ...
user avatar
1 vote
1 answer
41 views

How to create a B-spline basis without intercept and linear trend included?

I want to fit the following model using splines: \begin{align} Y(t) = \beta_0 + \beta_1t + \sum_{j=2}^{d} \beta_jB(t)_j \end{align} where $B_j$ are the basis functions. However, when I run the ...
user avatar
0 votes
0 answers
13 views

Selecting characteristics for prediction of stock returns (Adaptive Group Lasso in R)

In attempt to find out what drives the predictive power and not the explanatory power of cross sections of expected return. We attempt to split the characteristics of stocks in quadratic splines, ...
user avatar
  • 1
1 vote
0 answers
32 views

Advice on use of survival vs logistic model

I have a longitudinal dataset from a medical registry where every subject has a certain medical condition. Periodically, each subject is checked for a specific outcome (yes, no) of interest. I have ...
user avatar
1 vote
1 answer
33 views

Interpretion natural spline function ov IV in ordinal regression

I know that this question was already posed several times but I am not sure If I really got the interpretation for spline functions right. I have an ordered model that is regressed on an index ranging ...
user avatar
  • 19
0 votes
1 answer
29 views

GAM - setting K-values before or after testing the different models

I'm working with GAM and I'm testing different models with and without certain variables, and I need to set k-values for the different smoothers. Do I need to use the exact same k-values prior to ...
user avatar
  • 1
2 votes
1 answer
64 views

Should you include time as a continuous predictor when estimating incidence or prevalence?

Suppose one has a time series of disease counts and populations (at risk, total etc.) or, equivalently, binary events of disease status. Then suppose one wanted to present estimates of incidence or ...
user avatar
1 vote
1 answer
65 views

What is a GAM; question about sklearn's SplineTransformer

From my understanding, using basis-spline feature expansion/transformation with fixed parameters (number and placement of knots, etc.), then feeding that into a linear/logistic regression is ...
user avatar
0 votes
1 answer
23 views

Missing Data with Splines

I am modeling data with a gamma response. Two continuous variables in my data set are nonlinear and have a large number of nulls. One option I see is to bin/discretize the variables where the nulls ...
user avatar
  • 185
0 votes
2 answers
37 views

Combining quantile regression with binning

I'm trying to employ a framework where I uncover the marginal effects of the quantiles of one continuous variable on another continuous variable - something analogous to the Quantile-on-quantile (QQR) ...
user avatar
4 votes
2 answers
99 views

Splines feature selection

I remember reading that for a certain kind of splines, all basis functions have to be included when using feature selection methods such as stepwise regression or shrinkage. The argument for that was ...
user avatar
  • 43
0 votes
0 answers
8 views

How to understand the center constraint in spline regression?

Assume that I have a basic understanding of the basis spline functions, basis spline regression, natural spline regression. Then, how should I understand the center constraint in the natural spline?
user avatar
1 vote
1 answer
38 views

Spline model with a constant

I'm working on a reproduction of a model and I am running into some issues with the wording of the model and implementing it into R. The model that I am working with is an Additive AutoRegressive ...
user avatar
0 votes
1 answer
79 views

How to perform Restricted cubic spline (Cox adjusted) after multiple imputation with mice?

Hello I would like to perform restricted cubic spline (Cox adjusted) after multiple imputation with mice.I use rms package. but after imputation when I use the function ...
user avatar
  • 25
2 votes
1 answer
49 views

How well do Multivariate Adaptive Regression Splines work in high dimensional settings?

I have been reading the Hastie and Tibshirani book again lately, and I noticed in Chapter 9 that the mention the MARS algorithm: Multivariate Adaptive Regression Splines, which is a nonparametric ...
user avatar
  • 1,118
0 votes
0 answers
49 views

R: smooth.spline LOOCV-error depends on order?

I wanted to fit a smoothing spline to some data and I noticed that the internally computed LOOCV-error seems to depend on whether the data is unordered or not. Concretely, I only get the expected ...
user avatar
5 votes
1 answer
115 views

Can I interpret coefficients for "Year" as differences between years that are not explained by my predictors?

I am doing statistical analysis of a natural experiment that consists of multiple years of measurements. I have two independent variables that are physically related to ...
user avatar
  • 259
0 votes
1 answer
49 views

Splines free of Gibbs phenomenon for smoothing

I'm trying to do 3-dimensional smoothing of some observations we made. To simplify things, here's a visualisation of one slice of the data we have: Note that the observations are gridded and contain ...
user avatar
  • 122
0 votes
0 answers
45 views

Can "Curve Fitting" be seen as an Alternative to Numerical Differentiation?

For a long time, the following point always confused me: If the "Fundamental Theorem of Calculus" tells us that all real and continuous functions are differentiable (i.e. have derivatives) - ...
user avatar
  • 5,728
0 votes
0 answers
18 views

Difference between bspline and thin plate spline?

I am trying to understand the difference between bsplines and thin plate splines but I cannot find enough information after reading several papers and questions on CV. I would really appreciate if ...
user avatar
8 votes
2 answers
646 views

Ideal Use Cases for Splines

In general, I have often heard of "splines" being referred to as "old models", criticized for being prone to overfit the data, and being considered to be only better than "...
user avatar
  • 5,728
4 votes
1 answer
161 views

Difference between splines from different packages (mgcv, rms etc.)

I recently came across the mgcv package and the great potentiality of GAM. One - maybe naive - question is what is the overall difference (if there is any which is significant) with the gam() function ...
user avatar
0 votes
0 answers
35 views

Convert truncated power basis representation to a B-spline basis representation

Given a cubic spline in a truncated power basis representation: $$f(x)=\beta_0+\beta_1x+\beta_2x^2+\beta_3x^3+\sum_{i=1}^n\beta_{i+3}(x-t_i)_+^3,$$ where $t_1\leq t_2\leq\cdots\leq t_n$ are fixed ...
user avatar
  • 31
2 votes
1 answer
78 views

Is Spline Interpolation suitable for Economic Data

I have GDP data recorded in quarterly and I wish to interpolate it for monthly data. Is the Spline Interpolation suitable for these type of economic data?
user avatar
  • 141
2 votes
1 answer
59 views

Concept Clarification: Logistic Regression Assumption

Here is one of the assumptions under logistic regression: logistic regression assumes linearity of independent variables and log odds. I understand if this assumption is violated, we can then ...
user avatar
3 votes
1 answer
138 views

Restricted Cubic Spline Function Summary Intepretation

I am trying to incorporate spline transformation into my logistic regression and finally piece together the following (working) R code (pls see it below). However, I have no idea how to interpret this ...
user avatar
2 votes
1 answer
101 views

How to predict ln(odds) with rcs term in mixed effects logistic model?

I am using "lme4" package to fit mixed-effects nonlinear logistic model to access the association of Y and X. As the response variable of my data is binary and nlmer function requires ...
user avatar
3 votes
2 answers
175 views

Spline-transform regression - concept clarification

I am learning spline transformation and am confused about several concepts. Any guidance is all appreciated! Am I understanding this correctly: I should only spline-transform my continuous predictors ...
user avatar
0 votes
1 answer
87 views

Data transformation prior to the logistic/linear regression model

I am currently working on regression models and am unsure whether we should transform the data. From what I learned, it is recommended that we should: transform the continuous predictors (e.g. log-...
user avatar
0 votes
0 answers
47 views

What is the best spline smoother to use with spatial data in a GAM?

I am running a GAM and need to account for spatial autocorrelation. I have done this by including "s(easting,northing, bs="gp")". I was wondering if gaussian was the best spline ...
user avatar
0 votes
0 answers
35 views

Linear mixed models natural splines plotting regression

Eventually I want to use joint modeling. For this, I need to fit a linear mixed model on the biomarker trajectory, with a random slope and intercept for study ID. I want to use natural splines with ...
user avatar
  • 1
2 votes
1 answer
52 views

Poor Bspline estimation for variables with short range

I am recently surprised to observe a fact that, in a simple univariate regression model, the Bspline estimator performs NOT well if the range of the variable is narrow. Namely, let's consider ...
user avatar
  • 122
0 votes
1 answer
32 views

How are the penalized splines defined here?

Based on 'Semiparametric Regression with R' (https://link.springer.com/chapter/10.1007%2F978-1-4939-8853-2_1), a penalized spline $$ f(x)=\beta_{0}+\beta_{1} x+\sum_{k=1}^{K} u_{k}\left(x-\kappa_{k}\...
user avatar
0 votes
0 answers
39 views

Trying to apply cross validation with a cubic B-spline as the model

Using the caret package, I try to do cross-validtion as follows: ...
user avatar
1 vote
1 answer
85 views

Estimating a conditional logistic model with hierarchical splines in mgcv leads leads to error "indefinite penalized likelihood in gam.fit5"

One can estimate a conditional logistic model in the R package mgcv by using the cox.ph family, which I have done successfully. I also estimated a logistic ...
user avatar
0 votes
0 answers
26 views

should I use splines on GLM model?

Is it a common practice to use splines in models where the response follows a distribution different from normal? Are there significant benefits when doing this?
user avatar
  • 541
0 votes
0 answers
36 views

Why do polynomial splines of degree 3 lead to a regression function that jumps?

I'm reading Introduction to Statistical Learning and came across the following: 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 + \...
user avatar
  • 113
0 votes
1 answer
122 views

Spline regression for binary dependent variables

I am trying to analyze the relationship between a discrete quantitative independent variable and a binary qualitative dependent variable. My hypothesis is that higher levels of the predictor promotes ...
user avatar
  • 121
0 votes
0 answers
41 views

How to Interpret Results of Natural Spline Regression in R

I am very new to stats and R, and I'm trying to learn how to do a natural spline multiple regression model. I am using the mpg dataset. My code looks like this: ...
user avatar
24 votes
5 answers
4k views

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 ...
user avatar
1 vote
0 answers
190 views

GAM Model: how can i fit GAM Model for daily count variable in the time-series dataset?

![enter image description here][1] I am trying to apply GAM Model on one Health Claims Dataset (from 2007 to 2018), trying to find the association between daily hospital admissions of heart diseases) ...
user avatar
  • 37
1 vote
1 answer
104 views

Possible non-linearity pspline Cox model

Our working group ran a Cox regression with a p-spline to model the possible non-linearity of continuous variables. However, I'm a bit confused with the interpretation of the linearity or non-...
user avatar
  • 606
0 votes
0 answers
217 views

Cubic spline extrapolation

Is it possible to extrapolate some values with the cubic spline method? From the R function pchip documentation: "pchip can be applied to points outside [min(xi), max(xi)], but the result does ...
user avatar
  • 1
0 votes
0 answers
60 views

using survival::pspline in GEE model in R

If I want to use a penalised spline basis for a predictor in a GEE model using R, is it possible to simply use the pspline function from the survival package? For example, ...
user avatar

1
2 3 4 5
11