Displaying 20 results from an estimated 10000 matches similar to: "about partial response and partial residual"
2012 Jun 30
2
About Error message
Hi again!
I have a question about R.
I have done gam in previous version of R with "mgcv" package and saved the
workspace. This workspace contains different models and I will do prediction
by these GAMs.
However, I install new version of R. and use the same workspace. when I type
summary(models), and the error message showed
Error in Predict.matrix.cr.smooth(object, dk$data) : F is
2011 Jun 21
5
please help for mgcv package
i read a book from WOOD, there's an example which is talking about the
pollutant.
library(gamair)
library(mgcv)
y<-gam(death~s(time,bs="cr",k=200)+s(pm10median,bs="cr")+s(so2median,bs="cr")+s(o3median,bs="cr")+s(tmpd,bs="cr"),data=chicago,family=Possion)
lag.sum<-function(a,10,11)
{n<-length(a)
b<-rep(0,n-11)
for(i in 0:(11-10))
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 GAM to
2011 Feb 16
1
retrieving partial residuals of gam fit (mgcv)
Dear list,
does anybody know whether there is a way to easily retrieve the so called "partial residuals" of a gam fit with package mgcv? The partial residuals are the residuals you would get if you would "leave out" a particular predictor and are the dots in the plots created by
plot(gam.object,residuals=TRUE)
residuals.gam() gives me whole model residuals and
2023 Apr 30
2
NaN response with gam (mgcv library)
Dear R-experts,
Here below my R code. I get a NaN response for gam with mgcv library. How to solve that problem?
Many thanks.
#########################################################
library(mgcv)
?
y=c(23,24,34,40,42,43,54,34,52,54,23,32,35,45,46,54,34,36,37,48)
x1=c(0.1,0.3,0.5,0.7,0.8,0.9,0.1,0.7,0.67,0.98,0.56,0.54,0.34,0.12,0.47,0.52,0.87,0.56,0.71,0.6)
2012 Jun 21
2
check.k function in mgcv packages
Hi,everyone,
I am studying the generalized additive model and employ the package 'mgcv'
developed by professor Wood.
However,I can not understand the example listed in check.in function.
For example,
library(mgcv)
set.seed(1)
dat <- gamSim(1,n=400,scale=2)
## fit a GAM with quite low `k'
b<-gam(y~s(x0,k=6)+s(x1,k=6)+s(x2,k=6)+s(x3,k=6),data=dat)
plot(b,pages=1,residuals=TRUE)
2003 Jun 04
2
gam()
Dear all,
I've now spent a couple of days trying to learn R and, in particular, the
gam() function, and I now have a few questions and reflections regarding
the latter. Maybe these things are implemented in some way that I'm not yet
aware of or have perhaps been decided by the R community to not be what's
wanted. Of course, my lack of complete theoretical understanding of what
2011 Jun 09
0
Fwd: Re: residual checking for GAM (mgcv)
The plots look reasonable to me. The plot of residuals against linear
predictor always looks scary when many of the fitted values are very
close to zero, so I tend to look at residuals against sqrt(fitted) in
such cases. I don't think that the presence of the zero curve is a
reason to reject the model --- it's easy to produce such plots by
fitting a completely correct model to simulated
2011 Aug 01
1
Problem with gam() after R update
Dear group,
I experience s?ome problems with gam() function after R update to version 2.13.1
The function in both gam and mgcv packages stopped to work. Before, with the same code I used, everything was fine.
The function from gam package yields following warning:
Residual degrees of freedom are negative or zero. This occurs when the sum of the parametric and nonparametric degrees of freedom
2002 Jan 28
1
residuals in plot.gam (mgcv)
Is there a way to add residuals to plots produced by plot.gam in the mgcv
package? I'm looking for something like what you get using resid=T in Splus
plot.gam.
Thanks in advance
Toby
-----Original Message-----
From: Simon Wood [mailto:snw at mcs.st-and.ac.uk]
Sent: 23 January, 2002 8:14 PM
To: Toby.Patterson at csiro.au
Cc: r-help at stat.math.ethz.ch
Subject: Re: [R] multiple surfaces in
2002 Sep 10
2
Hat values for generalized additive models
Would anyone be able to provide insight for the following question, please?
Setting: estimation of prediction intervals for age-period-cohort models
using GAMs (rate ~ s(age,period))
Method: bootstrap (Davison and Hinkley, 1997)
Issue: standardisation of the residuals for resampling requires an
adjustment using the diagonals of the hat matrix.
Is there a simple way to get the hat values out of a
2009 Sep 14
1
How to extract partial predictions, package mgcv
Dear package mgcv users,
I am using package mgcv to describe presence of a migratory bird species as
a function of several variables, including year, day number (i.e.
day-of-the-year), duration of survey, latitude and longitude. Thus, the
"global model" is:
global_model<-gam(present ~ as.factor(year) + s(dayno, k=5) + s(duration,
k=5) + s(x, k=5) + s(y, k=5), family =
2012 Nov 13
0
GAM model to reduce PACF of a model
I have asked this question on Stackoverflow and was told it does not relate
to the sites' mission as it is statistical question, thus I brought it here.
I am fitting a gam mode in the mgcv package to study associations of
environmental pollutants and mortality. The aim is to choose a model with
lowest mgcv and also to reduce the PACF to less than < |0.1|.
library(gamair)
library(mgcv)
2010 Mar 04
2
which coefficients for a gam(mgcv) model equation?
Dear users,
I am trying to show the equation (including coefficients from the model
estimates) for a gam model but do not understand how to.
Slide 7 from one of the authors presentations (gam-theory.pdf URL:
http://people.bath.ac.uk/sw283/mgcv/) shows a general equation
log{E(yi )} = ?+ ?xi + f (zi ) .
What I would like to do is put my model coefficients and present the
equation used. I am an
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
2010 Jun 27
1
mgcv out of memory
Hello, I am trying to update the mgcv package on my Linux box and I keep
getting an "Out of memory!" error. Does anyone know of a fix for this?
Below is a snippet of the message that I keep getting: Thank you. Geoff
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
>>> Building/Updating help pages for package 'mgcv'
Formats:
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 :
2008 Oct 01
1
Simon Wood GAMsetup
Dear Simon, Thank you for your quick reply!
I used to perform the GAMsetup in the following manner:
GAMsetup sintax:
x.summer: vector used for construct the spline
knots<-14
N<-length(x.summer)
x<-array(x.summer,dim=c(1,N))
G<-list(m=1,n=N,nsdf=0,df=knots+1,dim=1,s.type=0,by=0,by.exists=FALSE,p.order=0,x=x,n.knots=knots,fit.method="mgcv")
H<-GAMsetup(G)
with the
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,
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