You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+28Lines changed: 28 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -68,6 +68,24 @@ Quantiles
68
68
69
69
```
70
70
71
+
### Usage with [`LogDensityProblems.jl`](https://github.com/tpapp/LogDensityProblems.jl)
72
+
73
+
It can also be used with models defining the [`LogDensityProblems.jl`](https://github.com/tpapp/LogDensityProblems.jl) interface by wrapping it in `AbstractMCMC.LogDensityModel` before passing it to `sample`:
74
+
75
+
```julia
76
+
using AbstractMCMC: LogDensityModel
77
+
using LogDensityProblems
78
+
79
+
# Use a struct instead of `typeof(density)` for sake of readability.
80
+
struct LogTargetDensity end
81
+
82
+
LogDensityProblems.logdensity(p::LogTargetDensity, θ) =density(θ) # standard multivariate normal
### Usage with [`LogDensityProblemsAD.jl`](https://github.com/tpapp/LogDensityProblemsAD.jl)
180
+
181
+
Using our implementation of the `LogDensityProblems.jl` interface from earlier, we can use [`LogDensityProblemsAD.jl`](https://github.com/tpapp/LogDensityProblemsAD.jl) to provide us with the gradient computation used in MALA:
0 commit comments