similar to: GAM question

Displaying 20 results from an estimated 4000 matches similar to: "GAM question"

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
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
2012 Nov 29
1
[mgcv][gam] Manually defining my own knots?
Dear List, I'm using GAMs in a multiple imputation project, and I want to be able to combine the parameter estimates and covariance matrices from each completed dataset's fitted model in the end. In order to do this, I need the knots to be uniform for each model with partially-imputed data. I want to specify these knots based on the quantiles of the unique values of the non-missing
2010 Nov 29
1
weighted Spearman correlation coefficient
Hello, I would be grateful if anybody can help me in finding an R function to compute weighted Spearman correlation coefficient? Kind regards, Daniel
2004 Dec 01
2
step.gam
Dear R-users: Im trying (using gam package) to develop a stepwise analysis. My gam object contains five pedictor variables (a,b,c,d,e,f). I define the step.gam: step.gam(gamobject, scope=list("a"= ~s(a,4), "b"= ~s(b,4), "c"= ~s(c,4), "d"= ~s(d,4), "e"= ~s(e,4), "f"= ~s(f,4))) However, the result shows a formula containing the whole
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 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
2012 Aug 22
2
AIC for GAM models
Dear all, I am analysing growth data - response variable - using GAM and GAMM models, and 4 covariates: mean size, mean capture year, growth interval, having tumors vs. not The models work fine, and fit the data well, however when I try to compare models using AIC I cannot get an AIC value. This is the code for the gam model:
2008 Nov 14
2
GAM and Poisson distribution
Hi -I'm running a GAM with 7 explanatory variables with a Poisson error structure. All of the variables are continuous so I'm getting error messages in R. cod.fall.full.gam.model<-gam(Kept.CPUE~s(HOUR)+s(LAT_dec)+s(LONG_dec)+s(meantemp_C)+s(meandepth_fa)+s(change_depth)+s(seds), data=cod.fall.version2,family=poisson) In dpois(y, mu, log = TRUE) ... : non-integer x = 5.325517
2009 Nov 22
1
GAM plots
Hello all... I'm attempting to write my own GAM plot function, so I can overlay it on top of an already existing plot. Problem is that after I do the gam, e.g. m<-gam(...), I cannot match the graph that gam.plot outputs when I attempt to plot the values from m$residuals, m$linear.predictors or m$fitted.values. Kind of at a loss what variables to use or if I need to do something
2007 Apr 16
1
Does the smooth terms in GAM have a functional form?
Hi, all, Does anyone know how to get the functional form of the smooth terms in GAM? eg. I fit y=a+b*s(x) where s is the smooth function. After fitting this model with GAM in R, I want to know the form of the s(x). Any suggestion is appreciated. Thanks, Jin --------------------------------- Ahhh...imagining that irresistible "new car" smell?
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,
2010 Aug 05
1
plot points using vis.gam
Hello, I'm trying to illustrate the relationships between various trait and environment data gathered from a number of sites. I've created a GAM to do this: gam1=gam(trait~s(env1)+s(env2)+te(env1,env2)) and I know how to create a 3D plot using vis.gam. I want to be able to show points on the 3D plot indicating the sites that the data came from. I can do this on a 2D plot when there is one
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
2007 Nov 25
1
GAM with constraints
Hi, I am trying to build GAM with linear constraints, for a general link function, not only identity. If I understand it correctly, the function pcls() can solve the problem, if the smoothness penalties are given. What I need is to incorporate the constraints before calculating the penalties. Can this be done in R? Any help would be greately appreciated. -- View this message in context:
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 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 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 May 13
1
GAM, GAMM and numerical integration, help please
I am trying to apply methods used by Chaloupka & Limpus (1997) ( http://www.int-res.com/articles/meps/146/m146p001.pdf) to my own turtle growth data. I am having trouble with two things... 1) After the GAM is fit, the residuals are skewed. >m1 <- gam(growth~s(mean.size, bs="cr")+s(year,bs="cr",k=7)+s(cohort,bs="cr")+s(age,bs="cr"), data=grow,
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).