-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* consistent behavior for ordered variables (#19) * consistent behavior for ordered variables * add unit tests * Fixes (#20) fix minimum bw and bug in kde fit * improve stability of density estimates near boundary (#21) * check whether data lies within boundaries * stabilize trafo by shifting boundaries in dkde1d * add unit tests * make probit trafo adjustemnt less aggressive * remove left overs * allow x outside of bounds in d/pkde1d * fix density computation for discrete variables (#23) * Prepare 0.2.0 (#24) * bump version * update NEWS * update documentation * improve docs * improve docs ++
- Loading branch information
Showing
27 changed files
with
210 additions
and
148 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
.Rhistory | ||
.RData | ||
.Ruserdata | ||
revdep |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#' check if data violate boundaries | ||
#' @noRd | ||
check_boundary_violations <- function(x, xmin, xmax) { | ||
if (!is.nan(xmax) & !is.nan(xmin)) { | ||
if (any(x < xmin) || any(x > xmax)) | ||
stop("Not all data are contained in the interval [xmin, xmax].") | ||
} else if (!is.nan(xmin)) { | ||
if (any(x < xmin)) | ||
stop("Not all data are larger than xmin.") | ||
} else if (!is.nan(xmax)) { | ||
if (any(x > xmax)) | ||
stop("Not all data are samller than xmax.") | ||
} | ||
} | ||
|
||
#' check and pre-process arguments passed to kde1d() | ||
#' @noRd | ||
check_arguments <- function(x, mult, xmin, xmax, bw, deg) { | ||
stopifnot(NCOL(x) == 1) | ||
|
||
if (!is.ordered(x) & is.factor(x)) | ||
stop("Factors not allowed; use kdevine::kdevine() or cctools::cckde().") | ||
|
||
stopifnot(mult > 0) | ||
|
||
if (is.ordered(x) & (!is.nan(xmin) | !is.nan(xmax))) | ||
stop("xmin and xmax are not meaningful for x of type ordered.") | ||
|
||
if (!is.nan(xmax) & !is.nan(xmin)) { | ||
if (xmin > xmax) | ||
stop("xmin is larger than xmax.") | ||
} | ||
check_boundary_violations(x, xmin, xmax) | ||
|
||
if (!(deg %in% 0:2)) | ||
stop("deg must be either 0, 1, or 2.") | ||
} | ||
|
||
#' adjusts observations and evaluation points for boundary effects | ||
#' @importFrom stats qnorm | ||
#' @noRd | ||
boundary_transform <- function(x, xmin, xmax) { | ||
if (!is.nan(xmin) & !is.nan(xmax)) { # two boundaries | ||
x <- qnorm((x - xmin) / (xmax - xmin + 1e-1)) | ||
} else if (!is.nan(xmin)) { # left boundary | ||
x <- log(x - xmin + 1e-3) | ||
} else if (!is.nan(xmax)) { # right boundary | ||
x <- log(xmax - x + 1e-3) | ||
} | ||
|
||
x | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,13 @@ | ||
## New submission after package has been archived | ||
|
||
Problem 1: ASAN failures | ||
Solution: Fixed heap buffer overflows on clang-ASAN related to max-comparison | ||
of a size_t and a negative number. | ||
|
||
Problem 2: Failed without long doubles | ||
Solution: Fixed cdf calculations for discrete data which made /tests fail. | ||
|
||
Problem 3: Threw a C++ exception under valgrind (fatal to the R process) | ||
Solution: This is a known issue of valgrind + boost; fixed by adding | ||
'#define BOOST_MATH_PROMOTE_DOUBLE_POLICY false' in /inst/include/stats.hpp | ||
(as suggested in http://svn.boost.org/trac10/ticket/10005). | ||
|
||
We are sorry for the delay in fixing these issues, reproducing the bugs reported | ||
by clang-ASAN was way harder than expected. | ||
|
||
## Test environments | ||
* Debian Linux with clang-4.0-ASAN enabled on rocker/r-devel-ubsan-clang (devel) | ||
* Ubuntu 16.04 with clang-7.0.0-ASAN enabled (devel) | ||
* Ubuntu 16.04 without long double support (devel) | ||
* Ubuntu 16.04 with valgrind (devel) | ||
* local OS X install (release) | ||
* ubuntu 12.04 on travis-ci (oldrel, release, devel) | ||
* ubuntu 12.04 on travis-ci (release, devel) | ||
* win-builder (devel) | ||
* Windows Server 2012 R2 x64 + x86 (release) | ||
|
||
## R CMD check results | ||
|
||
0 errors | 0 warnings | 0 notes | ||
|
||
## Reverse dependencies | ||
|
||
This is a new release, so there are no reverse dependencies. | ||
There are no reverse dependencies. |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.