Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct non relevant change of emerging status due to negligible non zero values of 1st and 2nd derivative #150

Closed
damianooldoni opened this issue Jan 22, 2025 · 2 comments
Assignees

Comments

@damianooldoni
Copy link
Collaborator

damianooldoni commented Jan 22, 2025

From @ToonVanDaele mail:

the colors switch multiple times between green (no emergency) orange (pot. emergency) and red (emergence) although visually there's just a flat line, with no indication of emergence (example Xenopus aevis) . This is probably because the confidence intervals in the middle of the times series are very small and even the slightest upward bend in the additive model will show 'emergence'. I dived into the code a bit. Maybe this effect can be avoided by relaxing the conditions for the lower ci in the 'apply_gam' function (example 0.01 instead of 0).

The solution proposed from @ToonVanDaele to check is to replace:
https://github.com/trias-project/trias/blob/main/R/apply_gam.R#L683

with

.data$lower_ci >= 0.01 & .data$upper_ci > 0 ~ 1

I propose the symmetric condition

.data$lower_ci < 0 & .data$upper_ci <= - 0.01 ~ -1,
@damianooldoni
Copy link
Collaborator Author

Just embedding a png example as link to picture could not be stable in the future.

Image

@damianooldoni damianooldoni changed the title Change emerging status due to negligible non zero values of 1st and 2nd derivative Correct non relevant change of emerging status due to negligible non zero values of 1st and 2nd derivative Jan 22, 2025
damianooldoni added a commit that referenced this issue Jan 24, 2025
@damianooldoni
Copy link
Collaborator Author

Fixed via #157

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant