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.
On Sun, Oct 7, 2012 at 3:00 PM, garth <dboyce at dal.ca> 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. >It's a bit of a shot in the dark, but might it reflect data that is "close" to not being non-positive-definite and differences in BLAS? The only other think I'd try would be a update.packages(checkBuilt = TRUE, ask = FALSE) to just update every package you've got installed. It might not be that the error is from mgcv proper, but rather a dependency thereof which is in different versions between the machines. Also, I note you're posting through Nabble. Nabble actually only mirrors the R-Help mailing list, so we (the majority of respondents who don't use Nabble) don't get a forum view, but rather only emails of individual posts. The net result of this is that we don't see context of your follow-up postings unless you specifically include it, but it's much appreciated if you do. I believe there might also be a button which does so automatically, but I'll leave finding that to you. Cheers, Michael
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 course)? 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. best, Simon 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
Reasonably Related Threads
- GAM (mgcv) warning: matrix not positive definite
- MuMIn package, problem using model selection table from manually created list of models
- Convergence problem in gam(mgcv)
- two basic question regarding model selection in GAM
- mgcv::gam error message for predict.gam