Re: [R] MGCV:: boundary conditions in gam

2018-11-13 Thread Mark R Payne
Perfect! This might be a good example to add to the documentation of mgcv somewhere Thanks. Mark On Thu, 8 Nov 2018 at 22:08, Simon Wood wrote: > This first derivative penalty spline will do it, but the price paid is > that the curves are often quite wiggly. > > > library(mgcv);

Re: [R] MGCV:: boundary conditions in gam

2018-11-08 Thread Simon Wood
This first derivative penalty spline will do it, but the price paid is that the curves are often quite wiggly. library(mgcv); set.seed(5) x <- runif(100); y <- x^4 + rnorm(100)*.1 b <- gam(y~s(x,m=1)) pd <- data.frame(x=seq(-.5,1.5,length=200)) ff <- predict(b,pd,se=TRUE)

[R] MGCV:: boundary conditions in gam

2018-11-08 Thread Mark R Payne
Dear R-help, I have a problem where I am using the mgcv package to in a situation where I am fitting a gam model with a 1-D spline smoother model over a domain [a,b] but then need to make predictions and extrapolate beyond b. Is there anyway where I force the first derivative of the spline to be