Hello, I am modelling the diet of Nile perch through time. I have 3 diet classes as my response variables; fish 1, fish 2, and invertebrates. The response variables are correlated, declines in invert consumption ~ increase in fish consumption. Any advice on how to handle this would be appreciated. I would like to use GAMs as my time series shows fluctuations that could only be fit by high order polynomials if I were to use a linear model, but open to suggestions. Thank you for your time. P.s. I will be comparing the fit of the time series GAM with a model based on other predictors, with a training and validation split for my data. --- Tristan Kosciuch Stewart Biology Building, McGill University 1205 Dr Penfield Ave, Montreal QC H3A 1B1 [[alternative HTML version deleted]]
It might be possible via the VGAM package: https://cran.r-project.org/package=VGAM But I've never used this package, so not sure. It may also be possible to use a single response, by including additional explanatory terms. This is what I would do, if I could... Noting that some GAM implementations allow categorical variables and interactions. On Sat, Apr 18, 2020 at 11:00 AM Tristan Kosciuch <tristan.kosciuch at mail.mcgill.ca> wrote:> > Hello, > > I am modelling the diet of Nile perch through time. I have 3 diet classes as > my response variables; fish 1, fish 2, and invertebrates. > > The response variables are correlated, declines in invert consumption ~ > increase in fish consumption. Any advice on how to handle this would be > appreciated. I would like to use GAMs as my time series shows fluctuations > that could only be fit by high order polynomials if I were to use a linear > model, but open to suggestions. > > Thank you for your time. > > P.s. I will be comparing the fit of the time series GAM with a model based > on other predictors, with a training and validation split for my data. > > > > --- > > Tristan Kosciuch > > Stewart Biology Building, McGill University > > 1205 Dr Penfield Ave, Montreal QC H3A 1B1 > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.
https://cran.r-project.org/web/views/Multivariate.html https://cran.r-project.org/web/views/Environmetrics.html https://cran.r-project.org/web/views/TimeSeries.html Also search on "multiresponse GAM" or similar at rseek.org. This brought up what looked to me like useful hits. And of course, don't forget Mama Google. Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Fri, Apr 17, 2020 at 4:00 PM Tristan Kosciuch < tristan.kosciuch at mail.mcgill.ca> wrote:> Hello, > > I am modelling the diet of Nile perch through time. I have 3 diet classes > as > my response variables; fish 1, fish 2, and invertebrates. > > The response variables are correlated, declines in invert consumption ~ > increase in fish consumption. Any advice on how to handle this would be > appreciated. I would like to use GAMs as my time series shows fluctuations > that could only be fit by high order polynomials if I were to use a linear > model, but open to suggestions. > > Thank you for your time. > > P.s. I will be comparing the fit of the time series GAM with a model based > on other predictors, with a training and validation split for my data. > > > > --- > > Tristan Kosciuch > > Stewart Biology Building, McGill University > > 1205 Dr Penfield Ave, Montreal QC H3A 1B1 > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >[[alternative HTML version deleted]]
Thanks, I think family=mvn(d=3) ?in mgcv gam() works! --- Tristan Kosciuch Stewart Biology Building, McGill University 1205 Dr Penfield Ave, Montreal QC H3A 1B1 ________________________________ From: Bert Gunter <bgunter.4567 at gmail.com> Sent: Friday, April 17, 2020 7:28 PM To: Tristan Kosciuch <tristan.kosciuch at mail.mcgill.ca> Cc: r-help at R-project.org <r-help at r-project.org> Subject: Re: [R] Multi response GAM https://cran.r-project.org/web/views/Multivariate.html https://cran.r-project.org/web/views/Environmetrics.html https://cran.r-project.org/web/views/TimeSeries.html Also search on "multiresponse GAM" or similar at rseek.org<http://rseek.org>. This brought up what looked to me like useful hits. And of course, don't forget Mama Google. Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Fri, Apr 17, 2020 at 4:00 PM Tristan Kosciuch <tristan.kosciuch at mail.mcgill.ca<mailto:tristan.kosciuch at mail.mcgill.ca>> wrote: Hello, I am modelling the diet of Nile perch through time. I have 3 diet classes as my response variables; fish 1, fish 2, and invertebrates. The response variables are correlated, declines in invert consumption ~ increase in fish consumption. Any advice on how to handle this would be appreciated. I would like to use GAMs as my time series shows fluctuations that could only be fit by high order polynomials if I were to use a linear model, but open to suggestions. Thank you for your time. P.s. I will be comparing the fit of the time series GAM with a model based on other predictors, with a training and validation split for my data. --- Tristan Kosciuch Stewart Biology Building, McGill University 1205 Dr Penfield Ave, Montreal QC H3A 1B1 [[alternative HTML version deleted]] ______________________________________________ R-help at r-project.org<mailto:R-help at r-project.org> mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. [[alternative HTML version deleted]]
You might want to start by re-expressing the "amounts" variables to total amount * (relative fish 1, relative fish 2, invertebrates) and then using the Isometric Log-ratio transformation to convert the compositional part to orthonormal coordinates. https://stats.stackexchange.com/questions/259208/how-to-perform-isometric-log-ratio-transformation may help. I can't help wondering whether viewing the diet in terms of the nutrients offered by the different components might yield more insight. On Sat, 18 Apr 2020 at 11:00, Tristan Kosciuch <tristan.kosciuch at mail.mcgill.ca> wrote:> > Hello, > > I am modelling the diet of Nile perch through time. I have 3 diet classes as > my response variables; fish 1, fish 2, and invertebrates. > > The response variables are correlated, declines in invert consumption ~ > increase in fish consumption. Any advice on how to handle this would be > appreciated. I would like to use GAMs as my time series shows fluctuations > that could only be fit by high order polynomials if I were to use a linear > model, but open to suggestions. > > Thank you for your time. > > P.s. I will be comparing the fit of the time series GAM with a model based > on other predictors, with a training and validation split for my data. > > > > --- > > Tristan Kosciuch > > Stewart Biology Building, McGill University > > 1205 Dr Penfield Ave, Montreal QC H3A 1B1 > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.