[R] gamm (package mgcv) with large datasets

2007-07-18 Thread Julian Burgos
Dear list, I am interested in fitting a Generalized Additive Mixed Model with spatially correlated errors to a large, spatially indexed, data set (~4000 observations). My initial analysis was a Generalized Additive Model that included a two dimensional smooth term to model spatially

Re: [R] gamm(): nested tensor product smooths

2006-11-08 Thread Simon Wood
I'd like to compare tests based on the mixed model representation of additive models, testing among others y=f(x1)+f(x2) vs y=f(x1)+f(x2)+f(x1,x2) (testing for additivity) In mixed model representation, where X represents the unpenalized part of the spline functions and Z the wiggly

[R] gamm(): nested tensor product smooths

2006-11-07 Thread Fabian Scheipl
I'd like to compare tests based on the mixed model representation of additive models, testing among others y=f(x1)+f(x2) vs y=f(x1)+f(x2)+f(x1,x2) (testing for additivity) In mixed model representation, where X represents the unpenalized part of the spline functions and Z the wiggly parts,

[R] gamm(): degrees of freedom of the fit

2006-11-01 Thread Fabian Scheipl
I wonder whether any of you know of an efficient way to calculate the approximate degrees of freedom of a gamm() fit. Calculating the smoother/projection matrix S: y - \hat y and then its trace by sum(eigen(S))$values is what I've been doing so far- but I was hoping there might be a more

Re: [R] gamm(): degrees of freedom of the fit

2006-11-01 Thread Thomas Lumley
On Wed, 1 Nov 2006, Fabian Scheipl wrote: Calculating the smoother/projection matrix S: y - \hat y and then its trace by sum(eigen(S))$values is what I've been doing so far- but I was hoping there might be a more efficient way than doing the spectral decomposition of an NxN-matrix. Well,

[R] gamm question

2006-08-08 Thread Piet Bell
Hello, I have two gamm question (I am using gamm in mgcv). 1. In have, say 5 time series. Monthly data, 20 year. The 5 time series are from 5 stations. The data are in vectors, so I have fitted something along the lines of: tmp-gamm(Y ~ s(Year,by=station1)+s(Year,by=station2)+

Re: [R] gamm

2006-07-19 Thread Simon Wood
Sorry for the delay replying: I was on holiday, but have foolishly come back. I am a bit confused about gamm in mgcv. Consulting Wood (2006) or Ruppert et al. (2003) hasn't taken away my confusion. In this code from the gamm help file:

[R] gamm

2006-07-03 Thread Piet Bell
Hello, I am a bit confused about gamm in mgcv. Consulting Wood (2006) or Ruppert et al. (2003) hasn't taken away my confusion. In this code from the gamm help file: b2-gamm(y~s(x0)+s(x1)+s(x2)+s(x3),family=poisson,random=list(fac=~1)) Am I correct in assuming that we have

[R] gamm and binomial data

2006-07-03 Thread Piet Bell
Hello, I have a response variable that is a time series of 0's and 1's. And a couple of continous explanatory variables. I would like to fit a gamm with auto-correlation and binomial distribution using gamm in mgcv. Something simple like: tmp-gamm(y ~ s(x),

Re: [R] gamm error message

2006-06-21 Thread Simon Wood
This is a bug. The `prior.weights' element of the the faked `gam' object (i.e. `test$gam$prior.wieghts' below) has been set to the varIdent() variance function, rather than the weights that this eventually represents. I'll fix this for the next patch release, (as soon as I get any time to do

[R] gamm error message

2006-06-06 Thread Highland Statistics Ltd.
Hello, Why would I get an error message with the following code for gamm? I want to fit the a gam with different variances per stratum. library(mgcv) library(nlme) Y-rnorm(100) X-rnorm(100,sd=2) Z-rep(c(T,F),each=50) test-gamm(Y~s(X),weights=varIdent(form=~1|Z)) summary(test$lme) #ok

[R] GAMM in mgcv - degrees of freedom for smooth terms

2005-04-13 Thread SwainD
Is it possible to set the degrees of freedom for the smooth term in a gamm to a specfic value? This can be done using gam in mgcv as follows: tst.gam-gam(y~s(x, k=6, fx=T)) However, this doesn't seem to work with gamm: tst.gamm-gamm(y~s(x, k=6, fx=TRUE, bs=cr)) Instead, this

[R] GAMM in mgcv - significance of smooth terms

2005-04-13 Thread SwainD
In the summary of the gam object produced by gamm, the Approximate significance of smooth terms appears to be a test of the improvement in fit over a linear model, rather than a test of the significance of the overall effect of x on y: test.gamm-gamm(y~te(x, bs=cr), random=list(grp=~1))

[R] gamm with correlation structure question

2005-01-21 Thread Kel Lam
Dear group, I am trying to use gamm() in mgcv. Here's the scenario. The data frame has approx. 110K observations with information on paediatric readmission binary outcome (Y/N) and total volume of their most responsible physician as the covariate. Since any physician can have multiple