Possible solution to NAs in sleuth_lrt, addressing #68 #118
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi @pimentel,
Great work with the new release and all of the patches! Last suggestion from me before I turn it in for the weekend (I won't be available this weekend or all next week). As I commented in #68, I think the issue with
NAs
has to do with some target ids having mean observed counts outside of the bounds used to create the LOESS fit. The standard fit can't be extrapolated, which is what results in theNAs
.This is code that would attempt to pursue option 4, which is to produce an extrapolated value using the LOESS fit with
surface = "direct"
option. According to the documentation and my testing, the values can be extrapolated to the target ids that otherwise would haveNAs
. However, because the exact computation for the surface fit is much more expensive, I only recompute the fits for the target ids that areNA
.I also included a message that would let the user know when this occurs, and a column is included with the
sleuth_object$fits[[fit_name]]$summary
data.frame
that indicates whichtarget_ids
failed the initial shrinkage estimation (abbreviatedfailed_ise
), in case they want to follow-up or exclude thosetarget_ids
.Let me know what you think!