Displaying 20 results from an estimated 2000 matches similar to: "GAM Prediction"
2008 Apr 09
1
mgcv::predict.gam lpmatrix for prediction outside of R
This is in regards to the suggested use of type="lpmatrix" in the
documentation for mgcv::predict.gam. Could one not get the same result more
simply by using type="terms" and interpolating each term directly? What is
the advantage of the lpmatrix approach for prediction outside R? Thanks.
--
View this message in context:
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
2008 Apr 06
0
mgcv::gam prediction using lpmatrix
The documentation for predict.gam in library mgcv gives an example of using
an "lpmatrix" to do approximate prediction via interpolation. However, the
code is specific to the example wrt the number of smooth terms, df's for
each,etc. (which is entirely appropriate for an example)
Has anyone generalized this to directly generate code from a gam object (eg
SAS or C code)? I wanted to
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
2012 Aug 06
0
GAM and interpolation?
Hello fellow R users,
I would need your help on GAM/GAMM models and interpolation on a marked
spatial point process (cases and controls).
I use the mgcv package to fit a GAMM model with a binary outcome, a
parametric part (var1+..+varn), a spline used for the spatial variation, and
a random effect coded through another spline in this form:
gam(outcome~var1+.+varn+s(xlong+ylat)+s(var,
2009 Aug 31
7
"Missing these required gems: rspec-rails" in ruby 1.9
i get the above error when running rake.
I tried switching rails 2.3.3 with 2.3.2 but it didn''t help.
here are my gems:
actionmailer (2.3.2)
actionpack (2.3.2)
activerecord (2.3.2)
activeresource (2.3.2)
activesupport (2.3.2)
builder (2.1.2)
cucumber (0.3.98)
diff-lcs (1.1.2)
hoe (2.3.3)
nokogiri (1.3.3)
polyglot (0.2.8)
rack (1.0.0)
rails (2.3.2)
rake (0.8.7)
rspec (1.2.8)
rspec-rails
2011 Apr 19
1
Prediction interval with GAM?
Hello,
Is it possible to estimate prediction interval using GAM? I looked through
?gam, ?predict.gam etc and the mgcv.pdf Simon Wood. I found it can
calculate confidence interval but not clear if I can get it to calculate
prediction interval. I read "Inference for GAMs is difficult and somewhat
contentious." in Kuhnert and Venable An Introduction to R, and wondering why
and if that
2009 Sep 12
5
undefined method `^' for "d":String
Hi guys.
I''m a freshman on Rails (and Ruby) so I''m sorry if my question is
pretty basic, and possible has a vary basic answer. I tried to Google
this problem, but a couple of hour after and no solution found, I
decided to ask for help here.
I have installed ruby 1.9.1p243, Rails 2.3.4, Gem 1.3.5, SQLite
version 3.6.18 (I think this is all that it''s needed).
I´m reading
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)
2005 Feb 27
1
prediction, gam, mgcv
I fitted a GAM model with Poisson distribution
using the function gam() in the mgcv package.
My model is of the form:
mod<-gam(y~s(x0)+s(x1)+s(x2),family=poisson).
To extract estimates at a specified set of covariate
values I used the gam `predict' method.
But I want to get
estimate and standard error of the difference of two fitted values.
Can someone explain what should I do?
Thank
2001 Dec 22
2
gam plots
Dear R users,
Using the library(mgcv) and running R under MacOSX, I have fitted a
generalised additive model with binomial errors in order to check the
linearity of two continuous variables ap2mm and diffdaysm in a glm:
> mymodel.gam <- gam(diedhos~ s(ap2mm) + Dweekm + s(diffdaysm) +
Dweekm:diffdaysm + ap2mm:Dweekm, binomial)
I would like postscript gam plots for the two smoothed
2011 Jan 10
4
Meaning of pterms in survreg object?
I am trying to model survival data with a Weibull distribution
using survreg. Units are clustered two apiece, sometimes receiving
the same treatment and sometimes opposing treatment.
2012 Sep 25
1
REML - quasipoisson
hi
I'm puzzled as to the relation between the REML score computed by gam and
the formula (4) on p.4 here:
http://opus.bath.ac.uk/22707/1/Wood_JRSSB_2011_73_1_3.pdf
I'm ok with this for poisson, or for quasipoisson when phi=1.
However, when phi differs from 1, I'm stuck.
#simulate some data
library(mgcv)
set.seed(1)
x1<-runif(500)
x2<-rnorm(500)
2012 Oct 01
0
[Fwd: REML - quasipoisson]
Hi Greg,
For quasi families I've used extended quasi-likelihood (see Mccullagh
and Nelder, Generalized Linear Models 2nd ed, section 9.6) in place of
the likelihood/quasi-likelihood in the expression for the (RE)ML score.
I hadn't realised that this was possible before the paper was published.
best,
Simon
ps. sorry for slow reply, the original message slipped through my filter
for
2011 Dec 07
2
curve fitted ... how to retreive data
Dear R users,
I have now managed to fit the curve using the thin plate spline as follows:
library(mgcv)
b <- gam(y~s(x1,x2,k=100),data =dat)
vis.gam(b)
What I want now is to get the fitted data for y and copy it so that I use it for further analysis.
Many thanks in advance
mintewab
2009 Dec 18
1
rubyinstaller-1.9.1-p243-rc1.exe | wxruby-ruby19-2.0.1-x86-mingw32.gem | encodage
Bonjour Alex.
Ce matin j'ai installer "rubyinstaller-1.9.1-p243-rc1.exe"
"wxruby-ruby19-2.0.1-x86-mingw32.gem"
"SciTE.exe 2.0.1.0"
Quand j'exécute (avec scite) mon fichier "Rss-wxruby.rbw" qui est encodé
en utf8 et qui habituellement(avec les anciennes versions de ruby,
wxruby et scite) fonctionne correctement, j'obtient ce message
2009 Nov 07
0
wrong argument type Mysql (expected Struct) running rake with Ruby 1.9 / Rails 2.3.3
I''m use Ruby 1.9 via rvm and Rails 2.3.3. I''m on OS X 10.5 and I have
the mysql 2.8.1 gem installed. When I run rake on my rails app, I get
the error "wrong argument type Mysql (expected Struct)". I can run
the app fine with script/server and script/console fine. Is anyone
else having this problem or know what might cause this problem?
Here''s the stack
2013 Mar 23
1
Time trends with GAM
Hi all,
I am using GAM to model time trends in a logistic regression. Yet I would
like to extract the the fitted spline from it to add it to another model,
that cannot be fitted in GAM or GAMM.
Thus I have 2 questions:
1) How can I fit a smoother over time so that I force one knot to be at a
particular location while letting the model to find the other knots?
2) how can I extract the matrix
2003 May 16
2
glm and gam confidence intervals
How can I obtain the values of confidence intervals from gam anf glm
objects?
Thanks in advance
--
David Nogu?s Bravo
Functional Ecology and Biodiversity Department
Pyrenean Institute of Ecology
Spanish Research Council
Av. Monta?ana 1005
Zaragoza - CP 50059
976716030 - 976716019 (fax)
2007 Mar 27
1
gam parameter predictions --Sorry for double posting
R-help,
Sorry for posting again the same question (dated 26-03-2007) but
all my mails have been sent to the recycle bin without possibility
of recovering and thus I don't know if anyone has answer my query.
Here is the original message:
I'm applying a gam model (package mgcv) to predict
relative abundances of a fish species.
The covariates are year, month, vessel and statistical