Skip to content

Commit

Permalink
CopRe 0.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
blakemoya committed May 21, 2024
1 parent 098ffed commit 159b879
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 9 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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 = "[email protected]",
role = c("cre", "aut")),
Expand All @@ -22,7 +22,7 @@ Description: Performs Bayesian nonparametric density estimation using Martingale
<doi:10.1080/01621459.1995.10476550>.
License: GPL (>= 2)
Encoding: UTF-8
RoxygenNote: 7.2.2
RoxygenNote: 7.3.1
Roxygen: list(markdown = TRUE)
LinkingTo:
Rcpp,
Expand Down
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
2 changes: 1 addition & 1 deletion man/antimodes.Rd

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

1 change: 0 additions & 1 deletion man/copre-package.Rd

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

2 changes: 1 addition & 1 deletion man/modes.Rd

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

2 changes: 1 addition & 1 deletion man/register_s3_method.Rd

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

6 changes: 3 additions & 3 deletions src/seqre.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -170,15 +170,15 @@ 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;
cnts_new = rnext(*seq, inc, cnts, true);
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;
Expand Down

0 comments on commit 159b879

Please sign in to comment.