Skip to content

Commit

Permalink
Use keyword syntax for ess, ess_rhat, rhat, and mcse (#72)
Browse files Browse the repository at this point in the history
* Create rhat.jl

* Add missing _expectand_proxy method

* Remove duplicate rhat_tail

* Update ESS methods

* Define estimator keyword for mcse

* Reduce exports

* Fix bug

* Run formatter

* Shortcut rank-normalizing a `Missing`

* Update ESS tests

* Use new mcse syntax

* Update documented methods

* Update text

* Fix test

* Use new mcse signature

* Update type kwarg to estimator

* Update mcse docstring

* Fix variable name

* Make tail-ESS work for typeunion with Missing

* Add rank for ESS

* Rearrange tests

* Test against ess

* Add consistency test

* Add inferrability tests for estimators

* Add more error tests

* Try to resolve type-instability

* Add Compat for `@constprop` macro

* Aggressively constprop

* Test type-inferrability with Vals

* Make work for typeunions with Missing on v1.6

* Avoid repeating split_chains docs

* Rename ess.jl to ess_rhat.jl

* Move rhat to same file as ess

* Update costring

* Run formatter

* Remove rhat.jl

* Better unify tests

* Add missing type annotations

* Apply suggestions from code review

Co-authored-by: David Widmann <devmotion@users.noreply.github.com>

* Avoid `@constprop`, rename `type` and `estimator` to `kind`

* Cleanup

* Rename `estimator` to `kind` for `mcse`

* Update tests

* Update kinds accepted for ESS

* Remove unused utility

* Constrain kind to Symbol when applicable

* Remove stray tick

* Apply suggestions from code review

Co-authored-by: David Widmann <devmotion@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: David Widmann <devmotion@users.noreply.github.com>

* Add comment explaining kind checks

* Change vectors to tuples

---------

Co-authored-by: David Widmann <devmotion@users.noreply.github.com>
  • Loading branch information
sethaxen and devmotion committed Feb 26, 2023
1 parent 1e2b1a0 commit 6088765
Show file tree
Hide file tree
Showing 10 changed files with 445 additions and 235 deletions.
9 changes: 3 additions & 6 deletions docs/src/index.md
Expand Up @@ -6,16 +6,13 @@ CurrentModule = MCMCDiagnosticTools

## Effective sample size and $\widehat{R}$

The effective sample size (ESS) and $\widehat{R}$ can be estimated with [`ess_rhat`](@ref).

```@docs
ess
rhat
ess_rhat
ess_rhat_bulk
ess_tail
rhat_tail
```

The following methods are supported:
The following `method`s are supported:

```@docs
ESSMethod
Expand Down
4 changes: 2 additions & 2 deletions src/MCMCDiagnosticTools.jl
Expand Up @@ -16,7 +16,7 @@ using Statistics: Statistics

export bfmi
export discretediag
export ess_rhat, ess_rhat_bulk, ess_tail, rhat_tail, ESSMethod, FFTESSMethod, BDAESSMethod
export ess, ess_rhat, rhat, ESSMethod, FFTESSMethod, BDAESSMethod
export gelmandiag, gelmandiag_multivariate
export gewekediag
export heideldiag
Expand All @@ -27,7 +27,7 @@ export rstar
include("utils.jl")
include("bfmi.jl")
include("discretediag.jl")
include("ess.jl")
include("ess_rhat.jl")
include("gelmandiag.jl")
include("gewekediag.jl")
include("heideldiag.jl")
Expand Down

0 comments on commit 6088765

Please sign in to comment.