Skip to content

Commit

Permalink
version 0.1.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexisDerumigny authored and cran-robot committed Jun 16, 2023
1 parent 9f72856 commit f2eaecd
Show file tree
Hide file tree
Showing 18 changed files with 806 additions and 347 deletions.
19 changes: 11 additions & 8 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
Package: BoundEdgeworth
Type: Package
Title: Bound on the Error of the First-Order Edgeworth Expansion
Version: 0.1.1
Version: 0.1.2.1
Authors@R: c(
person("Alexis", "Derumigny",, email = "a.f.f.derumigny@tudelft.nl", role = c("aut", "cre"), comment = c(ORCID = "0000-0002-6163-8097")),
person("Lucas", "Girard",, email = "lucas.girard@ensae.fr", role = "aut"),
person("Yannick", "Guyonvarch",, email = "yannick.guyonvarch@inrae.fr", role = "aut")
)
person("Alexis", "Derumigny",, email = "a.f.f.derumigny@tudelft.nl", role = c("aut", "cre"), comment = c(ORCID = "0000-0002-6163-8097")),
person("Lucas", "Girard",, email = "lucas.girard@ensae.fr", role = "aut"),
person("Yannick", "Guyonvarch",, email = "yannick.guyonvarch@inrae.fr", role = "aut")
)
Description: Computes uniform bounds on the distance between
the cumulative distribution function of a standardized sum
of random variables and its first-order Edgeworth expansion,
Expand All @@ -16,13 +16,16 @@ License: GPL-3
Encoding: UTF-8
Imports: expint, mathjaxr
RdMacros: mathjaxr
RoxygenNote: 7.2.1
RoxygenNote: 7.2.3
BugReports: https://github.com/AlexisDerumigny/BoundEdgeworth/issues
Suggests: spelling, testthat (>= 3.0.0)
Config/testthat/edition: 3
Language: en-US
NeedsCompilation: no
Packaged: 2022-09-09 08:19:00 UTC; Alexis
Packaged: 2023-06-16 12:42:31 UTC; aderumigny
Author: Alexis Derumigny [aut, cre] (<https://orcid.org/0000-0002-6163-8097>),
Lucas Girard [aut],
Yannick Guyonvarch [aut]
Maintainer: Alexis Derumigny <a.f.f.derumigny@tudelft.nl>
Repository: CRAN
Date/Publication: 2022-09-12 07:43:07 UTC
Date/Publication: 2023-06-16 13:50:02 UTC
27 changes: 17 additions & 10 deletions MD5
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
a47ff3f73831650f62e8c56d892239db *DESCRIPTION
c7d2009821818144a861d993a00be2e2 *NAMESPACE
5b172c4f30d51849746fa1459609fa25 *DESCRIPTION
e3fe87c3b72962971205df8eea5f7025 *NAMESPACE
3afadc289e66b7fabc8834cca2286530 *NEWS.md
0c56b9817d330ade6e451aaf8f091ceb *R/Bound_BE.R
3775124ee71a731f2032c20b435f26d9 *R/Bound_EE1.R
9e216c640e1237c0081e7af42b2e2420 *R/Bound_EE1_cont.R
4ce44ed5997a36399dfd367d32e488b7 *R/Bound_EE1_nocont.R
bf5579ed30f408f48b913d5efdc00b07 *R/Bound_EE1.R
47db73b323fc86e467827a30f5d9ed78 *R/Bound_EE1_cont.R
15cc6c240bb93675dab6dd258d333f83 *R/Bound_EE1_nocont.R
f40db68a4c1ab37e8165dfd3121cff34 *R/Constants.R
4650690dc946a67190972b7e683ea78c *R/Gauss_test_power.R
952a9bfaf6543f33e4ececd8d10ff5e1 *R/Rn_iid_integrated.R
51faabb9ac3a463471d9bb57ad4184c3 *R/Rn_inid_integrated.R
155f53189af8d24a3b0539dd19faef0e *R/SpecialFunctions.R
22e997436098dcac422d8cc1837b1c92 *README.md
5c11e96ea505ae62043ea356846ba22f *build/BoundEdgeworth.pdf
4ac1dbd568540cfeb61a17b98dc1bc1d *man/Bound_BE.Rd
5a50f8f24254ae505a22cdba17276fc1 *man/Bound_EE1.Rd
c2fb7bcc348114e08be04249dcbf4d7a *R/SpecialFunctions.R
62192faa148b1febc7bc6a1679d5f983 *README.md
eb52691842fd83563b296b4a2982e715 *build/BoundEdgeworth.pdf
382382255f36bb75608a86b643638079 *build/stage23.rdb
4d4624801f5f9222543ac1c7e6e03c62 *man/Bound_BE.Rd
bbdc0fd456046427f2f2e82d77f6e19e *man/Bound_EE1.Rd
7963e3ca0da34501bfc9b24004c95717 *man/Gauss_test_powerAnalysis.Rd
332173f20d20942c02019350ea4dcadc *tests/spelling.R
4df215d91f5ab78f65bd7b85a6bcba35 *tests/testthat.R
37fa4e311bbe7eadb63725902205db46 *tests/testthat/test-Bound_EE1.R
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@

export(Bound_BE)
export(Bound_EE1)
export(Gauss_test_powerAnalysis)
import(mathjaxr)
24 changes: 24 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@

# BoundEdgeworth 0.1.2

* New function `Gauss_test_powerAnalysis` for computation of power or sufficient sample size
for the one-sided Gauss test. The power (respectively sufficient sample size)
are computed in an exact (non-asymptotic) way based on bounds on the Edgeworth expansion.
This power holds non-asymptotically and uniformly over all alternatives with a given effect size
(under some regularity conditions: bounded kurtosis, tail constraint `kappa`).

* Adding a `verbose` option to `Bound_EE1` to indicate the values of the intermediary terms
that are summed to produce the final bound. This can be useful to understand which
terms has the largest contribution to the bound.

* Removing pipes in `Lower_incomplete_gamma_for_negative_x` to be compatible with R (< 4.1.0).


# BoundEdgeworth 0.1.1

* Documentation update.


# BoundEdgeworth 0.1.0

* Initial release.
47 changes: 32 additions & 15 deletions R/Bound_EE1.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

#' Uniform bound on Edgeworth expansion
#'
#' This function computes a non-aymptotically uniform bound on
#' the difference between the cdf of a normalized sum of random varialbles
#' This function computes a non-asymptotically uniform bound on
#' the difference between the cdf of a normalized sum of random variables
#' and its 1st order Edgeworth expansion.
#' It returns a valid value \mjseqn{\delta_n} such that
#' \mjtdeqn{\sup_{x \in R}
Expand Down Expand Up @@ -83,6 +83,12 @@
#' Any value of \code{eps} will give a valid upper bound but some may give
#' tighter results than others.
#'
#' @param verbose if it is \code{0} the function is silent (no printing).
#' Higher values of \code{verbose} give more precise information about the computation.
#' \code{verbose = 1} prints the values of the intermediary terms that are summed
#' to produce the final bound. This can be useful to understand which term has
#' the largest contribution to the bound.
#'
#' @return A vector of the same size as \code{n} with values \mjseqn{\delta_n}
#' such that
#' \mjtdeqn{\sup_{x \in R}
Expand All @@ -104,6 +110,10 @@
#'
#' @seealso \code{\link{Bound_BE}()} for a Berry-Esseen bound.
#'
#' \code{\link{Gauss_test_powerAnalysis}()} for a power analysis of the classical
#' Gauss test that is uniformly valid based on this bound on the Edgeworth
#' expansion.
#'
#'
#' @examples
#' setup = list(continuity = TRUE, iid = FALSE, no_skewness = TRUE)
Expand Down Expand Up @@ -142,7 +152,8 @@ Bound_EE1 <- function(
n,
K4 = 9, K3 = NULL, lambda3 = NULL, K3tilde = NULL,
regularity = list(C0 = 1, p = 2),
eps = 0.1)
eps = 0.1,
verbose = 0)
{

# Check 'setup' argument and define shortcuts
Expand All @@ -163,38 +174,43 @@ Bound_EE1 <- function(

if (!iid & !no_skewness) {
ub_DeltanE = Bound_EE1_nocont_inid_skew (
n = n, eps = eps, K4 = K4, K3 = K3, K3tilde = K3tilde, lambda3 = lambda3)
n = n, eps = eps, K4 = K4, K3 = K3, K3tilde = K3tilde, lambda3 = lambda3, verbose = verbose)
} else if (!iid & no_skewness) {
ub_DeltanE = Bound_EE1_nocont_inid_noskew (
n = n, eps = eps, K4 = K4, K3tilde = K3tilde)
n = n, eps = eps, K4 = K4, K3tilde = K3tilde, verbose = verbose)
} else if (iid & !no_skewness) {
ub_DeltanE = Bound_EE1_nocont_iid_skew (
n = n, eps = eps, K4 = K4, K3 = K3, K3tilde = K3tilde, lambda3 = lambda3)
n = n, eps = eps, K4 = K4, K3 = K3, K3tilde = K3tilde, lambda3 = lambda3, verbose = verbose)
} else if (iid & no_skewness) {
ub_DeltanE = Bound_EE1_nocont_iid_noskew (
n = n, eps = eps, K4 = K4, K3tilde = K3tilde)
n = n, eps = eps, K4 = K4, K3tilde = K3tilde, verbose = verbose)
}

# Continuity case (additional regularity conditions)
} else {

if (!iid & !no_skewness) {
ub_DeltanE_wo_int_fSn = Bound_EE1_cont_inid_skew_wo_int_fSn (
n = n, eps = eps, K4 = K4, K3 = K3, lambda3 = lambda3, K3tilde = K3tilde)
n = n, eps = eps, K4 = K4, K3 = K3, lambda3 = lambda3, K3tilde = K3tilde, verbose = verbose)
} else if (!iid & no_skewness) {
ub_DeltanE_wo_int_fSn = Bound_EE1_cont_inid_noskew_wo_int_fSn (
n = n, eps = eps, K4 = K4, K3tilde = K3tilde)
n = n, eps = eps, K4 = K4, K3tilde = K3tilde, verbose = verbose)
} else if (iid & !no_skewness) {
ub_DeltanE_wo_int_fSn = Bound_EE1_cont_iid_skew_wo_int_fSn (
n = n, eps = eps, K4 = K4, K3 = K3, lambda3 = lambda3, K3tilde = K3tilde)
n = n, eps = eps, K4 = K4, K3 = K3, lambda3 = lambda3, K3tilde = K3tilde, verbose = verbose)
} else if (iid & no_skewness) {
ub_DeltanE_wo_int_fSn = Bound_EE1_cont_iid_noskew_wo_int_fSn (
n = n, eps = eps, K4 = K4, K3 = K3, K3tilde = K3tilde)
n = n, eps = eps, K4 = K4, K3 = K3, K3tilde = K3tilde, verbose = verbose)
}

smoothness_additional_term = Smoothness_additional_term(
n = n, K3tilde = K3tilde, regularity = regularity, iid = iid)

if (verbose){
cat("Smoothness additional term:", smoothness_additional_term, "\n")
}

ub_DeltanE = ub_DeltanE_wo_int_fSn +
Smoothness_additional_term(n = n, K3tilde = K3tilde,
regularity = regularity, iid = iid)
ub_DeltanE = ub_DeltanE_wo_int_fSn + smoothness_additional_term
}

return(ub_DeltanE)
Expand Down Expand Up @@ -245,7 +261,8 @@ Smoothness_additional_term <- function(n, K3tilde, regularity, iid){
)

if (!success) {
stop("'regularity' should be either a list with C0 and p, or, in the iid case only, a list with only kappa")
stop("'regularity' should be either a list with C0 and p; or, ",
"in the iid case only, a list with only kappa")
}

return (result)
Expand Down

0 comments on commit f2eaecd

Please sign in to comment.