Skip to content
This repository was archived by the owner on Jan 30, 2025. It is now read-only.

Commit

Permalink
Move resampling methods to 'dimensio'
Browse files Browse the repository at this point in the history
  • Loading branch information
nfrerebeau committed Sep 17, 2021
1 parent f1c67dc commit 65e6ea1
Show file tree
Hide file tree
Showing 12 changed files with 1 addition and 545 deletions.
1 change: 0 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ Collate:
'initialize.R'
'mutators.R'
'show.R'
'statistics.R'
'subset.R'
'summary.R'
'utilities.R'
Expand Down
2 changes: 0 additions & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ exportMethods(as_incidence)
exportMethods(as_long)
exportMethods(as_occurrence)
exportMethods(as_stratigraphy)
exportMethods(bootstrap)
exportMethods(get_dates)
exportMethods(get_groups)
exportMethods(get_samples)
Expand All @@ -79,7 +78,6 @@ exportMethods(get_tpq)
exportMethods(has_dates)
exportMethods(has_groups)
exportMethods(has_terminus)
exportMethods(jackknife)
exportMethods(remove_Inf)
exportMethods(remove_NA)
exportMethods(remove_empty)
Expand Down
2 changes: 0 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
* Add `replace_Inf()` to replace infinite values in a `matrix`-like object.
* Add `replace_zero()` to replace zero in a `matrix`-like object.
* Add `remove_Inf()` to remove infinite values in a `matrix`-like object.
* Add resampling methods: `bootstrap()` and `jackknife()`.
* Add `assert_*()` and `validate()` to validate objects.
* Add `get_dates()`, `set_dates()<-` to extract/replace `dates` slot.
* Add `get_terminus()`, `set_terminus()<-`, `get_tpq()`, `set_tpq()<-`, `get_taq()`, `set_taq()<-` to extract/replace `tpq` and `taq` slots.
Expand All @@ -14,7 +13,6 @@
* `AbundanceMatrix` class gained a new slot to store the sample sizes (`totals`).
* `AbundanceMatrix` class gained two new slots to store chronological information (`dates`, `tpq`, `taq`).
* Add `AbundanceSummary` class to store summary of an `AbundanceMatrix` object.
* Add `BootstrapVector` and `JackknifeVector` classes to store bootstrap and jackknife resampling values (inherit from base `numeric`).

# arkhe 0.3.1

Expand Down
13 changes: 0 additions & 13 deletions R/AllClasses.R
Original file line number Diff line number Diff line change
@@ -1,18 +1,5 @@
# CLASSES DEFINITION

# Vector =======================================================================
.BootstrapVector <- setClass(
Class = "BootstrapVector",
contains = "numeric"
)
.JackknifeVector <- setClass(
Class = "JackknifeVector",
slots = c(
hat = "numeric"
),
contains = "numeric"
)

# AbundanceMatrix ==============================================================
#' Archaeological Data
#'
Expand Down
84 changes: 0 additions & 84 deletions R/AllGenerics.R
Original file line number Diff line number Diff line change
Expand Up @@ -387,87 +387,3 @@ NULL
#' @name summary
#' @rdname summary
NULL

# Statistics ===================================================================
#' Jackknife Estimation
#'
#' @param x A [`numeric`] vector.
#' @param do A [`function`] that takes `x` as an argument and returns a single
#' numeric value.
#' @param object A `JackknifeVector` object.
#' @param ... Extra arguments passed to `do`.
#' @return
#' `jackknife()` returns a `JackknifeVector` object (i.e. a `numeric`
#' vector of the `n` leave-one-out values of `do`).
#'
#' `summary()` returns a named `numeric` vector with the following elements:
#' \describe{
#' \item{`mean`}{The jackknife estimate of mean of `do`.}
#' \item{`bias`}{The jackknife estimate of bias of `do`.}
#' \item{`error`}{he jackknife estimate of standard error of `do`.}
#' }
#' @example inst/examples/ex-statistics.R
#' @author N. Frerebeau
#' @docType methods
#' @family statistics
#' @name jackknife
#' @rdname jackknife
NULL

#' @rdname jackknife
#' @aliases jackknife-method
setGeneric(
name = "jackknife",
def = function(x, ...) standardGeneric("jackknife")
)

#' Bootstrap Estimation
#'
#' Creates \eqn{n} bootstrapped replicates by resampling with replacement from
#' the original data and applies a function.
#' @param x A [`numeric`] or an [`integer`] vector (see below).
#' @param do A [`function`] that takes `x` as an argument
#' and returns a single numeric value.
#' @param n A non-negative [`integer`] giving the number of bootstrap
#' replications.
#' @param object A `BootstrapVector` object.
#' @param level A length-one [`numeric`] vector giving the confidence level.
#' Must be a single number between \eqn{0} and \eqn{1}. If `NULL`, no
#' confidence interval are computed.
#' @param type A [`character`] string giving the type of confidence
#' interval to be returned. It must be one "`student`" (default) or
#' "`normal`". Any unambiguous substring can be given. Only used if `level`
#' is not `NULL`.``
#' @param probs A [`numeric`] vector of probabilities with values in
#' \eqn{[0,1]} (see [stats::quantile()]). If `NULL`, quantiles are not
#' computed.
#' @param na.rm A [`logical`] scalar: should missing values be removed
#' from `object` before the sample statistics are computed?
#' @param ... Extra arguments passed to `do`.
#' @return
#' `bootstrap()` returns a `BootstrapVector` object (i.e. a `numeric`
#' vector of the `n` bootstrap values of `do`).
#'
#' `summary()` returns a `numeric` vector with the following elements:
#' \describe{
#' \item{`min`}{Minimum value.}
#' \item{`mean`}{Mean value.}
#' \item{`max`}{Maximum value.}
#' \item{`lower`}{Lower bound of the confidence interval.}
#' \item{`upper`}{Upper bound of the confidence interval.}
#' \item{`Q*`}{Sample quantile to `*` probability.}
#' }
#' @example inst/examples/ex-statistics.R
#' @author N. Frerebeau
#' @docType methods
#' @family statistics
#' @name bootstrap
#' @rdname bootstrap
NULL

#' @rdname bootstrap
#' @aliases bootstrap-method
setGeneric(
name = "bootstrap",
def = function(x, ...) standardGeneric("bootstrap")
)
172 changes: 0 additions & 172 deletions R/statistics.R

This file was deleted.

2 changes: 1 addition & 1 deletion codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
"name": "utils"
}
],
"fileSize": "890.918KB",
"fileSize": "876.091KB",
"contIntegration": "https://codecov.io/gh/tesselle/arkhe",
"developmentStatus": "https://www.repostatus.org/#active",
"keywords": [
Expand Down
14 changes: 0 additions & 14 deletions inst/examples/ex-statistics.R

This file was deleted.

Loading

0 comments on commit 65e6ea1

Please sign in to comment.