Skip to content

Commit

Permalink
Merge branch 'release/v2.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
ygeunkim committed Feb 15, 2024
2 parents 4410531 + 5322bf4 commit 88957f1
Show file tree
Hide file tree
Showing 96 changed files with 6,972 additions and 6,450 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
branches: [main, master, develop]
pull_request:
branches: [main, master]
branches: [main, master, develop]

name: R-CMD-check

Expand All @@ -20,6 +20,10 @@ jobs:
config:
- {os: macOS-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
# Use 3.6 to trigger usage of RTools35
- {os: windows-latest, r: '3.6'}
# use 4.1 to check with rtools40's older compiler
- {os: windows-latest, r: '4.1'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'oldrel-1'}
Expand All @@ -29,7 +33,7 @@ jobs:
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: r-lib/actions/setup-pandoc@v2

Expand All @@ -50,6 +54,7 @@ jobs:
args: 'c("--no-manual", "--as-cran", "--no-build-vignettes", "--no-tests", "--no-examples")'
build_args: '"--no-build-vignettes"'
error-on: '"error"'
# upload-snapshots: true

# do not upload artifact until changing to public repo
# When public repo -> uncomment below
Expand Down
16 changes: 10 additions & 6 deletions .github/workflows/pr-commands.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: r-lib/actions/pr-fetch@v2
with:
Expand All @@ -26,10 +26,12 @@ jobs:

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: roxygen2
extra-packages: any::roxygen2
needs: pr-document

- name: Document
run: Rscript -e 'roxygen2::roxygenise()'
run: roxygen2::roxygenise()
shell: Rscript {0}

- name: commit
run: |
Expand All @@ -49,7 +51,7 @@ jobs:
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: r-lib/actions/pr-fetch@v2
with:
Expand All @@ -58,10 +60,12 @@ jobs:
- uses: r-lib/actions/setup-r@v2

- name: Install dependencies
run: Rscript -e 'install.packages("styler")'
run: install.packages("styler")
shell: Rscript {0}

- name: Style
run: Rscript -e 'styler::style_pkg()'
run: styler::style_pkg()
shell: Rscript {0}

- name: commit
run: |
Expand Down
28 changes: 24 additions & 4 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
branches: [main, master, develop]
pull_request:
branches: [main, master]
branches: [main, master, develop]

name: test-coverage

Expand All @@ -15,7 +15,7 @@ jobs:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: r-lib/actions/setup-r@v2
with:
Expand All @@ -27,7 +27,27 @@ jobs:
needs: coverage

- name: Test coverage
run: covr::codecov(quiet = FALSE)
# run: covr::codecov(quiet = FALSE)
run: |
covr::codecov(
quiet = FALSE,
clean = FALSE,
install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package")
)
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
shell: Rscript {0}

- name: Show testthat output
if: always()
run: |
## --------------------------------------------------------------------
find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash

# - name: Upload test results
# if: failure()
# uses: actions/upload-artifact@v3
# with:
# name: coverage-test-failures
# path: ${{ runner.temp }}/package
3 changes: 3 additions & 0 deletions CRAN-SUBMISSION
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Version: 2.0.0
Date: 2024-02-14 13:41:11 UTC
SHA: 091a5efd695c1922ad8f1754b97844d1569caacc
8 changes: 4 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: bvhar
Type: Package
Title: Bayesian Vector Heterogeneous Autoregressive Modeling
Version: 1.2.0
Version: 2.0.0
Authors@R:
c(person(given = "Young Geun",
family = "Kim",
Expand All @@ -25,7 +25,7 @@ Suggests:
testthat (>= 3.0.0)
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.2.3
RoxygenNote: 7.3.1
Imports:
lifecycle,
magrittr,
Expand All @@ -39,9 +39,9 @@ Imports:
stats,
optimParallel,
posterior,
bayesplot,
doRNG
bayesplot
LinkingTo:
BH,
Rcpp,
RcppEigen
VignetteBuilder: knitr
Expand Down
13 changes: 10 additions & 3 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ S3method(knitr::knit_print,bvharspec)
S3method(knitr::knit_print,bvharssvs)
S3method(knitr::knit_print,bvharsv)
S3method(knitr::knit_print,horseshoespec)
S3method(knitr::knit_print,interceptspec)
S3method(knitr::knit_print,predbvhar)
S3method(knitr::knit_print,ssvsinit)
S3method(knitr::knit_print,ssvsinput)
Expand Down Expand Up @@ -124,13 +125,15 @@ S3method(print,bvharspec)
S3method(print,bvharssvs)
S3method(print,bvharsv)
S3method(print,horseshoespec)
S3method(print,interceptspec)
S3method(print,predbvhar)
S3method(print,ssvsinit)
S3method(print,ssvsinput)
S3method(print,summary.bvharsp)
S3method(print,summary.normaliw)
S3method(print,summary.varlse)
S3method(print,summary.vharlse)
S3method(print,svspec)
S3method(print,varlse)
S3method(print,vharlse)
S3method(relmae,bvharcv)
Expand Down Expand Up @@ -210,10 +213,12 @@ export(is.bvharmn)
export(is.bvharpriorspec)
export(is.bvharspec)
export(is.horseshoespec)
export(is.interceptspec)
export(is.predbvhar)
export(is.ssvsinit)
export(is.ssvsinput)
export(is.stable)
export(is.svspec)
export(is.varlse)
export(is.vharlse)
export(lpl)
Expand All @@ -232,9 +237,11 @@ export(set_bvar)
export(set_bvar_flat)
export(set_bvhar)
export(set_horseshoe)
export(set_intercept)
export(set_lambda)
export(set_psi)
export(set_ssvs)
export(set_sv)
export(set_weight_bvhar)
export(sim_horseshoe_var)
export(sim_horseshoe_vhar)
Expand All @@ -258,7 +265,6 @@ importFrom(Rcpp,evalCpp)
importFrom(bayesplot,mcmc_areas)
importFrom(bayesplot,mcmc_dens)
importFrom(bayesplot,mcmc_trace)
importFrom(doRNG,"%dorng%")
importFrom(dplyr,bind_rows)
importFrom(dplyr,case_when)
importFrom(dplyr,filter)
Expand All @@ -270,7 +276,6 @@ importFrom(dplyr,rename)
importFrom(foreach,"%do%")
importFrom(foreach,"%dopar%")
importFrom(foreach,foreach)
importFrom(foreach,getDoParRegistered)
importFrom(ggplot2,aes)
importFrom(ggplot2,autolayer)
importFrom(ggplot2,autoplot)
Expand All @@ -289,6 +294,7 @@ importFrom(ggplot2,guides)
importFrom(ggplot2,labs)
importFrom(ggplot2,last_plot)
importFrom(ggplot2,layer)
importFrom(ggplot2,scale_colour_gradient2)
importFrom(ggplot2,scale_colour_viridis_d)
importFrom(ggplot2,scale_fill_viridis_d)
importFrom(ggplot2,scale_x_continuous)
Expand Down Expand Up @@ -319,12 +325,13 @@ importFrom(stats,quantile)
importFrom(stats,rbinom)
importFrom(stats,rgamma)
importFrom(stats,rnorm)
importFrom(stats,runif)
importFrom(stats,sd)
importFrom(stats,setNames)
importFrom(tibble,add_column)
importFrom(tibble,rownames_to_column)
importFrom(tidyr,pivot_longer)
importFrom(tidyr,separate)
importFrom(tidyr,separate_wider_delim)
importFrom(tidyr,separate_wider_regex)
importFrom(tidyr,unite)
useDynLib(bvhar, .registration = TRUE)
27 changes: 27 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,30 @@
# bvhar 2.0.0

* Start to implement OOP in C++ source for each model, ready for major update.

* Add SV specification (`sv_spec` argument) in `bvhar_sv()` and `bvar_sv()` (`set_sv()`).

* Prevent SSVS overflow issues by using log-sum-exp trick when computing Bernoulli posterior probability.

* Add separate constant term prior specification (`intercept`) in `bvhar_sv()` and `bvar_sv()` (`set_intercept()`).

* Convert every header file inst/include to header-only format. This enables external inclusion of our classes, structs, and Rcpp functions by using `LinkingTo` (in R package development) or `// [[Rcpp::depends(RcppEigen, BH, bvhar)]]`.

## Parallel Chain MCMC

* Use OpenMP parallel for loop

* Progress bar will show the status only for master thread when OpenMP enabled.

* Interruption detect will just save values and break the loop, not return immediately.

* Do burn-in and thinning in each `returnRecords()` method to make pre-process parallel chains easier.

* Use boost library (`BH` package) RNG instead of Rf_* RNG of `Rcpp` for thread-safety.

* Introduce function overloading to internal Rcpp random generation functions temporarily.
It's for maintaining `set.seed()` usage of some functions.

# bvhar 1.2.0

* Replace progress bar of `RcppProgress` package with custom header (`bvharprogress.h`).
Expand Down
Loading

0 comments on commit 88957f1

Please sign in to comment.