Andrew Crane-Droesch
2012-Oct-16 06:32 UTC
[R] gam (mgcv) problem: Error in while (mean(ldxx/(ldxx + ldss)) > 0.4) { :, missing value where TRUE/FALSE needed
Hi All, I'm running into a problem with GAM (in the MGCV package). When I try to estimate the model, I get the following error message: 1> fit <- gam(ndvi~s(rain)+s(temp)+s(rainl1)+s(rainl2)+s(rainxY)+s(rainl1xY)+s(rainl2xY)+s(tempxY), data=dsub, weights=wvec) Error in while (mean(ldxx/(ldxx + ldss)) > 0.4) { : missing value where TRUE/FALSE needed Using traceback, I get the following output (which I don't understand) 1> traceback() 7: initial.sp(w * X, S, off) 6: initial.spg(G$X, G$y, G$w, G$family, G$S, G$off, G$L, G$lsp0) 5: estimate.gam(G, method, optimizer, control, in.out, scale, gamma, ...) 4: gam(ndvi ~ s(rain) + s(temp) + s(rainl1) + s(rainl2) + s(rainxY) + s(rainl1xY) + s(rainl2xY) + s(tempxY), data = dsub, weights = wvec) 3: eval.with.vis(expr, envir, enclos) 2: eval.with.vis(ei, envir) 1: source("/tmp/RTmpFile-UYYVRr.r", echo = TRUE, print.eval = TRUE, max.deparse.length = 5e+05, local = TRUE) I've got a ton of data, and I'm doing this all via ssh into a relatively fast server. 1> dim(dsub) [1] 181705 42 By way of context, I'm using climate data to predict NDVI, and using the residuals of that prediction for a separate estimation. I'd appreciate if someone could help me understand what is going on and how to fix it. It seems like something is wrong with the optimizer, but I'm still learning the mechanics of these techniques and don't fully understand what is going wrong. Thanks for any help. Cheers, Andrew [[alternative HTML version deleted]]
Simon Wood
2012-Oct-16 11:06 UTC
[R] gam (mgcv) problem: Error in while (mean(ldxx/(ldxx + ldss)) > 0.4) { :, missing value where TRUE/FALSE needed
On 16/10/12 07:32, Andrew Crane-Droesch wrote:> Hi All, > > I'm running into a problem with GAM (in the MGCV package). When I try > to estimate the model, I get the following error message: > > 1> fit <- > gam(ndvi~s(rain)+s(temp)+s(rainl1)+s(rainl2)+s(rainxY)+s(rainl1xY)+s(rainl2xY)+s(tempxY), > data=dsub, weights=wvec) > Error in while (mean(ldxx/(ldxx + ldss)) > 0.4) { : > missing value where TRUE/FALSE needed > > Using traceback, I get the following output (which I don't understand) > > 1> traceback() > 7: initial.sp(w * X, S, off) > 6: initial.spg(G$X, G$y, G$w, G$family, G$S, G$off, G$L, G$lsp0) > 5: estimate.gam(G, method, optimizer, control, in.out, scale, gamma, > ...) > 4: gam(ndvi ~ s(rain) + s(temp) + s(rainl1) + s(rainl2) + s(rainxY) + > s(rainl1xY) + s(rainl2xY) + s(tempxY), data = dsub, weights = wvec) > 3: eval.with.vis(expr, envir, enclos) > 2: eval.with.vis(ei, envir) > 1: source("/tmp/RTmpFile-UYYVRr.r", echo = TRUE, print.eval = TRUE, > max.deparse.length = 5e+05, local = TRUE) > > I've got a ton of data, and I'm doing this all via ssh into a relatively > fast server. > 1> dim(dsub) > [1] 181705 42 > > By way of context, I'm using climate data to predict NDVI, and using the > residuals of that prediction for a separate estimation. > > I'd appreciate if someone could help me understand what is going on and > how to fix it. It seems like something is wrong with the optimizer, but > I'm still learning the mechanics of these techniques and don't fully > understand what is going wrong. > > Thanks for any help. > > Cheers, > Andrew > > [[alternative HTML version deleted]] > > ______________________________________________ > 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
2012-Oct-16 11:10 UTC
[R] gam (mgcv) problem: Error in while (mean(ldxx/(ldxx + ldss)) > 0.4) { :, missing value where TRUE/FALSE needed
Hi Andrew, Could you send me a bit more information (off list, as this is likely to get into obscure details), please? In particular can you let me know the mgcv and R version numbers, the server operating system and, if possible, what BLAS it has installed? best, Simon On 16/10/12 07:32, Andrew Crane-Droesch wrote:> Hi All, > > I'm running into a problem with GAM (in the MGCV package). When I try > to estimate the model, I get the following error message: > > 1> fit <- > gam(ndvi~s(rain)+s(temp)+s(rainl1)+s(rainl2)+s(rainxY)+s(rainl1xY)+s(rainl2xY)+s(tempxY), > data=dsub, weights=wvec) > Error in while (mean(ldxx/(ldxx + ldss)) > 0.4) { : > missing value where TRUE/FALSE needed > > Using traceback, I get the following output (which I don't understand) > > 1> traceback() > 7: initial.sp(w * X, S, off) > 6: initial.spg(G$X, G$y, G$w, G$family, G$S, G$off, G$L, G$lsp0) > 5: estimate.gam(G, method, optimizer, control, in.out, scale, gamma, > ...) > 4: gam(ndvi ~ s(rain) + s(temp) + s(rainl1) + s(rainl2) + s(rainxY) + > s(rainl1xY) + s(rainl2xY) + s(tempxY), data = dsub, weights = wvec) > 3: eval.with.vis(expr, envir, enclos) > 2: eval.with.vis(ei, envir) > 1: source("/tmp/RTmpFile-UYYVRr.r", echo = TRUE, print.eval = TRUE, > max.deparse.length = 5e+05, local = TRUE) > > I've got a ton of data, and I'm doing this all via ssh into a relatively > fast server. > 1> dim(dsub) > [1] 181705 42 > > By way of context, I'm using climate data to predict NDVI, and using the > residuals of that prediction for a separate estimation. > > I'd appreciate if someone could help me understand what is going on and > how to fix it. It seems like something is wrong with the optimizer, but > I'm still learning the mechanics of these techniques and don't fully > understand what is going wrong. > > Thanks for any help. > > Cheers, > Andrew > > [[alternative HTML version deleted]] > > ______________________________________________ > 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.