similar to: Model checking for gam (mgcv) result

Displaying 20 results from an estimated 4000 matches similar to: "Model checking for gam (mgcv) result"

2011 Jun 09
0
Fwd: Re: residual checking for GAM (mgcv)
The plots look reasonable to me. The plot of residuals against linear predictor always looks scary when many of the fitted values are very close to zero, so I tend to look at residuals against sqrt(fitted) in such cases. I don't think that the presence of the zero curve is a reason to reject the model --- it's easy to produce such plots by fitting a completely correct model to simulated
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
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,
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 Feb 16
1
retrieving partial residuals of gam fit (mgcv)
Dear list, does anybody know whether there is a way to easily retrieve the so called "partial residuals" of a gam fit with package mgcv? The partial residuals are the residuals you would get if you would "leave out" a particular predictor and are the dots in the plots created by plot(gam.object,residuals=TRUE) residuals.gam() gives me whole model residuals and
2007 Jun 25
1
gam function in the mgcv library
I would like to fit a logistic regression using a smothing spline, where the spline is a piecewise cubic polynomial. Is the knots option used to define the subintervals for each piece of the cubic spline? If yes and there are k knots, then why does the coefficients field in the returned object from gam only list k coefficients? Shouldn't there be 4k -4 coefficients? Sincerely, Bill
2010 Dec 06
1
Help with GAM (mgcv)
Please help! Im trying to run a GAM: model3=gam(data2$Symptoms~as.factor(data2$txerad)+s(data2$maritalStatus),family=binomial,data=data2) But keep getting this error: Error in dl[[i]] : subscript out of bounds Can someone please tell me what this error is? Thanks -- View this message in context: http://r.789695.n4.nabble.com/Help-with-GAM-mgcv-tp3074165p3074165.html Sent from the R help
2008 Apr 09
1
mgcv::predict.gam lpmatrix for prediction outside of R
This is in regards to the suggested use of type="lpmatrix" in the documentation for mgcv::predict.gam. Could one not get the same result more simply by using type="terms" and interpolating each term directly? What is the advantage of the lpmatrix approach for prediction outside R? Thanks. -- View this message in context:
2007 Oct 03
1
How to avoid overfitting in gam(mgcv)
Dear listers, I'm using gam(from mgcv) for semi-parametric regression on small and noisy datasets(10 to 200 observations), and facing a problem of overfitting. According to the book(Simon N. Wood / Generalized Additive Models: An Introduction with R), it is suggested to avoid overfitting by inflating the effective degrees of freedom in GCV evaluation with increased "gamma"
2007 Dec 13
1
Probelms on using gam(mgcv)
Dear all, Following the help from gam(mgcv) help page, i tried to analyze my dataset with all the default arguments. Unfortunately, it can't be run successfully. I list the errors below. #m.gam<-gam(mark~s(x,y)+s(lstday2004)+s(slope)+s(ndvi2004)+s(elevation)+s(disbinary),family=binomial(logit),data=point)
2006 Dec 15
1
DF for GAM function (mgcv package)
For summary(GAM) in the mgcv package smooth the degrees of freedom for the F value for test of smooth terms are the rank of covariance matrix of \hat{beta} and the residuals df. I've noticed that in a lot of GAMs I've fit the rank of the covariance turns out to be 9. In Simon Wood's book, the rank of covariance matrix is usually either 9 or 99 (pages 239-230 and 259). Can anyone
2010 Aug 04
2
more questions on gam/gamm(mgcv)...
Hi R-users, I'm using R 2.11.1, mgcv 1.6-2 to fit a generalized additive mixed model. I'm new to this package...and just got more and more problems... 1. Can I include correlation and/or random effect into gam( ) also? or only gamm( ) could be used? 2. I want to estimate the smoothing function s(x) under each level of treatment. i.e. different s(x) in each level of treatment. shall I
2007 Oct 04
1
Convergence problem in gam(mgcv)
Dear all, I'm trying to fit a pure additive model of the following formula : fit <- gam(y~x1+te(x2, x3, bs="cr")) ,with the smoothing parameter estimation method "magic"(default). Regarding this, I have two questions : Question 1 : In some cases the value of "mgcv.conv$fully.converged" becomes "FALSE", which tells me that the method stopped with a
2009 Oct 13
2
How to choose a proper smoothing spline in GAM of mgcv package?
Hi, there, I have 5 datasets. I would like to choose a basis spline with same knots in GAM function in order to obtain same basis function for 5 datasets. Moreover, the basis spline is used to for an interaction of two covarites. I used "cr" in one covariate, but it can only smooth w.r.t 1 covariate. Can anyone give me some suggestion about how to choose a proper smoothing spline
2009 Feb 07
1
paraPen in gam [mgcv 1.4-1.1] and centering constraints
Dear Mr. Simon Wood, dear list members, I am trying to fit a similar model with gam from mgcv compared to what I did with BayesX, and have discovered the relatively new possibility of incorporating user-defined matrices for quadratic penalties on parametric terms using the "paraPen" argument. This was really a very good idea! However, I would like to constraint the coefficients
2009 Sep 01
3
Strange error returned or bug in gam in mgcv????
Dear friends, what is this error message in gam???? I cannot understand what it means .... is it a bug? gam_bray_scot24_pc_0505<gam(bray~s(PC1,PC2,PC3,PC4,PC5, PC1.1,PC2.1,PC3.1,PC4.1,PC5.1),data=dist_scot24_vector_with_climate) Error in if (length(data) != vl) { : missing value where TRUE/FALSE needed Calls: gam ... smooth.construct -> smooth.construct.tp.smooth.spec -> array In
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)
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 <-
2012 Feb 03
1
GAM (mgcv) warning: matrix not positive definite
Dear list, I fitted the same GAM model using directly the function gam(mgcv) ... then as a parameter of another function that capture the warnings messages (see below). In the first case, there is no warning message printed, but in the last one, the function find two warning messages stating "matrix not positive definite" So my question is: Do I have to worry about those warnings and
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