Displaying 20 results from an estimated 8000 matches similar to: "Problem with GAM"
2012 Jul 30
2
mgcv 1.7-19, vis.gam(): "invalid 'z' limits'
Hi everyone,
I ran a binomial GAM consisting of a tensor product of two continuous
variables, a continuous parametric term and crossed random intercepts on a
data set with 13,042 rows. When trying to plot the tensor product with
vis.gam(), I get the following error message:
Error in persp.default(m1, m2, z, col = col, zlim = c(min.z, max.z), xlab =
view[1], :
invalid 'z' limits
In
2011 Oct 27
2
vis.gam zlab problem
I am using the mgcv package to develop vis.gam plots and having trouble
figuring out how to relabel the z-axis (image attached). It is currently
labeled as "linear predictor," but I would like to change it to a different
name. Currently I am using this code:
vis.gam(model1,theta=320,ticktype="detailed",color="gray",nCol=12,
zlab="BCS")
However, when run
2012 Mar 29
0
multiple plots in vis.gam()
Hi,
I'm working with gamm models of this sort:
gm<- gamm(Z~te(x,y),data=DATA,random=list(Group=~1))
gm1<-gamm(Z~te(x,y,by=Factor)+Factor,data=DATA,random=list(Group=~1))
with a dataset of about 70000 rows and 110 levels for Group
if I use plot(gm1$gam), I obtain 3 different surface plots, one for each level of my factor but I would like to create more complex contour plots for those 3
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,
+
2012 Apr 02
1
gamm: tensor product and interaction
Hi list,
I'm working with gamm models of this sort, using Simon Wood's mgcv library:
gm<- gamm(Z~te(x,y),data=DATA,random=list(Group=~1))
gm1<-gamm(Z~te(x,y,by=Factor)+Factor,data=DATA,random=list(Group=~1))
with a dataset of about 70000 rows and 110 levels for Group
in order to test whether tensor product smooths vary across factor levels. I was wondering if comparing those two
2010 Aug 19
0
Math symbols in ylab with vis.gam() or plot.gam()
Hi all,
Has anyone tried to plot math symbols with vis.gam() - a function that uses
(I think) plot.gam() internally? This is from the package mgcv - I am new to
gam().
For example, with the normal plot(), the expression() works fine for Math
symbols:
plot(xx, ylab=expression(paste(Delta,"H",sep=""))) # works fine
But, with vis.gam(), the same
2012 Apr 03
1
A contour plot question - vis.gam () function in "mgcv"
Hi,
Please see the attached contour plot (I am sorry about the big file). This was created using the vis.gam() function in "mgcv" package. However, my question is somewhat broader.
In generating this figure, I first created the contours using vis.gam() and then I plotted the points. These point are plotted on top of the contours so that some of the contour lines are only partially
2009 Oct 13
1
vis.gam() contour plots
Greetings,
I have what I hope is a simple question. I would like to change my
contour interval on the vis.gam( plot.type="contour") in the mgcv
package. Is this a situation where I need to modify the function or is
there a default value I can change?
Thanks
2012 Jul 30
1
te( ) interactions and AIC model selection with GAM
Hello R users,
I'm working with a time-series of several years and to analyze it, I?m using
GAM smoothers from the package mgcv. I?m constructing models where
zooplankton biomass (bm) is the dependent variable and the continuous
explanatory variables are:
-time in Julian days (t), to creat a long-term linear trend
-Julian days of the year (t_year) to create an annual cycle
- Mean temperature
2010 Dec 30
0
prediction intervals for (mcgv) gam objects
As I understand it, predict.lm(l ,newdata=nd ,interval="confidence") yields confidence bands for the predicted mean of new observations and lm.predict(l ,newdata=nd ,interval="prediction") yields confidence bands for new observations themselves, given an lm object l.
However with regard to {mgcv} although predict.gam (g ,se.fit=TRUE ,interval= "prediction")
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 :
2012 Oct 16
2
gam (mgcv) problem: Error in while (mean(ldxx/(ldxx + ldss)) > 0.4) { :, missing value where TRUE/FALSE needed
Hi All,
I'm running into a problem with GAM (in the MGCV package). When I try
to estimate the model, I get the following error message:
1> fit <-
gam(ndvi~s(rain)+s(temp)+s(rainl1)+s(rainl2)+s(rainxY)+s(rainl1xY)+s(rainl2xY)+s(tempxY),
data=dsub, weights=wvec)
Error in while (mean(ldxx/(ldxx + ldss)) > 0.4) { :
missing value where TRUE/FALSE needed
Using
2012 May 23
0
gam (mgcv) vs. multiple regression breakpoint analysis: inconsistencies?
Dear useRs,
I have a question with respect to fitting a non-linearity using gam
(mgcv package, version 1.7-16).
In a study I'm currently conducting, I'd like to find out if there is
a breakpoint after which the effect of Age of Acquisition (AOA) of the
second language changes. I.e. if the slope of AOA before the
breakpoint (at a certain AOA) is different from the slope past 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
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).
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
2012 Oct 10
2
GAM without intercept
Hi everybody,
I am trying to fit a GAM model without intercept using library mgcv.
However, the result has nothing to do with the observed data. In fact
the predicted points are far from the predicted points obtained from the
model with intercept. For example:
#First I generate some simulated data:
library(mgcv)
x<-seq(0,10,length=100)
y<-x^2+rnorm(100)
#then I fit a gam model with
2007 Jun 29
0
modify tick labels in 3D GAM plot
Hello,
I have a GAM plot in 3D which was generated from the mgcv package
(plot.gam) which seems to call the persp( ) function from graphics.
This plot is one of three being plotted in the graphics window to copy
to a manuscript. The plot's rotation has been set to clearly show the
response surface generated in GAM. The resulting plot is small enough
that the tick labels overlap tick
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,
2013 Jan 10
0
mgcv: Plotting probabilities for binomial GAM with crossed random intercepts and factor by variable
mgcv: Constructing probabilities for binomial GAM with crossed random
intercepts and factor by variable
Hello,
(I'm sorry if this has been discussed elsewhere; I may not have been
looking in the right places.)
I ran a binomial GAM in which "Correct" is modelled in terms of the
participant's age and the modality in which the stimulus is presented
(written vs spoken).