-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RW prior on vectors #94
Comments
Hi @patwa67! Sorry nobody replied to you in good time. You need to give a multivariate distribution inside the proposal. See e.g. Lines 41 to 56 in 4442783
so if your For example: using Turing
using AdvancedMH
using LinearAlgebra: I
@model function f()
a ~ Normal(0, 1)
x ~ MvNormal(fill(a, 10), I)
end
chain = sample(
f(),
MH(
:a => AdvancedMH.RandomWalkProposal(Normal(0, 1)),
:x => AdvancedMH.RandomWalkProposal(MvNormal(zeros(10), I)),
),
1000
) Tested on: julia> versioninfo()
Julia Version 1.10.5
Commit 6f3fdf7b362 (2024-08-27 14:19 UTC)
Build Info:
Official https://julialang.org/ release
Platform Info:
OS: macOS (arm64-apple-darwin22.4.0)
CPU: 10 × Apple M1 Pro
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-15.0.7 (ORCJIT, apple-m1)
Threads: 1 default, 0 interactive, 1 GC (on 8 virtual cores)
(ppl) pkg> st
Status `~/ppl/Project.toml`
[5b7e9947] AdvancedMH v0.8.3
[fce5fe82] Turing v0.34.1 I'm going to close this, but please feel free to reopen if you have other questions or bugs. Do specify the model as well as that will make it possible to reproduce (the call to |
How can I apply random walk priors to a vector (beta[1:10]) using AdvancedMH in Turing? Not working sampling code is as follows:
The text was updated successfully, but these errors were encountered: