Skip to content

Commit

Permalink
adding JAGS diagnostics functions
Browse files Browse the repository at this point in the history
  • Loading branch information
FBartos authored May 8, 2022
1 parent 0e4d674 commit 9e66c03
Show file tree
Hide file tree
Showing 52 changed files with 6,589 additions and 13 deletions.
35 changes: 29 additions & 6 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ on:
branches:
- main
- master
- pre-release
pull_request:
branches:
- main
- master
- pre-release

name: R-CMD-check

Expand All @@ -23,9 +25,9 @@ jobs:
matrix:
config:
- {os: windows-latest, r: 'release'}
- {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
- {os: ubuntu-20.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest", http-user-agent: "R/4.1.0 (ubuntu-20.04) R (4.1.0 x86_64-pc-linux-gnu x86_64 linux-gnu) on GitHub Actions" }
#- {os: macOS-latest, r: 'release'}
- {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
- {os: ubuntu-20.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest", http-user-agent: "R/4.1.0 (ubuntu-20.04) R (4.1.0 x86_64-pc-linux-gnu x86_64 linux-gnu) on GitHub Actions" }
- {os: macOS-latest, r: 'release'}

env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
Expand Down Expand Up @@ -66,7 +68,7 @@ jobs:
- name: Install JAGS (windows-latest)
if: runner.os == 'Windows'
run: |
curl.exe -o wjags.exe --url https://deac-fra.dl.sourceforge.net/project/mcmc-jags/JAGS/4.x/Windows/JAGS-4.3.0.exe
curl.exe -o wjags.exe --url https://deac-fra.dl.sourceforge.net/project/mcmc-jags/JAGS/4.x/Windows/JAGS-4.2.0-Rtools33.exe
wjags.exe /S
del wjags.exe
shell: cmd
Expand All @@ -75,7 +77,7 @@ jobs:
if: runner.os == 'macOS'
run : |
rm '/usr/local/bin/gfortran'
brew install jags
brew install automake jags
- name: Install dependencies
run: |
Expand All @@ -84,13 +86,34 @@ jobs:
shell: Rscript {0}

- name: Check
if: runner.os != 'Windows'
env:
_R_CHECK_CRAN_INCOMING_REMOTE_: false
run: |
options(crayon.enabled = TRUE)
rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
rcmdcheck::rcmdcheck(
args = c("--no-manual", "--as-cran", "--ignore-vignettes"),
build_args = c("--no-build-vignettes"),
error_on = "warning",
check_dir = "check")
shell: Rscript {0}"

- name: Check
if: runner.os == 'Windows'
env:
_R_CHECK_CRAN_INCOMING_REMOTE_: false
JAGS_ROOT: "/c/progra~1/JAGS/JAGS-4.2.0"
JAGS_MAJOR_VERSION: 4
run: |
options(crayon.enabled = TRUE)
rcmdcheck::rcmdcheck(
args = c("--no-manual", "--as-cran", "--ignore-vignettes"),
build_args = c("--no-build-vignettes"),
error_on = "warning",
check_dir = "check")
shell: Rscript {0}


- name: Upload check results
if: failure()
uses: actions/upload-artifact@main
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
- name: Install JAGS (windows-latest)
if: runner.os == 'Windows'
run: |
curl.exe -o wjags.exe --url https://deac-fra.dl.sourceforge.net/project/mcmc-jags/JAGS/4.x/Windows/JAGS-4.3.0.exe
curl.exe -o wjags.exe --url https://deac-fra.dl.sourceforge.net/project/mcmc-jags/JAGS/4.x/Windows/JAGS-4.2.0-Rtools33.exe
wjags.exe /S
del wjags.exe
shell: cmd
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
- name: Install JAGS (windows-latest)
if: runner.os == 'Windows'
run: |
curl.exe -o wjags.exe --url https://deac-fra.dl.sourceforge.net/project/mcmc-jags/JAGS/4.x/Windows/JAGS-4.3.0.exe
curl.exe -o wjags.exe --url https://deac-fra.dl.sourceforge.net/project/mcmc-jags/JAGS/4.x/Windows/JAGS-4.2.0-Rtools33.exe
wjags.exe /S
del wjags.exe
shell: cmd
Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: BayesTools
Title: Tools for Bayesian Analyses
Version: 0.2.9
Version: 0.2.10
Description: Provides tools for conducting Bayesian analyses. The package contains
functions for creating a wide range of prior distribution objects, mixing posterior
samples from 'JAGS' and 'Stan' models, plotting posterior distributions, and etc...
Expand Down
4 changes: 4 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ export(JAGS_bridgesampling_posterior)
export(JAGS_check_and_list_autofit_settings)
export(JAGS_check_and_list_fit_settings)
export(JAGS_check_convergence)
export(JAGS_diagnostics)
export(JAGS_diagnostics_autocorrelation)
export(JAGS_diagnostics_density)
export(JAGS_diagnostics_trace)
export(JAGS_evaluate_formula)
export(JAGS_fit)
export(JAGS_formula)
Expand Down
6 changes: 5 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
## version 0.2.10
### Features
- trace, density, and autocorrelation diagnostic plots for JAGS models

## version 0.2.9
### Fixes
- dealing with NaNs due to overflow with very large marginal likelihoods
- dealing with NaNs in inclusion Bayes factors due to overflow with very large marginal likelihoods

## version 0.2.8
### Fixes
Expand Down
Loading

0 comments on commit 9e66c03

Please sign in to comment.