search for: gams

Displaying 20 results from an estimated 842 matches for "gams".

Did you mean: game
2005 Mar 24
1
Prediction using GAM
Recently I was using GAM and couldn't help noticing the following incoherence in prediction: > data(gam.data) > data(gam.newdata) > gam.object <- gam(y ~ s(x,6) + z, data=gam.data) > predict(gam.object)[1] 1 0.8017407 > predict(gam.object,data.frame(x=gam.data$x[1],z=gam.data$z[1])) 1 0.1668452 I would expect that using two types of predict arguments
2008 Feb 28
0
use of step.gam (from package 'gam') and superassignment inside functions
Hello, I am using the function step.gam() from the 'gam' package (header info from library(help=gam) included below) and have come across some behavior that I cannot understand. In short, I have written a function that 1) creates a dataframe, 2) calls gam() to create a gam object, then 3) calls step.gam() to run stepwise selection on the output from gam(). When I do this, gam()
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, +
2011 Mar 07
0
Conflict between gam::gam and mgcv::gam
I am trying to compare and contrast the smoothing in the {mgcv} version of gam vs. the {gam} version of gam but I get a strange side effects when I try to alternate calls to these routines, even though I detach and unload namespaces. Specifically when I start up R the following code runs successfully until the last line i.e. plot(g4,se=TRUE) when I get "Error in dim(data) <- dim :
2010 Dec 14
2
Use generalised additive model to plot curve
Readers, I have been reading 'the r book' by Crawley and think that the generalised additive model is appropriate for this problem. The package 'gam' was installed using the command (as root) install.package("gam") ... library(gam) > library(gam) Loading required package: splines Loading required package: akima > library(mgcv) This is mgcv 1.3-25 Attaching
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).
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
2008 Aug 03
1
output components of GAM
I would like to request help with the following: I am trying to use a Generalized Additive Model (gam) to examine the density distribution of fish as a function of latitude and longitude as continuous variables, and year as a categorical variable. The model is written as:   gam.out   <-  gam(Density ~ s(Lat) + s(Lon) + as.factor(Year))   The fitted model prediction of the link function is
2017 Oct 24
0
Issue of reproducibility with gam and lm.wfit in different versions of R
Dear R users, I recently stumbled upon problems of reproducibility while running GAM analyses in different R and gam package versions. In the example below, a small dataset is created in which the y and x1 variables are 100% correlated. The intents of this example were primarily for regression testing and, secondarily, to evaluate how the gam algorithm behaves under extreme/limit conditions. I
2007 Apr 08
1
Relative GCV - poisson and negbin GAMs (mgcv)
I am using gam in mgcv (1.3-22) and trying to use gcv to help with model selection. However, I'm a little confused by the process of assessing GCV scores based on their magnitude (or on relative changes in magnitude). Differences in GCV scores often seem "obvious" with my poisson gams but with negative binomial, the decision seems less clear. My data represent a similar pattern as below - where I see (seemingly) drastic changes in GCV for the poisson with different model structures, but the negative binomial often seems only to change in the second or third decimal place for th...
2004 Aug 06
2
gam --- a new contributed package
...ersion of GAM. Note: this gam library and functions therein are different from the gam function in package mgcv, and both libraries should not be used simultaneously. The gam library allows both local regression (loess) and smoothing spline smoothers, and uses backfitting and local scoring to fit gams. It also allows users to supply their own smoothing methods which can then be included in gam fits. The gam function in mgcv uses only smoothing spline smoothers, with a focus on automatic parameter selection via gcv. Some of the features of the gam library: * full compatibility with the R func...
2004 Aug 06
2
gam --- a new contributed package
...ersion of GAM. Note: this gam library and functions therein are different from the gam function in package mgcv, and both libraries should not be used simultaneously. The gam library allows both local regression (loess) and smoothing spline smoothers, and uses backfitting and local scoring to fit gams. It also allows users to supply their own smoothing methods which can then be included in gam fits. The gam function in mgcv uses only smoothing spline smoothers, with a focus on automatic parameter selection via gcv. Some of the features of the gam library: * full compatibility with the R func...
2004 Oct 26
3
GLM model vs. GAM model
I have a question about how to compare a GLM with a GAM model using anova function. A GLM is performed for example: model1 <-glm(formula = exitus ~ age+gender+diabetes, family = "binomial", na.action = na.exclude) A second nested model could be: model2 <-glm(formula = exitus ~ age+gender, family = "binomial", na.action = na.exclude) To compare these two GLM
2006 Oct 27
3
R & gams
At office I have been introduced by another company to new, complex energy forecasting models using gams as the basic software. I have been told by the company offering the models that gams is specialised in dealing with huge, hevy-weight linear and non-linear modelling (see an example in http://www.gams.com/modtype/index.htm) and they say it is almost the only option for doing it. I would like to...
2003 Sep 16
2
gam and concurvity
Hello, in the paper "Avoiding the effects of concurvity in GAM's .." of Figueiras et al. (2003) it is mentioned that in GLM collinearity is taken into account in the calc of se but not in GAM (-> results in confidence interval too narrow, p-value understated, GAM S-Plus version). I haven't found any references to GAM and concurvity or collinearity on the R page. And I
2011 Jun 20
3
About GAM in R, Need YOUR HELP!
I'm beginner in R! I have a lot of problems on R..... I have three questions about GAM 1. What is the function of Gaussian distribution in GAM?(if I choose family is Gaussian) Is it used in the predictand value (Y)? 2. How to plot a graph the gam function? For example: y<-gam(a~s(b),family=gaussian (link=log) ,Data) how to plot x axis is s(b) and y axis is log a??? 3. if I use GAM to
2005 Apr 18
0
Discrepancy between gam from gam package and gam in S-PLUS
Dear Trevor, I've noticed a discrepancy in the degrees of freedom reported by gam() from the gam package in R vs. gam() in S-PLUS. The nonparametric df differ by 1; otherwise (except for things that depend upon the df), the output is the same: --------- snip ------------ *** From R (gam version 0.93): > mod.gam <- gam(prestige ~ lo(income, span=.6), data=Prestige) >
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 ent...
2010 Jan 26
1
AIC for comparing GLM(M) with (GAM(M)
...n 100 measurements (within-subjects variable: hours24) per subject and more than 100 subjects. The high number of measurements allows me to model more complex temporal trends. I would like to compare different models using GLM, GLMM, GAM and GAMM, basically do demonstrate the added value of GAMs/GAMMs relative to GLMs/GLMMs, by fitting splines. GLMMs/GAMMs are used to possibly improve fits from GLMs/GAMs by accounting for serial dependence. My idea is to use AIC to compare the different models. I’ve noticed that when setting up two seemingly identical models using the two functions...
2012 Feb 17
1
Standard errors from predict.gam versus predict.lm
...r and gam fit is not so pronounced but the gam still clearly fits better than linear, but all gam se's are WAY above their linear equivalents when used to predict for representative new data in order to present results as interaction plots. cheers Mike require(mgcv) require(MASS) dat <- gamSim(1,n=200,dist="normal",scale=2) summary(b <- gam(y~s(x0)+s(x1)+s(x2)+s(x3),data=dat)) summary(a <- lm(y~x0 + x1 + x2 + x3,data=dat)) se.result <- data.frame(linear.se=predict(a, se.fit=TRUE)$se.fit, gam.se=predict(b, se.fit=TRUE)$se.fit) with(se.result, eqscplot(linear.se, gam....