diff --git a/R/draws-index.R b/R/draws-index.R index beb83fa..722f414 100644 --- a/R/draws-index.R +++ b/R/draws-index.R @@ -68,6 +68,10 @@ iteration_ids.draws_df <- function(x) { #' @export iteration_ids.draws_list <- function(x) { + if (!length(x) || !length(x[[1]])) { + # no chains or no variables within chains + return(integer(0)) + } seq_along(x[[1]][[1]]) } diff --git a/man/u_scale.Rd b/man/u_scale.Rd index 87d4edf..6424636 100644 --- a/man/u_scale.Rd +++ b/man/u_scale.Rd @@ -19,7 +19,9 @@ and dimension as the input. \description{ Compute rank uniformization for a numeric array. First replace each value by its rank. Average rank for ties are used to conserve the number of unique -values of discrete quantities. Second, uniformize ranks to the scale -\verb{[1/(2S), 1-1/(2S)]}, where \code{S} is the number of values. +values of discrete quantities. Second, uniformize ranks using formula +\code{(r - c) / (S - 2 * c + 1)}, where \code{r} is a rank, \code{S} is the number of +values, and \code{c} is a fractional offset which defaults to c = 3/8 as +recommend by Blom (1958). } \keyword{internal}