Skip to content

Commit 0579fe7

Browse files
committed
enhancement: deal with zero standard deviation
1 parent 283d845 commit 0579fe7

8 files changed

+42
-24
lines changed

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: hermiter
22
Title: Efficient Sequential and Batch Estimation of Univariate and Bivariate Probability Density Functions and Cumulative Distribution Functions along with Quantiles (Univariate) and Nonparametric Correlation (Bivariate)
33
Version: 2.2.0
4-
Date: 2022-06-05
4+
Date: 2022-11-12
55
Authors@R: c(
66
person("Michael","Stephanou",role=c("aut","cre"), email="[email protected]"),
77
person("Melvin","Varughese",role="ctb"))
@@ -27,7 +27,7 @@ LinkingTo:
2727
BH,
2828
RcppParallel
2929
SystemRequirements: GNU make
30-
RoxygenNote: 7.2.1
30+
RoxygenNote: 7.2.2
3131
Suggests:
3232
testthat,
3333
magrittr,

NEWS.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ N = 20.
1616
## Major enhancements
1717

1818
* Parallel implementation of batch updating using RcppParallel provides
19-
significant performance improvements on multicore systems.
19+
significant performance improvements on multicore systems. Note that this
20+
can be disabled by using options(hermiter.parallel = FALSE).
2021

2122
## Minor improvements and bug fixes
2223

R/hermite_estimator_bivar.R

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,10 +326,13 @@ update_sequential.hermite_estimator_bivar <- function(h_est_obj, x)
326326
x <- (x - upd_mean)/sqrt(upd_var)
327327
}
328328
}
329+
if (any(is.na(x))){
330+
return(h_est_obj)
331+
}
329332
h_x <-
330-
as.vector(hermite_function(h_est_obj$N_param, x[1]))
333+
as.vector(hermite_function_N(h_est_obj$N_param, x[1]))
331334
h_y <-
332-
as.vector(hermite_function(h_est_obj$N_param, x[2]))
335+
as.vector(hermite_function_N(h_est_obj$N_param, x[2]))
333336
if (is.na(h_est_obj$exp_weight)) {
334337
h_est_obj$coeff_vec_x <-
335338
(h_est_obj$coeff_vec_x * (h_est_obj$num_obs - 1) + h_x) /

R/hermite_estimator_univar.R

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,9 @@ update_sequential.hermite_estimator_univar <- function(h_est_obj, x) {
238238
x <- (x - h_est_obj$running_mean) / sqrt(h_est_obj$running_variance)
239239
}
240240
}
241+
if (is.na(x)){
242+
return(h_est_obj)
243+
}
241244
h_k <-
242245
as.vector(hermite_function(h_est_obj$N_param, x))
243246
if (is.na(h_est_obj$exp_weight)) {

cran-comments.md

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ N = 20.
1616
## Major enhancements
1717

1818
* Parallel implementation of batch updating using RcppParallel provides
19-
significant performance improvements on multicore systems.
19+
significant performance improvements on multicore systems. Note that this
20+
can be disabled by using options(hermiter.parallel = FALSE).
2021

2122
## Minor improvements and bug fixes
2223

@@ -26,25 +27,26 @@ significant performance improvements on multicore systems.
2627

2728

2829
## Test environments
29-
* local R installation, Windows 10, R 4.1.2
30-
* local R installation, Ubuntu Linux 21.10, R 4.1.2
31-
* Ubuntu Linux 20.04.1 LTS (r-hub)
32-
* Debian Linux, R-release, GCC (r-hub)
30+
* local R installation, Windows 10, R 4.2.2
31+
* Ubuntu Linux 20.04.1 LTS, R-release, GCC (r-hub)
3332
* Debian Linux, R-devel, GCC ASAN/UBSAN (r-hub)
34-
* Fedora Linux (r-hub)
35-
* Apple Silicon (M1), macOS 11.6 Big Sur, R-release
36-
* macOS 10.13.6 High Sierra, R-release, CRAN's setup
37-
* Oracle Solaris 10, x86, 32 bit, R-release (r-hub)
38-
* win-builder (devel and release)
33+
* Fedora Linux, R-devel, clang, gfortran (r-hub)
34+
* macOS 10.13.6 High Sierra, R-release, brew
35+
* Windows Server 2022, R-devel, 64 bit (r-hub)
36+
* win-builder (devel, release. oldrel)
3937

4038
## R CMD check results
4139

42-
There was 1 NOTE:
40+
There was 1 NOTE across environments:
4341

4442
GNU make is a SystemRequirements.
4543

46-
4744
* This appears to be related to using RcppParallel and does not seem
4845
problematic. GNU make has been added to SystemRequirements in the Description
4946
file.
5047

48+
* In addition, on Ubuntu 20.04.1 LTS, the package
49+
appears to be slightly larger than 5MB, around 5.9 MB. This does not
50+
appear to occur on any of the other environments however (i.e. Fedora Linux,
51+
Windows, MacOS)
52+

man/hermite_estimator.Rd

Lines changed: 8 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/hermite_estimator_bivar.Rd

Lines changed: 4 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/hermite_estimator_univar.Rd

Lines changed: 4 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)