You can get around this by using the 'knots' argument to 'gam' to
specify p-spline knots which span the range over which you want to
predict. Alternatively use the "cr", "tp" or "ds" bases (splines with
derivative based penalties), which don't have this problem.
best,
Simon
On 28/03/11 06:10,
dear Philip,
I am not able to solve your problem, however the error message you get
does not depends on mgcv::gam, therefore gam(,..outer.ok=TRUE) or
predict.gam(,outer.ok=TRUE) do not make sense.
The error message comes from the function splines::splineDesign which is
called when the option
Hello
I'm using function gam from package mgcv to fit splines. When I try
to make a prediction slightly beyond the original 'x' range, I get
this error:
> A = runif(50,1,149)
> B = sqrt(A) + rnorm(50)
> range(A)
[1] 3.289136 145.342961
>
>
> fit1 = gam(B ~ s(A, bs="ps"), outer.ok=TRUE)
> predi
3 matches
Mail list logo