@@ -120,14 +120,20 @@ NULL
120
120
# ' @template args-density-controls
121
121
# ' @param boundary_correction For `ppc_loo_pit_overlay()`, when set to `TRUE`
122
122
# ' (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
+ # '
131
137
ppc_loo_pit_overlay <- function (y ,
132
138
yrep ,
133
139
lw ,
@@ -622,8 +628,8 @@ ppc_loo_ribbon <-
622
628
# Generate vector of x-axis values for plotting based on binned relative freqs
623
629
n_breaks <- length(grid_breaks )
624
630
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
+
627
633
first_nonNA <- head(which(! is.na(bc_pvals )),1 )
628
634
last_nonNA <- tail(which(! is.na(bc_pvals )),1 )
629
635
bc_pvals [1 : first_nonNA ] <- bc_pvals [first_nonNA ]
0 commit comments