R/merging.R
Repeat cycles of bootstrap resampling followed by density re-estimation for testing purposes.
cycle_rvtable(x, n, start = NULL, density.args, sample.args, keep = "all")
x | an rvtable in distribution form only. |
---|---|
n | total number of iteratively estimated distributions to return, including the original from |
start | usually |
density.args | optional arguments passed to |
sample.args | optional arguments used when sampling. If supplied, overrides the |
keep | character, iterations to retain in output table. Options are |
an rvtable.
This function repeats cycles of bootstrap resampling from a distribution followed by distribution re-estimation n - 1
times.
x
must be a distribution-form rvtable and not a sample-form rvtable.
# NOT RUN { library(dplyr) x <- data.frame( id1=rep(LETTERS[1:5], each=4), id2=factor(c("low", "high")), id3=rep(1:2, each=2), Val=rep(1:10, each=20), Prob=rep(sqrt(1:10), each=20)) %>% rvtable cycle_rvtable(x, 2) x %>% group_by(id1, id2) %>% cycle_rvtable(3, keep="last") # }