-
-
Notifications
You must be signed in to change notification settings - Fork 84
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
issue 267 - ECDF plots #273
issue 267 - ECDF plots #273
Conversation
…splot into ecdf-plots-issue-267
…cdf-plots-issue-267
#' @return Either throws an error or returns a numeric matrix. | ||
#' @noRd | ||
validate_pit <- function(pit) { | ||
stopifnot(is.matrix(pit), is.numeric(pit)) |
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.
Why pit needs to be a matrix? The ecdf plot function would be useful also for vectors.
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.
This should be extended and tested for vectors.
First
then this works
but this doesn't
|
u_scale <- function(x) { | ||
array(rank(x) / length(x), dim = dim(x), dimnames = dimnames(x)) | ||
} |
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.
Why this is defined differently from the posterior package?
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 had not seen the counterpart in the posterior package. There the fractional ranks seem to be normalized to { 1 / (2S), ..., 1 - 1 / (2S) }, where S is the number of values in the combined sample. Is the idea there to move the fractional ranks to the middle of the respective "bins" instead of having them at the "edges" as is implemented above?
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.
It would be good to use the same function or use different name for the function if the functionaility is different.
The posterior::u_scale sets the values so that transformation to normal would produce values that are close to normal ordered statistics (while 0 and 1 would transform to -Inf and Inf, and the rule now used is the best according to Blom)
The aesthetics of ppc_ecdf_intervals_difference were misaligned due to a misplaced parenthesis. This is now fixed. Thank you for pointing this out. |
It is confusing that setting gamma, changes only one of the bands and I get lines that are often overlapping, and it's confusing that the color and thickness of the line are the same |
Reworked in #282. |
The first implementation of the ecdf plots mentioned in #267 . Currently, plots the mentioned plots for:
y
andyrep
are provided. Currently assumesy
to consist of multiple draws from a univariate distribution -> PIT for multivariatey
to be implemented later.yrep
is provided. Here each chain is ranked in relation to the total sample obtained by merging all of the chains together.I decided to add the functions into
ppc-intervals.R
as the share most similarities with the functions in that file.