best-cost / best-cost_WPs

This repository aim to collect the confidential (not public) work of the EU project BEST-COST in the framework of the workpackages (WPs).
1 stars 0 forks source link

Cutoff argument not applied to user-defined ERF in attribute_health() #319

Closed luytax closed 1 month ago

luytax commented 1 month ago

As Ingrid nicely illustrated in her mail from 2024-10-17 to AL (AC put in CC in reply), the cutoff argument doesn't seem to be considered when a user-defined function is inputted to er_eq_central.

luytax commented 1 month ago

I think I fixed it with this pull testing_Rpackage.Rmd ran without errors and the changes did not affect the results of the other chunks

@ungatoverde Please review the pull; if you think it's OK feel free to close this issue

ungatoverde commented 1 month ago

@luytax It is ok from my point of view, but here you are applying the cutoff in the exposure and not in the erf, right? Does NIPH agree on this? Should we not move the erf to the left to apply the cutoff in the erf?

luytax commented 1 month ago

@ungatoverde Yes it's in the exposure. I had to fix it quickly, and this seemed the easiest way. I haven't really discussed it with NIPH, they were just happy that the function worked and they could continue with the assessment.

We could move the erf function to the right, but that seems more complicated to implement. The way it is now (cutoff in exposure, i.e. exposure - cutoff) it is consistent with the other use cases in get_risk, see below

https://github.com/best-cost/best-cost_WPs/blob/a20b43749aa8d04696bff16a1263fd3224f10408/r_package/bestcost/R/get_risk.R#L44-L77

ungatoverde commented 1 month ago

@luytax OK. All fine.