Skip to content

Commit

Permalink
Patch 1.0.1 (#48)
Browse files Browse the repository at this point in the history
* Code clean-up and safety (#46)

* code safety

* remove dependence on qrng

* some cleanup

* avoid lower > upper by reversing the grid at the right places

* ensure non-NaN bandwidth

* unused variable

* add randtoolbox to Imports

* Prepare patch (#47)

* code safety

* remove dependence on qrng

* some cleanup

* avoid lower > upper by reversing the grid at the right places

* ensure non-NaN bandwidth

* unused variable

* add randtoolbox to Imports

* update NEWS and DESCRIPTION

* update API docs

* update CRAN comments
  • Loading branch information
tnagler authored Nov 15, 2019
1 parent 5eaf81f commit 3a56938
Show file tree
Hide file tree
Showing 26 changed files with 183 additions and 135 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
docs
^cran-comments\.md$
^revdep$
^.vscode$
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: kde1d
Type: Package
Title: Univariate Kernel Density Estimation
Version: 1.0.0
Version: 1.0.1
Authors@R: c(
person("Thomas", "Nagler",, "mail@tnagler.com", role = c("aut", "cre")),
person("Thibault", "Vatter",, "thibault.vatter@gmail.com", role = c("aut"))
Expand All @@ -22,7 +22,7 @@ LinkingTo:
Imports:
graphics,
Rcpp,
qrng,
randtoolbox,
stats,
utils
RoxygenNote: 7.0.0
Expand Down
2 changes: 1 addition & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export(rkde1d)
importFrom(Rcpp,sourceCpp)
importFrom(graphics,lines)
importFrom(graphics,plot)
importFrom(qrng,ghalton)
importFrom(randtoolbox,sobol)
importFrom(stats,logLik)
importFrom(stats,na.omit)
importFrom(stats,qnorm)
Expand Down
23 changes: 20 additions & 3 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,30 @@
# kde1d 1.0.1

DEPENDENCIES

* Removed dependence on `qrng` (#46).

BUG FIXES

* Fixed undefined behavior with potential to cause memory issues (#46).

* Prevent rare `bw_ == NaN` cases (#46).

* Fixed compiler warnings due to unused or uninitialized variables (#46).


# kde1d 1.0.0

DEPENDENCIES

* removed dependency on `cctools`.

NEW FEATURES

* optimal plug-in bandwidth selection for all polynomial degrees (#38).

* avoid randomness through simplified, deterministic jittering, see
`equi_jitter()` (#40).

* removed dependency `cctools`.
`equi_jitter()` (#40).

* headers in `inst/include` can be used as standalone C++ library with
convenience wrappers for R (#41).
Expand Down
6 changes: 3 additions & 3 deletions R/kde1d-methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -88,18 +88,18 @@ qkde1d <- function(p, obj) {
#' @param n integer; number of observations.
#' @param quasi logical; the default (`FALSE`) returns pseudo-random
#' numbers, use `TRUE` for quasi-random numbers (generalized Halton, see
#' [`qrng::ghalton()`]).
#' [`randtoolbox::sobol()`]).
#'
#' @rdname dkde1d
#' @importFrom qrng ghalton
#' @importFrom randtoolbox sobol
#' @importFrom stats runif
#' @export
rkde1d <- function(n, obj, quasi = FALSE) {
# simulate (psuedo/quasi) uniform random variables
if (!quasi) {
U <- runif(n)
} else {
U <- ghalton(n, d = 1)
U <- randtoolbox::sobol(n, scrambling = 1, seed = sample.int(1e10, 1))
}
# simulated data from KDE is the quantile transform of U
qkde1d(U, obj)
Expand Down
5 changes: 5 additions & 0 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
Patch to fix undefined behavior/heap overflow failures detected by the
sanitizers: https://cran.r-project.org/web/checks/check_results_kde1d.html

## Test environments
* ubuntu 18.04 with valgrind (release)
* ubuntu 18.04 with clang ASAN/UBSAN on rocker (devel)
* ubuntu 14.04 on travis-ci (release, devel, oldrel)
* win-builder (devel, release)

Expand Down
4 changes: 2 additions & 2 deletions docs/404.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions docs/LICENSE-text.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions docs/authors.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 11 additions & 11 deletions docs/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 3a56938

Please sign in to comment.