Skip to content
Prev 11842 / 20628 Next

gamm4 error with large dataset

On 14-04-30 12:03 PM, Daniel Hocking wrote:
I can imagine that this problem is caused by the size of the
fixed-effect matrix.  A couple of thoughts (none of them practical, I'm
afraid):

  * I was going to say that it's too bad that we haven't yet managed to
implement a sparse model matrix structure;
  * then I was going to say that a potential trick/workaround for this
(for many-level _categorical_ variables) is to treat the factor as a
random effect, then use devFunOnly/modular structure to fix the theta
parameter for that variable at a large value, making it a pseudo-fixed
effect and getting the benefits of (1) a little bit of regularization
and (2) model matrix sparsity -- but doing this within gamm4 would be
harder/require more hacking
  * then I realized that your fixed-effect model matrix probably isn't
sparse, because it looks like it's made up entirely of continuous covariates
  * that got me thinking about the fact that some of your continuous
covariates only vary at higher levels (i.e. Lat/Long and presumably
Forest, Agriculture, elevation, etc.), and wondering whether there would
be any way to save space by going back to the underlying model
formulation and writing this out in terms of another multiplication of
higher-level covariates times an indicator matrix ...

  ... all of which is fascinating (to me at least) but none of which
actually gets you any farther with your specific problem.  Sorry.

  Ben Bolker