[R] gam error message: matrix not +ve definite

Simon Wood s.wood at bath.ac.uk
Mon Oct 8 11:37:33 CEST 2012

Hi Dan,

Any chance that you could send me the data offlist and I'll take a look 
(under the understanding that I'll only use the data for de-bugging of 

Could you also let me know which linux distribution you are using, 
whether it's 64bit or 32 bit, and, if possible, what BLAS R is using.


On 07/10/12 15:00, garth wrote:
> Hello,
> I'm running a multimodel analysis which involves fitting several GAM models
> as implemented in package mgcv.  The issue I'm having is that when I try to
> fit my model, gam gives me the following error message: 'Error in
> initial.sp(w * X, S, off) : S[[2]] matrix is not +ve definite.' The strange
> part of this is that the error message stops my model fitting function when
> run on a linux platform, but not on my local windows machine. Ordinarily I
> would just run the analysis on my local machine, but I need to run this from
> the linux machine to take advantage of the much larger computing capacity.
> The version of mgcv(1.7-21) and R (2.15.1) is the same on both machines.
> The data set to which the model if fitted is too large to post here but it
> contains 2209 observations, and the model is of the form: gam(Response~Year
> + s(Dayofyear,k=5,bs='cc') + s(Longitude,Latitude,k=4) +
> s(Coast_distance,k=4), family=Gamma('log'), data=dat, gamma=1.4)
> I realize this is a very particular question, but any help would be really
> appreciated.
> Thanks,
> Dan.
> --
> View this message in context: http://r.789695.n4.nabble.com/gam-error-message-matrix-not-ve-definite-tp4645329.html
> Sent from the R help mailing list archive at Nabble.com.
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

Simon Wood, Mathematical Science, University of Bath BA2 7AY UK
+44 (0)1225 386603               http://people.bath.ac.uk/sw283

More information about the R-help mailing list