logical inconsistency (possible bug) with missing zeta in stability.correction

Issue #8 resolved
Thomas Wutzler created an issue

Unstable conditions use stability parameter zeta in stability correction. Currently, if zeta is missing both, the test for unstable and the test for stable conditions are TRUE.

https://bitbucket.org/juergenknauer/bigleaf/src/2c6f0e4e502af9565e946ba314a6819042988d78/R/stability_correction.r#lines-175

The risks of results depending on evaluation order and of missing values in psi. I suggest

  • either - explicitly setting psi to NA if zeta is missing (introduce third stability case: missing), or
  • treat missing zeta as stable condition.

for the second option, I propose replacing all occurences of “[unstable]” by “[!stable]” which ensures that no record is classified twice.

Comments (2)

  1. Juergen Knauer repo owner

    Bug fix in stability.correction(): test for stable/unstable conditions are false if zeta is missing. Function returns NA in this case. Fixes Issue #8.

    → <<cset 3c49e4b7059a>>

  2. Juergen Knauer repo owner

    Thanks, well spotted. I have implemented the first option but instead of introducing a third case I have initialised the output to NA which will not be overwritten if zeta is missing.

  3. Log in to comment