Displaying 20 results from an estimated 845 matches for "gam".
Did you mean:
cam
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]))...
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 sel...
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...
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 package: 'mgcv'
The following object(s) are mask...
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 ve...
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
spli...
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 gam.ou...
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 c...
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 neg...
2004 Aug 06
2
gam --- a new contributed package
I have contributed a "gam" library to CRAN,
which implements "Generalized Additive Models".
This implementation follows closely the description in
the GAM chapter 7 of the "white" book "Statistical Models in S"
(Chambers & Hastie (eds), 1992, Wadsworth), as well as the philosophy
in...
2004 Aug 06
2
gam --- a new contributed package
I have contributed a "gam" library to CRAN,
which implements "Generalized Additive Models".
This implementation follows closely the description in
the GAM chapter 7 of the "white" book "Statistical Models in S"
(Chambers & Hastie (eds), 1992, Wadsworth), as well as the philosophy
in...
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 =
n...
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 t...
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 coll...
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...
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
en...
2010 Jan 26
1
AIC for comparing GLM(M) with (GAM(M)
...nalyzing a dichotomous dependent variable (dv) with more than 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 settin...
2012 Feb 17
1
Standard errors from predict.gam versus predict.lm
I've got a small problem.
I have some observational data (environmental samples: abiotic explanatory variable and biological response) to which I've fitted both a multiple linear regression model and also a gam (mgcv) using smooths for each term. The gam clearly fits far better than the lm model based on AIC (difference in AIC ~ 8), in addition the adjusted R squared for the gam is clearly better.
I then want to make some plots of predicted values from both models with confidence intervals. So I can get...