Skip to content

Commit 6a60492

Browse files
committed
add Boneva et al citation
1 parent ad18ea7 commit 6a60492

File tree

2 files changed

+29
-17
lines changed

2 files changed

+29
-17
lines changed

R/ppc-loo.R

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -120,14 +120,20 @@ NULL
120120
#' @template args-density-controls
121121
#' @param boundary_correction For `ppc_loo_pit_overlay()`, when set to `TRUE`
122122
#' (the default) the function will compute boundary corrected density values
123-
#' via convolution and a Gaussian filter (i.e. reflection method). As a result, parameters controlling
124-
#' the standard kernel density estimation such as `adjust`, `kernel` and
125-
#' `n_dens` are ignored. NOTE: The current implementation only works well for
126-
#' continuous observations.
127-
#'@param grid_len For `ppc_loo_pit_overlay()`, when `boundary_correction` is set
128-
#' to `TRUE` this parameter specifies the number of points used to generate the
129-
#' estimations. This is set to 512 by default.
130-
123+
#' via convolution and a Gaussian filter, also known as the reflection method
124+
#' (Boneva et al., 1971). As a result, parameters controlling the standard
125+
#' kernel density estimation such as `adjust`, `kernel` and `n_dens` are
126+
#' ignored. NOTE: The current implementation only works well for continuous
127+
#' observations.
128+
#' @param grid_len For `ppc_loo_pit_overlay()`, when `boundary_correction` is
129+
#' set to `TRUE` this parameter specifies the number of points used to
130+
#' generate the estimations. This is set to 512 by default.
131+
#'
132+
#' @references Boneva, L. I., Kendall, D., & Stefanov, I. (1971). Spline
133+
#' transformations: Three new diagnostic aids for the statistical
134+
#' data-analyst. *J. R. Stat. Soc. B* (Methodological), 33(1), 1-71.
135+
#' https://www.jstor.org/stable/2986005.
136+
#'
131137
ppc_loo_pit_overlay <- function(y,
132138
yrep,
133139
lw,
@@ -622,8 +628,8 @@ ppc_loo_ribbon <-
622628
# Generate vector of x-axis values for plotting based on binned relative freqs
623629
n_breaks <- length(grid_breaks)
624630

625-
xs <- (grid_breaks[2:n_breaks] + grid_breaks[1:(n_breaks - 1)]) / 2
626-
631+
xs <- (grid_breaks[2:n_breaks] + grid_breaks[1:(n_breaks - 1)]) / 2
632+
627633
first_nonNA <- head(which(!is.na(bc_pvals)),1)
628634
last_nonNA <- tail(which(!is.na(bc_pvals)),1)
629635
bc_pvals[1:first_nonNA] <- bc_pvals[first_nonNA]

man/PPC-loo.Rd

Lines changed: 13 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)