From 159b8794f1f44bc154d2691628103e9619643942 Mon Sep 17 00:00:00 2001 From: blakemoya Date: Tue, 21 May 2024 15:50:49 -0500 Subject: [PATCH] CopRe 0.2.1 --- DESCRIPTION | 4 ++-- NEWS.md | 5 +++++ man/antimodes.Rd | 2 +- man/copre-package.Rd | 1 - man/modes.Rd | 2 +- man/register_s3_method.Rd | 2 +- src/seqre.cpp | 6 +++--- 7 files changed, 13 insertions(+), 9 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 4b2acb9..c780efb 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: copre Type: Package Title: Tools for Nonparametric Martingale Posterior Sampling -Version: 0.2.0 +Version: 0.2.1 Authors@R: c( person("Blake", "Moya", email = "blakemoya@utexas.edu", role = c("cre", "aut")), @@ -22,7 +22,7 @@ Description: Performs Bayesian nonparametric density estimation using Martingale . License: GPL (>= 2) Encoding: UTF-8 -RoxygenNote: 7.2.2 +RoxygenNote: 7.3.1 Roxygen: list(markdown = TRUE) LinkingTo: Rcpp, diff --git a/NEWS.md b/NEWS.md index 6693d58..96cfc7d 100644 --- a/NEWS.md +++ b/NEWS.md @@ -8,3 +8,8 @@ * Created a base plot method and loosened dependency on `ggplot2`. * Minor bug fixes. * Added a `NEWS.md` file to track changes to the package. + +# copre 0.2.1 + +* Fixed a Debian compile warning. +* Typo corrections in documentation. diff --git a/man/antimodes.Rd b/man/antimodes.Rd index 2131cd6..4c5e39a 100644 --- a/man/antimodes.Rd +++ b/man/antimodes.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/modes.R \name{antimodes} \alias{antimodes} -\title{Antiode Extractor} +\title{Antimode Extractor} \usage{ antimodes(obj, mean = FALSE, grd = NULL, idx = FALSE) } diff --git a/man/copre-package.Rd b/man/copre-package.Rd index b064362..d998f10 100644 --- a/man/copre-package.Rd +++ b/man/copre-package.Rd @@ -3,7 +3,6 @@ \docType{package} \name{copre-package} \alias{copre-package} -\alias{_PACKAGE} \title{CopRe Tools for Nonparametric Martingale Posterior Sampling} \description{ Performs Bayesian nonparametric density estimation using Martingale posterior diff --git a/man/modes.Rd b/man/modes.Rd index f7e0283..b0a0be5 100644 --- a/man/modes.Rd +++ b/man/modes.Rd @@ -27,7 +27,7 @@ density of each of the individual sampled density.} \code{grd} of the discovered modes.} \item{anti}{A logical value indicating whether to extract true modes or -anti-modes (i.e. local minima of th3e density function).} +anti-modes (i.e. local minima of the density function).} } \value{ A matrix of modes values in the support of the \code{copre_result} density diff --git a/man/register_s3_method.Rd b/man/register_s3_method.Rd index 4ba5943..cec1c09 100644 --- a/man/register_s3_method.Rd +++ b/man/register_s3_method.Rd @@ -13,7 +13,7 @@ register_s3_method(pkg, generic, class, fun = NULL) \item{class}{Class name.} -\item{fun}{Optional custum function name.} +\item{fun}{Optional custom function name.} } \value{ None diff --git a/src/seqre.cpp b/src/seqre.cpp index 1dd0b5c..95d2a3d 100644 --- a/src/seqre.cpp +++ b/src/seqre.cpp @@ -117,7 +117,7 @@ seq_measure* get_seq(arma::uword seq_idx, arma::vec seq_pars, sq_pitmanyor* seq = new sq_pitmanyor(); seq->d = seq_pars(0); if (seq_pars(0) < 0) { - seq->alpha = seq_pars(1) * abs(floor(seq_pars(0))); + seq->alpha = seq_pars(1) * fabs(floor(seq_pars(0))); } else { seq->alpha = seq_pars(1); } @@ -170,7 +170,7 @@ Rcpp::List seqre_cpp(Rcpp::List phi, arma::uword n, arma::uword nn = n; double rat0 = (double)(arma::max(cnts)) / nn; double rat1 = (double)(arma::max(cnts_new)) / (nn + inc); - double score = abs(rat1 - rat0); + double score = fabs(rat1 - rat0); nn = nn + inc; while((score > eps) & (it < max_it)) { cnts = cnts_new; @@ -178,7 +178,7 @@ Rcpp::List seqre_cpp(Rcpp::List phi, arma::uword n, it++; rat0 = (double)(arma::max(cnts)) / nn; rat1 = (double)(arma::max(cnts_new)) / (nn + inc); - score = abs(rat1 - rat0); + score = fabs(rat1 - rat0); nn = nn + inc; } cnts = cnts_new;