Error returned predicting new data using GAM with periodic smoother
问题 Apologies if this is better suited in CrossValidated. I am fitting GAM models to binomial data using the mgcv package in R. One of the covariates is periodic, so I am specifying the bs = "cc" cyclic cubic spline. I am doing this in a cross validation framework, but when I go to fit my holdout data using the predict function I get the following error: Error in pred.mat(x, object$xp, object$BD) : can't predict outside range of knots with periodic smoother Here is some code that should replicate