Is your range tidal height at the same location at the time of sampling
(time & day), or variation among sites in elevation above some datum at the
(same) time of sampling? Or does it vary by day but not by time?
If the former, given the predictable way that the tide cycle shifts from
one day to the next, for some times of the year you're going to have a
tough time separating out an effect of range from smoothed effects of day
and time. If you need to visualize this, pull the NOAA 6 minute tidal
predictions from somewhere near your site (I can send R code to do this).
Or, plot a simple heatmap of your data:
lattice::levelplot(range~day+time,data=dsn)
Also, be careful with your cyclic fit on time of day.
s(time,bs="cc")
If your time values are not evenly spaced (e.g., full 0:24) you are likely
to need to specify knots to let gamm know that 0 and 24 are the ends to
match. My first guess would be that you need:
knots=list(time=c(0,24))
but I don't know your data, so your mileage will vary.
Tom 2
On Wed, Oct 14, 2015 at 10:19 AM, Highland Statistics Ltd <
highstat at highstat.com> wrote:
------------------------------
Message: 2
Date: Mon, 12 Oct 2015 12:13:44 -0700
From: "Hannah L. Linder" <lindeh at uw.edu>
To: r-sig-mixed-models at r-project.org
Subject: [R-sig-ME] GAMM convergence issue with temporal covariate
Message-ID:
<CAF0=RbauKGU3JOsPxBkuka=
MBZZU0rZNkAyYt_or4p1h25wmBQ at mail.gmail.com>
Content-Type: text/plain; charset="UTF-8"
Hello,
I am working with a fairly simple model:
gamm(sv~s(day,bs="cr")+range+s(time,bs="cc"),correlation=corARMA(p=2,q=2)
In which day is Julian Day over one month, range is tidal range, and time
is coded 1-24 for hour of day.
I continually have singularity convergence problems with this model (the
error is: nlminb
problem, convergence error code = 1 message = false convergence (8).
Increasing iterations does not help. When I run msVerbose I notice that
"day" covariate output values (there are two but I'm not completely sure
how to interpret them) keep increasing until the convergence errors
I have also noticed that setting k=5 for the "day" covariate does not
the convergence problem, but k=9 does (the default is 10) or k =20. I
greatly appreciate any advice or recommendations on what may be causing
problem.
Thank-you very much,
Hannah
--------
Hannah,
CorARMA(p = 2, q = 2) is not an easy one for the optimisation routine.
simplifying it.
Additionally...the ARMA residual correlation structure may be competing
with the time smoothers.
You could try to use fixed values for the ARMA parameters.
Alain Zuur