Displaying 20 results from an estimated 6000 matches similar to: "gam"
2009 Aug 24
2
Formulas in gam function of mgcv package
Dear R-experts,
I have a question on the formulas used in the gam function of the mgcv
package.
I am trying to understand the relationships between:
y~s(x1)+s(x2)+s(x3)+s(x4)
and
y~s(x1,x2,x3,x4)
Does the latter contain the former? what about the smoothers of all
interaction terms?
I have (tried to) read the manual pages of gam, formula.gam, smooth.terms,
linear.functional.terms but
2009 Aug 24
2
Formulas in gam function of mgcv package
Dear R-experts,
I have a question on the formulas used in the gam function of the mgcv
package.
I am trying to understand the relationships between:
y~s(x1)+s(x2)+s(x3)+s(x4)
and
y~s(x1,x2,x3,x4)
Does the latter contain the former? what about the smoothers of all
interaction terms?
I have (tried to) read the manual pages of gam, formula.gam, smooth.terms,
linear.functional.terms but
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
2000 Oct 03
5
Where is gam?
I noticed that there is no generalised additive model functions in R
(1.1.1) ... is there a package that implements them?
Thanks
Prasad
*****************************************************************
Mr. Anantha Prasad, Ecologist/GIS Specialist
USDA Forest Service, 359 Main Rd.
Delaware OHIO 43015 USA
Ph: 740-368-0103 Email: aprasad at fs.fed.us
Web:
2007 Oct 08
2
variance explained by each term in a GAM
Hello fellow R's,
I do apologize if this is a basic question. I'm doing some GAMs using the mgcv package, and I am wondering what is the most appropriate way to determine how much of the variability in the dependent variable is explained by each term in the model. The information provided by summary.gam() relates to the significance of each term (F, p-value) and to the
2009 Mar 04
1
help with GAM
Hi
I'm trying to do a GAM analysis and have the following codes entered
into R (density is = sample number, alive are the successes)
density<-as.real(density)
y<-cbind(alive,density-alive)
library(mgcv)
m1<-gam(y~s(density),binomial)
at which point I get the following error message
Error in smooth.construct.tp.smooth.spec(object, dk$data, dk$knots) :
A term has fewer unique
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
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
2012 May 23
1
mgcv: How to calculate a confidence interval of a ratio
Dear R-Users,
Dr. Wood replied to a similar topic before where confidence intervals were
for a ratio of two treatments (
https://stat.ethz.ch/pipermail/r-help/2011-June/282190.html). But my
question is more complicated than that one. In my case, log(E(y)) = s(x)
where y is a smooth function of x. What I want is the confidence interval
of a ratio of log[(E(y2))/E(y1)] given two fixed x values of
2005 Jan 13
2
GAM: Remedial measures
I fitted a GAM model with Poisson distribution to a data with about 200
observations. I noticed that the plot of the residuals versus fitted values
show a trend. Residuals tend to be lower for higher fitted values. Because,
I'm dealing with count data, I'm thinking that this might be due to
overdispersion. Is there a way to account for overdispersion in any of the
packages MGCV or GAM?
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
2007 Nov 25
1
GAM with constraints
Hi,
I am trying to build GAM with linear constraints, for a general link
function, not only identity. If I understand it correctly, the function
pcls() can solve the problem, if the smoothness penalties are given.
What I need is to incorporate the constraints before calculating the
penalties. Can this be done in R?
Any help would be greately appreciated.
--
View this message in context:
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
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
2013 Nov 06
3
Nonnormal Residuals and GAMs
Greetings, My question is more algorithmic than prectical. What I am
trying to determine is, are the GAM algorithms used in the mgcv package
affected by nonnormally-distributed residuals?
As I understand the theory of linear models the Gauss-Markov theorem
guarantees that least-squares regression is optimal over all unbiased
estimators iff the data meet the conditions linearity,
2007 Jun 25
1
gam function in the mgcv library
I would like to fit a logistic regression using a smothing spline, where the spline is a piecewise cubic polynomial. Is the knots option used to define the subintervals for each piece of the cubic spline? If yes and there are k knots, then why does the coefficients field in the returned object from gam only list k coefficients? Shouldn't there be 4k -4 coefficients?
Sincerely,
Bill
2012 Nov 29
1
[mgcv][gam] Manually defining my own knots?
Dear List,
I'm using GAMs in a multiple imputation project, and I want to be able
to combine the parameter estimates and covariance matrices from each
completed dataset's fitted model in the end. In order to do this, I
need the knots to be uniform for each model with partially-imputed
data. I want to specify these knots based on the quantiles of the
unique values of the non-missing
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
2010 Jun 03
4
gam error
Hi all,
I'm trying to use a gam (mgcv package) to analyse some data with a roughly U
shaped curve. My model is very simple with just one explanatory variable:
m1<-gam(CoT~s(incline))
However I just keep getting the error message
"Error in smooth.construct.tp.smooth.spec(object, dk$data, dk$knots) :
A term has fewer unique covariate combinations than specified maximum
degrees of
2011 Nov 08
3
GAM
Hi R community!
I am analyzing the data set "motorins" in the package "faraway" by using
the generalized additive model. it shows the following error. Can some one
suggest me the right way?
library(faraway)
data(motorins)
motori <- motorins[motorins$Zone==1,]
library(mgcv)
>amgam <- gam(log(Payment) ~ offset(log(Insured))+
s(as.numeric(Kilometres)) + s(Bonus) + Make +