Skip to content

Commit

Permalink
Update documentations for bugs functions
Browse files Browse the repository at this point in the history
  • Loading branch information
sunxd3 committed Mar 6, 2024
1 parent 772c857 commit e1eedc6
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 190 deletions.
2 changes: 0 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
DynamicPPL = "366bfd00-2699-11ea-058f-f148b4cae6d8"
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
InverseFunctions = "3587e190-3f89-42d0-90ee-14403ec27112"
JuliaSyntax = "70703baa-626e-46a2-a12c-08ffd08c73b4"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
LogDensityProblems = "6fdf6af0-433a-55f7-b3ed-c6c6e0b8df7c"
Expand Down Expand Up @@ -54,7 +53,6 @@ Distributions = "0.23.8, 0.24, 0.25"
Documenter = "0.27, 1"
DynamicPPL = "0.22, 0.23, 0.24"
Graphs = "1.4.1"
InverseFunctions = "0.1"
JuliaSyntax = "0.4"
LogDensityProblems = "2"
LogDensityProblemsAD = "1.6"
Expand Down
52 changes: 33 additions & 19 deletions docs/src/functions.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,55 @@
Most of the [functions](https://www.multibugs.org/documentation/latest/Functions.html) from BUGS have been implemented.

`JuliaBUGS` directly utilizes functions from the Julia Standard Library when they share the same names and functionalities. For functions not available in the Julia Standard Library and other popular libraries, we have developed equivalents within `JuliaBUGS.BUGSPrimitives`.

## Function defined in Julia Standard Library
```@docs
abs
exp
log
sqrt
trunc
min
max
sum
sort
sin
cos
tan
JuliaBUGS.BUGSPrimitives.mean
```

## Function defined in [`LogExpFunctions`](https://github.com/JuliaStats/LogExpFunctions.jl)

```@docs
cloglog
cexpexp
logit
logistic
```

## Function defined in `JuliaBUGS.BUGSPrimitives`

```@docs
JuliaBUGS.BUGSPrimitives.abs
JuliaBUGS.BUGSPrimitives.cloglog
JuliaBUGS.BUGSPrimitives.cexpexp
JuliaBUGS.BUGSPrimitives.equals
JuliaBUGS.BUGSPrimitives.exp
JuliaBUGS.BUGSPrimitives.inprod
JuliaBUGS.BUGSPrimitives.inverse
JuliaBUGS.BUGSPrimitives.log
JuliaBUGS.BUGSPrimitives.logistic
JuliaBUGS.BUGSPrimitives.logdet
JuliaBUGS.BUGSPrimitives.logfact
JuliaBUGS.BUGSPrimitives.loggam
JuliaBUGS.BUGSPrimitives.icloglog
JuliaBUGS.BUGSPrimitives.logit
JuliaBUGS.BUGSPrimitives.mexp
JuliaBUGS.BUGSPrimitives.max
JuliaBUGS.BUGSPrimitives.mean
JuliaBUGS.BUGSPrimitives.min
JuliaBUGS.BUGSPrimitives.phi
JuliaBUGS.BUGSPrimitives.pow
JuliaBUGS.BUGSPrimitives.sqrt
JuliaBUGS.BUGSPrimitives.rank
JuliaBUGS.BUGSPrimitives.ranked
JuliaBUGS.BUGSPrimitives.round
JuliaBUGS.BUGSPrimitives.sd
JuliaBUGS.BUGSPrimitives.softplus
JuliaBUGS.BUGSPrimitives.sort
JuliaBUGS.BUGSPrimitives._step
JuliaBUGS.BUGSPrimitives.sum
JuliaBUGS.BUGSPrimitives.trunc
JuliaBUGS.BUGSPrimitives.sin
JuliaBUGS.BUGSPrimitives.arcsin
JuliaBUGS.BUGSPrimitives.arcsinh
JuliaBUGS.BUGSPrimitives.cos
JuliaBUGS.BUGSPrimitives.arccos
JuliaBUGS.BUGSPrimitives.arccosh
JuliaBUGS.BUGSPrimitives.tan
JuliaBUGS.BUGSPrimitives.arctan
JuliaBUGS.BUGSPrimitives.arctanh
```
```
12 changes: 3 additions & 9 deletions src/BUGSPrimitives/BUGSPrimitives.jl
Original file line number Diff line number Diff line change
@@ -1,23 +1,17 @@
module BUGSPrimitives

using Bijectors
using Distributions
using Distributions: cdf, quantile, Normal
using LinearAlgebra
using LogExpFunctions
using LogExpFunctions: cloglog, cexpexp, logit, logistic
using PDMats
using Random
using SpecialFunctions
using Statistics
using InverseFunctions: InverseFunctions

using Statistics: mean
using Statistics: mean, std

include("functions.jl")
include("distributions.jl")

InverseFunctions.inverse(::typeof(phi)) = probit
InverseFunctions.inverse(::typeof(probit)) = phi

"""
_inv(m::AbstractMatrix)
Expand Down
Loading

0 comments on commit e1eedc6

Please sign in to comment.