similar to: Error in gam?

Displaying 20 results from an estimated 10000 matches similar to: "Error in gam?"

2007 Jun 22
1
two basic question regarding model selection in GAM
Qusetion #1 ********* Model selection in GAM can be done by using: 1. step.gam {gam} : A directional stepwise search 2. gam {mgcv} : Smoothness estimation using GCV or UBRE/AIC criterion Suppose my model starts with a additive model (linear part + spline part). Using gam() {mgcv} i got estimated degrees of freedom(edf) for the smoothing splines. Now I want to use the functional form of my model
2007 Dec 13
1
Two repeated warnings when runing gam(mgcv) to analyze my dataset?
Dear all, I run the GAMs (generalized additive models) in gam(mgcv) using the following codes. m.gam <-gam(mark~s(x)+s(y)+s(lstday2004)+s(ndvi2004)+s(slope)+s(elevation)+disbinary,family=binomial(logit),data=point) And two repeated warnings appeared. Warnings$B!'(B 1: In gam.fit(G, family = G$family, control = control, gamma = gamma, ... : Algorithm did not converge 2: In gam.fit(G,
2007 Oct 05
2
question about predict.gam
I'm fitting a Poisson gam model, say model<-gam(a65tm~as.factor(day.week )+as.factor(week)+offset(log(pop65))+s(time,k=10,bs="cr",fx=FALSE,by=NA,m=1),sp=c( 0.001),data=dati1,family=poisson) Currently I've difficulties in obtaining right predictions by using gam.predict function with MGCV package in R version 2.2.1 (see below my syntax).
2008 Jun 11
1
mgcv::gam error message for predict.gam
Sometimes, for specific models, I get this error from predict.gam in library mgcv: Error in complete.cases(object) : negative length vectors are not allowed Here's an example: model.calibrate <- gam(meansalesw ~ s(tscore,bs="cs",k=4), data=toplot, weights=weight, gam.method="perf.magic") > test <- predict(model.calibrate,newdata) Error in
2011 Dec 09
3
gam, what is the function(s)
Hello, I'd like to understand 'what' is predicting the response for library(mgcv) gam? For example: library(mgcv) fit <- gam(y~s(x),data=as.data.frame(l_yx),family=binomial) xx <- seq(min(l_yx[,2]),max(l_yx[,2]),len=101) plot(xx,predict(fit,data.frame(x=xx),type="response"),type="l") I want to see the generalized function(s) used to predict the response
2003 Jun 04
2
gam()
Dear all, I've now spent a couple of days trying to learn R and, in particular, the gam() function, and I now have a few questions and reflections regarding the latter. Maybe these things are implemented in some way that I'm not yet aware of or have perhaps been decided by the R community to not be what's wanted. Of course, my lack of complete theoretical understanding of what
2012 Aug 14
1
Random effects in gam (mgcv 1.7-19)
Hi, I am using the gam function in the mgcv package, I have random effects in my model (bs="re") this has worked fine, but after I updated the mgcv package to version 1.7-19 I recive an error message when I run the model. > fit1<-gam(IV~s(RUTE,bs="re")+s(T13)+s(H40)+factor(AAR)+s(V3)+s(G1)+s(H1)+s(V1)+factor(LEDD),data=data5,method="ML") > summary.gam(fit1)
2013 Jun 17
1
Can you use two offsets in gam (mgcv)?
Hello, I have been trying to find out whether it is possible to use more than one offset in a gam (in mgcv). The reason I would like to do this is to 1) account for area surveyed in a Poisson model of sightings of porpoises within defined grid cells (each cell has a slightly different area) and 2) account for detection probability within each grid cell (some grid cells are further away from the
2012 Jul 23
1
mgcv: Extract random effects from gam model
Hi everyone, I can't figure out how to extract by-factor random effect adjustments from a gam model (mgcv package). Example (from ?gam.vcomp): library(mgcv) set.seed(3) dat <- gamSim(1,n=400,dist="normal",scale=2) a <- factor(sample(1:10,400,replace=TRUE)) b <- factor(sample(1:7,400,replace=TRUE)) Xa <- model.matrix(~a-1) ## random main effects Xb <-
2008 May 06
1
mgcv::gam shrinkage of smooths
In Dr. Wood's book on GAM, he suggests in section 4.1.6 that it might be useful to shrink a single smooth by adding S=S+epsilon*I to the penalty matrix S. The context was the need to be able to shrink the term to zero if appropriate. I'd like to do this in order to shrink the coefficients towards zero (irrespective of the penalty for "wiggliness") - but not necessarily all the
2011 Apr 19
1
Prediction interval with GAM?
Hello, Is it possible to estimate prediction interval using GAM? I looked through ?gam, ?predict.gam etc and the mgcv.pdf Simon Wood. I found it can calculate confidence interval but not clear if I can get it to calculate prediction interval. I read "Inference for GAMs is difficult and somewhat contentious." in Kuhnert and Venable An Introduction to R, and wondering why and if that
2013 Jul 08
1
error in "predict.gam" used with "bam"
Hello everyone. I am doing a logistic gam (package mgcv) on a pretty large dataframe (130.000 cases with 100 variables). Because of that, the gam is fitted on a random subset of 10000. Now when I want to predict the values for the rest of the data, I get the following error: > gam.basis_alleakti.1.pr=predict(gam.basis_alleakti.1, +
2003 Jan 30
2
mgcv, gam
Hola! I have some problems with gam in mgcv. Firts a detail: it would be nice igf gam would accept an na.action argument, but that not the main point. I want to have a smooth term for time over a year, the same pattern repeating in succesive years. It would be natural then to impose the condition s(0)=s(12). Is this possible within mgcv? I tried to obtain this with trigonometric terms, aca:
2002 Jan 28
1
residuals in plot.gam (mgcv)
Is there a way to add residuals to plots produced by plot.gam in the mgcv package? I'm looking for something like what you get using resid=T in Splus plot.gam. Thanks in advance Toby -----Original Message----- From: Simon Wood [mailto:snw at mcs.st-and.ac.uk] Sent: 23 January, 2002 8:14 PM To: Toby.Patterson at csiro.au Cc: r-help at stat.math.ethz.ch Subject: Re: [R] multiple surfaces in
2023 Feb 11
1
GAM with binary predictors
Dear R-experts, I am trying to fit a GAM with 2 binary predictors (variables coded 0,1). I guess I cannot just smooth binary variables. By the way I code them as 0=no,1=yes, then mgcv will think those variables are numeric.? I have tried to change 0 and 1 in no and yes. It does not work. How to solve my problem. Here below my toy example. Many thanks. Best, Sacha ? ########################
2012 Oct 10
2
GAM without intercept
Hi everybody, I am trying to fit a GAM model without intercept using library mgcv. However, the result has nothing to do with the observed data. In fact the predicted points are far from the predicted points obtained from the model with intercept. For example: #First I generate some simulated data: library(mgcv) x<-seq(0,10,length=100) y<-x^2+rnorm(100) #then I fit a gam model with
2011 May 11
1
Help with gam
Hi, I am a brand new user of R and I am trying to use the gam procedure with the package mgcv. I did a bit of my homework by consulting the R-manual, as well as the mgcv manual written by Simon Wood. I admit it was just a few hours, but what I am trying to do is really basic. Essentially, what I am trying to do is to generate the fitted values after the execution of the gam procedure and export
2005 Oct 05
3
testing non-linear component in mgcv:gam
Hi, I need further help with my GAMs. Most models I test are very obviously non-linear. Yet, to be on the safe side, I report the significance of the smooth (default output of mgcv's summary.gam) and confirm it deviates significantly from linearity. I do the latter by fitting a second model where the same predictor is entered without the s(), and then use anova.gam to compare the
2009 Mar 24
2
help: what are the basis functions in {mgcv}: gam?
I am writing my thesis with the function gam(), with the package {mgcv}. My command is: gam(y~s(x1,bs="cr")+s(x2, bs="cr")). I need help to know what are the default basis funcitons for gam. I have not found any detailed reference for this. Can anyone help me with this?? -- View this message in context:
2010 Mar 04
2
which coefficients for a gam(mgcv) model equation?
Dear users, I am trying to show the equation (including coefficients from the model estimates) for a gam model but do not understand how to. Slide 7 from one of the authors presentations (gam-theory.pdf URL: http://people.bath.ac.uk/sw283/mgcv/) shows a general equation log{E(yi )} = ?+ ?xi + f (zi ) . What I would like to do is put my model coefficients and present the equation used. I am an