-
Notifications
You must be signed in to change notification settings - Fork 5
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
888 residuals #939
888 residuals #939
Conversation
…ts of residuals across all simulations by output
TODO: Output and SimulationSets needs to manage the property
some tests failed on all systems... |
NAMESPACE
Outdated
@@ -1,5 +1,7 @@ | |||
# Generated by roxygen2: do not edit by hand | |||
|
|||
export("geomean*sd") | |||
export("geomean/sd") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a valid function name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pchelle Please rename the functions. You have to call the functions in quotes otherwise
`geomean*sd`(c(1,2,3))
Not sure if export must contain the quotes as well then, but having such a function name is pretty crazy from my point of view.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. I don't even know why this is allowed
(hopefully, this will enforce its installation in the vignettes)
Checking if rlang might be responsible for errors in tests
Codecov ReportBase: 72.59% // Head: 70.47% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## develop #939 +/- ##
===========================================
- Coverage 72.59% 70.47% -2.13%
===========================================
Files 58 58
Lines 7379 7719 +340
===========================================
+ Hits 5357 5440 +83
- Misses 2022 2279 +257
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
ymax = tlf::tlfStatFunctions$`Percentile97.5%`, | ||
yCaption = "median", | ||
# The unicode characters below are superscript th | ||
rangeCaption = "[2.5\u1d57\u02b0-97.5\u1d57\u02b0] percentiles" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when entering this in R I get the following result:
> "[2.5\u1d57\u02b0-97.5\u1d57\u02b0] percentiles"
[1] "[2.5\u1d57ʰ-97.5\u1d57ʰ] percentiles"
But the unicode seems to be correct.
Does it look good when creating a report?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On my local computer it does.
I checked the default printing documentation that indicates the following:
Whether a character is printable depends on the current locale and the operating system
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And when checking using vscode on the md document, it also does look good.
My plots also looks okay, but I don't know if they will on your side
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
interesting...
OK, let's keep it for now AS IS, I will check later how the reports look like e.g. on my machine
R/reportingengine-env.R
Outdated
ymax = "geomeanMultipliedBySD", | ||
yCaption = "geometric mean", | ||
# The unicode character below is supposed to be */ symbol | ||
rangeCaption = "mean \u22c7 geometric SD range" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was the caption supposed to be "mean */ geometric SD range"?
because when entering this in R I get:
> "mean \u22c7 geometric SD range"
[1] "mean ⋇ geometric SD range"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I checked for the unicode of +/- and found there was also one for */
If it looks weird I can revert and use */ instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use */
.
After looking at the symbol in very big resolution (https://www.compart.com/en/unicode/U+22c7) I finally understood what it is, but in the smaller size it just looks like "*"
simulatedData <- removeNegativeValues(simulatedData, dataMapping$y) | ||
observedData <- removeNegativeValues(observedData, dataMapping$y) | ||
lloqData <- removeNegativeValues(lloqData, dataMapping$y) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are some problems with this solution.
But I would suggest to address them in the separate PR in order not to block this PR for even longer.
(just created an issue for this: #942)
I have already created the issue for this in the ospuite-R (because residuals are calculated there as well):
Open-Systems-Pharmacology/OSPSuite-R#1091
In short:
- Removing <=0 values (especially observed values) is not correct. E.g. if we have
observed = 0
andsimulated >>0
, we just ignore a significant residual in such a case. - Very small positive values are problematic for log residuals as well. E.g. having
observed = 1e-100
andsimulated = 1e-200
would produce a huge log residual, but in fact the difference is irrelevant - both values are numerical zero.
For this, PK-Sim/MoBi introduces the LogSafe
function, which is used for calculating log residuals and defined as:
LogSafe(Y) = Log(Max(Y, LogSafeEpsilon))
(with LogSafeEpsilon currently defined as 1E-20)
And Lin residuals are calculated with all the values AS IS
No description provided.