Displaying 20 results from an estimated 6000 matches similar to: "gam error message: matrix not +ve definite"
2012 Feb 03
1
GAM (mgcv) warning: matrix not positive definite
Dear list,
I fitted the same GAM model using directly the function gam(mgcv) ... then
as a parameter of another function that capture the warnings messages (see
below).
In the first case, there is no warning message printed, but in the last
one, the function find two warning messages stating "matrix not positive
definite"
So my question is: Do I have to worry about those warnings and
2012 Jan 17
1
MuMIn package, problem using model selection table from manually created list of models
The subject says it all really.
Question 1.
Here is some code created to illustrate my problem, can anyone spot where I'm going wrong?
Question 2.
The reason I'm following a manual specification of models relates to the fact that in reality I am using mgcv::gam, and I'm not aware that dredge is able to separate individual smooth terms out of say s(a,b). Hence an additional request,
2007 Oct 04
1
Convergence problem in gam(mgcv)
Dear all,
I'm trying to fit a pure additive model of the following formula :
fit <- gam(y~x1+te(x2, x3, bs="cr"))
,with the smoothing parameter estimation method "magic"(default).
Regarding this, I have two questions :
Question 1 :
In some cases the value of "mgcv.conv$fully.converged" becomes
"FALSE", which tells me that the method stopped with a
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 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 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).
2011 Oct 04
2
About stepwise regression problem
First of all, I have GAMs
noxd<-gam(newNOX~pressure+maxtemp+s(avetemp,bs="cr")+s(mintemp,bs="cr")+s(RH,bs="cr")+s(solar,bs="cr")+s(windspeed,bs="cr")+s(transport,bs="cr"),family=gaussian
(link=log),groupD,methods=REML)
Then I type " summary(noxd)". and show
Family: gaussian
Link function: log
Formula:
newNO2 ~ pressure
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
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
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,
2009 Mar 24
2
help: what are the basis functions in {mgcv}: gam?
I am writing my thesis with the function gam(), with the package {mgcv}.
My command is: gam(y~s(x1,bs="cr")+s(x2, bs="cr")).
I need help to know what are the default basis funcitons for gam. I have not
found any detailed reference for this.
Can anyone help me with this??
--
View this message in context:
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
2006 Jun 18
1
GAM selection error msgs (mgcv & gam packages)
Hi all,
My question concerns 2 error messages; one in the gam package and one in
the mgcv package (see below). I have read help files and Chambers and
Hastie book but am failing to understand how I can solve this problem.
Could you please tell me what I must adjust so that the command does not
generate error message?
I am trying to achieve model selection for a GAM which is required for
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
2010 Jun 18
2
varIdent error using gam function in mgcv
Hello,
As I am relatively new to the R environment this question may be either
a) Really simple to answer
b) Or I am overlooking something relatively simple.
I am trying to add a VarIdent structure to my gam model which is fitting
smoothing functions to the time variables year and month for a particular
species. When I try to add the varIdent weights to variable Month I get this
error returned.
2004 Sep 27
2
passing formula arg to mgcv::gam
Hi,
I have a function, callGam, that fits a gam model to a subset of a dataframe. The argument to callGam is a formula, the subset is determined inside the function itself. My na??ve approach generates and error, see below. I guess this is because 'idx' is loocked up in the environment of 'formula', but I am too ignorant about environments to be able to tell for sure. Could
2012 Aug 24
3
mgcv package, problems with NAs in gam
Hi there,
I'm using presence-absence data in a gam (i.e. 0 or 1 as values)
I am trying to run a gam with 'dummy covariates' i.e. 1~1
unfortunately my model:
*
model<-gam(1~1, data=bats, family=negbin)*
keeps putting out:
*
Error in gam(1 ~ 1, data = bats, family = negbin) :
Not enough (non-NA) data to do anything meaningful*
Is there a specific reason it would do this? I have
2011 Mar 28
2
mgcv gam predict problem
Hello
I'm using function gam from package mgcv to fit splines. ?When I try
to make a prediction slightly beyond the original 'x' range, I get
this error:
> A = runif(50,1,149)
> B = sqrt(A) + rnorm(50)
> range(A)
[1] 3.289136 145.342961
>
>
> fit1 = gam(B ~ s(A, bs="ps"), outer.ok=TRUE)
> predict(fit1, newdata=data.frame(A=149.9), outer.ok=TRUE)
Error
2007 Dec 13
1
Probelms on using gam(mgcv)
Dear all,
Following the help from gam(mgcv) help page, i tried to analyze my
dataset with all the default arguments. Unfortunately, it can't be run
successfully. I list the errors below.
#m.gam<-gam(mark~s(x,y)+s(lstday2004)+s(slope)+s(ndvi2004)+s(elevation)+s(disbinary),family=binomial(logit),data=point)
2012 Aug 14
1
Random effects in gam (mgcv 1.7-19)
Hi,
I am using the gam function in the mgcv package, I have random effects in
my model (bs="re") this has worked fine, but after I updated the mgcv
package to version 1.7-19 I recive an error message when I run the model.
>
fit1<-gam(IV~s(RUTE,bs="re")+s(T13)+s(H40)+factor(AAR)+s(V3)+s(G1)+s(H1)+s(V1)+factor(LEDD),data=data5,method="ML")
> summary.gam(fit1)