similar to: DF for GAM function (mgcv package)

Displaying 20 results from an estimated 3000 matches similar to: "DF for GAM function (mgcv package)"

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
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
2010 Oct 19
3
scatter.smooth() fitted by loess
Hi there, I would like to draw a scatter plot and fit a smooth line by loess. Below is the data. However, the curve line started from 0, which my "resid" list doesn't consist of 0 value. It returned some warnings which I don't know if this is the reason affecting such problem. Here I also attached the warning messages. Please let me know if there is a solution to fix this. Thank
2005 Jan 27
2
svd error
Hi, I met a probem recently and need your help. I would really appreciate it. I kept receiving the following error message when running a program: 'Error in svd(X) : infinite or missing values in x'. However, I did not use any svd function in this program though I did include the function pseudoinverse. Is the problem caused by doing pseudoinverse? Best regards, Tongtong
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,
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
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
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 Apr 02
2
How to choose the df when using GAM function?
Dear all, When using GAM function in R, we need to specify the degree of freedom for the smooth function (i.e. s=(x, df=#)). I am wondering how to choose an appropriate df. Thanks a lot, Jin ---- North Carolina State University USA --------------------------------- [[alternative HTML version deleted]]
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)
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
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 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
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)
2011 Apr 12
1
Model checking for gam (mgcv) result
Dear list, i'm checking the residuals plots of a gam model after a processus of model selection. I found the "best" model, all my terms are significant, the r-square and the deviance explained are good, but I have strange residuals plots: http://dl.dropbox.com/u/1169100/gam.check.png http://dl.dropbox.com/u/1169100/residuals_vs_fitted.png What does explains the "curve"
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 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 <-