GAM - Splines at selected covariate values I am trying to answer a biology question regarding the antibody kinetics with one or two major breakpoints at 21 days and three months. It is possible for me to use linear splines using GLM framework, but I am wondering if it is possible to do so in GAM but to have non-linear splines.
K argument does the splines according to data. Can I specify K at selected covariate values?
 A: One approach would be to use an explicit parameterized spline function, and fix, rather than estimate, the specific value(s) of the predictor variable where the spline(s) sits.
For a simple example, I like to call $\max(x_i - \theta,0)$ a 'hinge function', because if I build a model with it like $y_i = \beta_0 + \beta_x x_i + \beta_{cx}\max(x_i - \theta,0)+\varepsilon_i$ what I get is a simple linear regression for values of $x\le \theta$, and then the slope of that linear regression changes by $\beta_{cx}$ for values of $x>\theta$. This works because $\max(x_i - \theta,0)$ is a variable with values equal to zero at or below $\theta$, and values that increase by exactly 1 unit for every 1 unit $x$ increases by thereafter. Keep in mind that the value of $\theta$—like $\beta_0$, $\beta_x$, etc.—is a parameter which is estimated. You might prefer 'broken stick' or some other term to 'hinge'. :)
However, we do not actually have to estimate $\theta$!
Consider instead using $y_i = \beta_0 + \beta_x x_i + \beta_{cx}\max(x_i - C,0)+\varepsilon_i$, where $C$ is some arbitrary constant—such as a theorized or known value in some biological or ecological process. We still get a simple line with a change in slope at the value $x=C$, but now we fix $C$.
Finally, the hinge function as I have described it is pretty bare bones, and there are reasons to find it distasteful (e.g., it's not smooth, and maybe you, or your estimator, care about things like differentability). You could ensmoothen it by squaring it, although that's still a pretty particular functional form, and there are other spline functions which we can be explicit about. Thus, we can be explicit about our spline functions, and explicitly fix their locations, rather than estimate them, or algorithmically "spread" them out. Our ability to do this in practice will depend on both the flexibility of a particular software implementation, and on our understanding of spline function specification.
