-
Notifications
You must be signed in to change notification settings - Fork 20
Quant methods #291
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
base: main
Are you sure you want to change the base?
Quant methods #291
Conversation
|
Hey @dajmcdon. We'll take a look at this in about 2 weeks. Still in the "open heart surgery" changes to tune and company, trying to make a conference deadline. |
|
What Max said, i have 2 small things to work on in the meantime:
|
|
Thanks both! And no hurry. We'll probably want to handle #282 simultaneously. (FYI @brookslogan is a member of our team). |
EmilHvitfeldt
left a comment
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.
Lots of little comments. Overall looking good
R/impute-quantile_pred.R
Outdated
| if (any(indm)) { | ||
| qvals_out[indm] <- switch( | ||
| method, | ||
| linear = stats::approx(tau, qvals, tau_out[indm])$y, | ||
| cubic = Q(tau_out[indm]) | ||
| ) | ||
| } |
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.
If i'm not mistaken. Then I think we could avoid this switch() statement by moving it inside the if (middle == "cubic") { and if (middle == "linear" || any(is.na(result))) { correct?
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 believe this is streamlined via bd2121e
R/impute-quantile_pred.R
Outdated
| indl <- tau_out < min(tau) | ||
| indr <- tau_out > max(tau) | ||
| indm <- !indl & !indr |
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.
Could you enlighten me what indl, indr, and indm indicates in this context? thank you!
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've renamed these to be clearer. These are indexes that determine if the probabilities are being imputed (indm) versus extrapolated (the other two, outside the range of the existing probabilities).
Co-authored-by: Emil Hvitfeldt <[email protected]>
| }) | ||
|
|
||
|
|
||
|
|
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.
[air] reported by reviewdog 🐶
This is the first of a few possible PRs that our team discussed with @topepo and @EmilHvitfeldt .
Features and bug fixes:
quantile_predobject.vec_ptype2andvec_castmethods forquantile_pred. Without these, occasional downstream bugs happened on the object.quantile_predobject, say the median. This way, rather than trying to "match" doubles, it can just compute it directly. It can also be used to expand the set of quantiles represented by the object.snap()andis_quantile_pred().