similar to: Issue of reproducibility with gam and lm.wfit in different versions of R

Displaying 20 results from an estimated 6000 matches similar to: "Issue of reproducibility with gam and lm.wfit in different versions of R"

2007 Dec 18
2
"gam()" in "gam" package
R-users E-mail: r-help@r-project.org I have a quenstion on "gam()" in "gam" package. The help of gam() says: 'gam' uses the _backfitting algorithm_ to combine different smoothing or fitting methods. On the other hand, lm.wfit(), which is a routine of gam.fit() contains: z <- .Fortran("dqrls", qr = x * wts, n = n, p = p, y = y *
2008 Aug 07
1
Fitted values with small weights in lm.wfit (PR#11979)
Full_Name: Alexander Blocker Version: 2.7.1 OS: Ubuntu 8.04 / Windows XP Submission from: (NULL) (76.119.235.225) When running lm(modeleq, weights=wt, data=dataset) with small weights (<1e-10), I have encountered an odd phenomenon with fitted values. Due to numerical precision issues, the fitted values and residuals returned by lm.wfit (from its .Fortran call to dqrls) can differ greatly from
2007 Dec 18
1
R-users
R-users E-mail: r-help@r-project.org I have a quenstion on "gam()" in "gam" package. The help of gam() says: 'gam' uses the _backfitting algorithm_ to combine different smoothing or fitting methods. On the other hand, lm.wfit(), which is a routine of gam.fit() contains: z <- .Fortran("dqrls", qr = x * wts, n = n, p = p, y = y *
1999 Mar 09
0
Bug in lm.wfit with zero weights in 0.63.3 (PR#136)
R 0.63.3 (any platform) library(lqs) example(lqs) gives Warning in (y - z$residuals) + offset : longer object length is not a multiple of shorter object length repeatedly. The problem is in lm.wfit, which removes cases with zero weights, but does not adjust the offset. The fix is z$fitted.values <- (y - z$residuals) z$weights <- w if (zero.weights) {
2005 Oct 12
0
step.gam- question
This is covered in the helpfile, but perhaps not clearly enough. The gam chapter in the "white book" has more details. step.gam moves around the terms in the scope aregumnet in an ordered fashion. So if a scope element is ~ 1 + x +s(x,4) + s(x,8) and the formula at some stage is ~ x + .... then if direction="both", the routine checks both "1" and
2007 Dec 12
0
Hep on using GAM() in R
Dear friends, I met some problem on using GAM() function in R. Any help or suggestions are greatly appreciated. # My programs and problems are list below# library(splines) library(gam) point<-read.csv("d:/gam.csv",sep=",",header=TRUE) #read the data gam.opt<-gam(mark~lo(x,y,span=0.2)+lo(lstday2004,span=0.2)+lo(slope,span=0.2)+lo(ndvi2004,span=
2005 Oct 12
1
step.gam and number of tested smooth functions
Hi, I'm working with step.gam in gam package. I'm interested both in spline and lowess functions and when I define all the models that I'm interested in I get something like that: > gam.object.ALC<-gam(X143S~ALC,data=dane,family=binomial) >
2005 Apr 18
0
Discrepancy between gam from gam package and gam in S-PLUS
Dear Trevor, I've noticed a discrepancy in the degrees of freedom reported by gam() from the gam package in R vs. gam() in S-PLUS. The nonparametric df differ by 1; otherwise (except for things that depend upon the df), the output is the same: --------- snip ------------ *** From R (gam version 0.93): > mod.gam <- gam(prestige ~ lo(income, span=.6), data=Prestige) >
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
2012 Aug 22
2
AIC for GAM models
Dear all, I am analysing growth data - response variable - using GAM and GAMM models, and 4 covariates: mean size, mean capture year, growth interval, having tumors vs. not The models work fine, and fit the data well, however when I try to compare models using AIC I cannot get an AIC value. This is the code for the gam 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
2010 Jan 26
1
AIC for comparing GLM(M) with (GAM(M)
Hello I'm analyzing a dichotomous dependent variable (dv) with more than 100 measurements (within-subjects variable: hours24) per subject and more than 100 subjects. The high number of measurements allows me to model more complex temporal trends. I would like to compare different models using GLM, GLMM, GAM and GAMM, basically do demonstrate the added value of GAMs/GAMMs relative to
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
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
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 Feb 28
0
use of step.gam (from package 'gam') and superassignment inside functions
Hello, I am using the function step.gam() from the 'gam' package (header info from library(help=gam) included below) and have come across some behavior that I cannot understand. In short, I have written a function that 1) creates a dataframe, 2) calls gam() to create a gam object, then 3) calls step.gam() to run stepwise selection on the output from gam(). When I do this, gam()
2005 Oct 24
2
GAM and AIC: How can I do??? please
Hello, I'm a Korean researcher who have been started to learn the "R" package. I want to make gam model and AIC value of the model to compare several models. I did the GAM model, but there were error for AIC. SO, how can I do? pleas help me!!! I did like below; > a.fit <- gam(pi~ s(t1r), family = gaussian(link="log")) >
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)
2005 Mar 24
1
Prediction using GAM
Recently I was using GAM and couldn't help noticing the following incoherence in prediction: > data(gam.data) > data(gam.newdata) > gam.object <- gam(y ~ s(x,6) + z, data=gam.data) > predict(gam.object)[1] 1 0.8017407 > predict(gam.object,data.frame(x=gam.data$x[1],z=gam.data$z[1])) 1 0.1668452 I would expect that using two types of predict arguments
2009 Apr 28
0
problems in package gam
Hi all, until now I have generally used mgcv for gams, however, I decided to experiment with the package gam, and have ran into the previously outlined problem (see below), for which I have not yet found a solution in the archives. If anyone has any suggestions, please let me know. The only difference for my case is that I am running R 2.9.0 under windows Thank you! I'm running R