Closed hifrank42 closed 1 year ago
These values are correct; the est
column is the value of the smooth, which is centred about 0. To recover the values in the paper you need to add on the model constant / intercept term.
I need to revise the code in the supplement but this change was necessary to handle models with multiple smooths.
Thanks for answering, in addition, when using " intervals(mod$lme, which = "var-cov")$corStruct " to get confidence interval, sometimes creating error "Non-positive definite approximate variance-covariance Consider 'which = "fixed"'", changing values of k can solve, but I don't know why.
As mentioned in the paper, a model with a wiggly trend and a CAR(1) process is often unidentifiable; both components are effectively the same thing if one or the other is not constrained in some way. The error you are seeing occurs when the fitted model is unstable, likely for this identifiability reason. More generally, this error indicates the model is likely over-fitted; you need only one of the wiggly trend or the CAR(1).
I have updated the supplementary materials to work with the latest version of gratia (on GitHub). This also "fixes" the issue with the CAR(1) model, wherein I can now reproduce the near-unidentiable fit with default values. See the supplementary materials at the paper GitHub repo: https://github.com/gavinsimpson/frontiers-palaeo-additive-modelling
When I followed the code in "Supplementary materials for: Modelling palaeoecological time series using generalized additive models" the result of
are different from the guide.
Thus, the d15N values are lower than original values, despite with the same trend. cannot find the bug after a few trying, please help.