Displaying 20 results from an estimated 6000 matches similar to: "Convergence problem in gam(mgcv)"
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 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
2013 Apr 17
1
mgcv: how select significant predictor vars when using gam(...select=TRUE) using automatic optimization
I have 11 possible predictor variables and use them to model quite a few
target variables.
In search for a consistent manner and possibly non-manual manner to identify
the significant predictor vars out of the eleven I thought the option
"select=T" might do.
Example: (here only 4 pedictors)
first is vanilla with "select=F"
>
2006 Dec 04
1
GAM model selection and dropping terms based on GCV
Hello,
I have a question regarding model selection and dropping of terms for GAMs fitted with package mgcv. I am following the approach suggested in Wood (2001), Wood and Augustin (2002).
I fitted a saturated model, and I find from the plots that for two of the covariates,
1. The confidence interval includes 0 almost everywhere
2. The degrees of freedom are NOT close to 1
3. The partial
2010 Apr 14
1
Selecting derivative order penalty for thin plate spline regression (GAM - mgcv)
Hi,
I am using GAMs (package mgcv) to smooth event rates in a penalized regression setting and I was wondering if/how one can
select the order of the derivative penalty.
For my particular problem the order of the penalty (parameter "m" inside the "s" terms of the formula argument) appears to
have a larger effect on the AIC/deviance of the estimated model than the
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 Feb 13
3
mgcv: increasing basis dimension
hi
Using a ts or tprs basis, I expected gcv to decrease when increasing the
basis dimension, as I thought this would minimise gcv over a larger
subspace. But gcv increased. Here's an example. thanks for any comments.
greg
#simulate some data
set.seed(0)
x1<-runif(500)
x2<-rnorm(500)
x3<-rpois(500,3)
d<-runif(500)
linp<--1+x1+0.5*x2+0.3*exp(-2*d)*sin(10*d)*x3
2008 Nov 12
1
gam help (really a vegan question)
What does Generalized Cross Validation score mean. I preform and
ordisurf on an ordination (nmds) with an environmental variable. I am
trying to figure out "how well" the environmental varibles
predict/explain the sites placements in species space. Any help would
be greatly appreciated. Any pointers to literature... would be
welcome.
thanks in advance,
--
Stephen Sefick
Research
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,
+
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
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
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
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 Oct 27
1
GAM function in mgcv package
Hi R-users
I am trying to use the GAM function of the mgcv package. But I am having
problem trying to specify the k parameter.
Although I managed to run some models by giving to the parameter some
(random) value, and it is explained by Wood (2006) that it does not seem
to "really" affect the final result, I would like to grasp better its
meaning.
I understand that is the
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
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 Oct 17
1
Error message in GAM
Hello useRs!
I have % cover data for different plant species in 300 plots, and I use
the ARCSINE transformation (to deal with % cover data).
When I use a GLM I do not have any problem.
But when I am trying to use a GAM model using mgcv package, to account for
non-linearity I get an ?error message?.
I use the following model:
sp1.gam<-gam(asin(sqrt(0.01*SP1COVER))~
2012 May 29
1
GAM interactions, by example
Dear all,
I'm using the mgcv library by Simon Wood to fit gam models with interactions and I have been reading (and running) the "factor 'by' variable example" given on the gam.models help page (see below, output from the two first models b, and b1).
The example explains that both b and b1 fits are similar: "note that the preceding fit (here b) is the same as
2009 Mar 31
1
CV and GCV for finding smoothness parameter
I received an assignment that I have to do in R, but I'm absolutely not very
good at it.
The task is the following:
http://www.nabble.com/file/p22804957/question8.jpg
To do this, we also get the following pieces of code (not in correct order):
http://www.nabble.com/file/p22804957/hints.jpg
I'm terrible at this and I'm completely stuck. The model I chose can be
found in here:
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]]