0

I have recently run into a problem running a GAM model from a previously working code. I believe it is related to an updated R-Version and an updated Version of the mgcv package. It would be great to know if anyone has the same problem or has a solution to it.

I am currently running R version 3.2.2 (2015-08-14) -- "Fire Safety" on Windows. I am using the mgcv Package 1.8-7. Below is an example code that re-produces the error message, when run on my computer.

###Load package
library(mgcv)

This is mgcv 1.8-7.

###Simulate some example data
set.seed(2) ## simulate some data... 
dat <- gamSim(1,n=400,dist="normal",scale=2)

###Run normal model
b <- gam(y~s(x0)+s(x1)+s(x2)+s(x3),data=dat, family=gaussian())

This works.

###change the smoothness selection method to REML
b0 <- gam(y~s(x0)+s(x1)+s(x2)+s(x3),data=dat,method="REML")

Gives the following error message:

Error in .C(C_gdi1, X = as.double(x[good, ]), E = as.double(Sr), Eb = as.double(Eb),  : Incorrect number of arguments (48), expecting 47 for 'gdi1'

Thanks for your help!

Shawn Hemelstrand
  • 2,676
  • 4
  • 17
  • 30
mb_eco
  • 11
  • 1
  • 3
  • FWIW, I do not get the error when I run your code in R 3.2.1 with mgcv 1.8-7. I also didn't get a warning when loading mgcv about the package being built in R 3.2.2. So it does look like a version issue. – ulfelder Aug 31 '15 at 10:09

1 Answers1

0

I have re-installed R and the mgcv package and it seems as if this has resolved the issue.

mb_eco
  • 11
  • 1
  • 3