@@ -75,34 +75,35 @@ supported methods are `Array{Proposal}`, `Proposal`, and `NamedTuple{Proposal}`.
75
75
``` julia
76
76
# Provide a univariate proposal.
77
77
m1 = DensityModel (x -> logpdf (Normal (x,1 ), 1.0 ))
78
- p1 = Proposal ( Static (), Normal (0 ,1 ))
78
+ p1 = StaticProposal ( Normal (0 ,1 ))
79
79
c1 = sample (m1, MetropolisHastings (p1), 100 ; chain_type= Vector{NamedTuple})
80
80
81
81
# Draw from a vector of distributions.
82
82
m2 = DensityModel (x -> logpdf (Normal (x[1 ], x[2 ]), 1.0 ))
83
- p2 = Proposal ( Static (), [Normal (0 ,1 ), InverseGamma (2 ,3 )])
83
+ p2 = StaticProposal ( [Normal (0 ,1 ), InverseGamma (2 ,3 )])
84
84
c2 = sample (m2, MetropolisHastings (p2), 100 ; chain_type= Vector{NamedTuple})
85
85
86
86
# Draw from a `NamedTuple` of distributions.
87
87
m3 = DensityModel (x -> logpdf (Normal (x. a, x. b), 1.0 ))
88
- p3 = (a= Proposal ( Static (), Normal (0 ,1 )), b= Proposal ( Static (), InverseGamma (2 ,3 )))
88
+ p3 = (a= StaticProposal ( Normal (0 ,1 )), b= StaticProposal ( InverseGamma (2 ,3 )))
89
89
c3 = sample (m3, MetropolisHastings (p3), 100 ; chain_type= Vector{NamedTuple})
90
90
91
91
# Draw from a functional proposal.
92
92
m4 = DensityModel (x -> logpdf (Normal (x,1 ), 1.0 ))
93
- p4 = Proposal ( Static (), (x= 1.0 ) -> Normal (x, 1 ))
93
+ p4 = StaticProposal ( (x= 1.0 ) -> Normal (x, 1 ))
94
94
c4 = sample (m4, MetropolisHastings (p4), 100 ; chain_type= Vector{NamedTuple})
95
95
```
96
96
97
97
## Static vs. Random Walk
98
98
99
99
Currently there are only two methods of inference available. Static MH simply draws from the prior, with no
100
100
conditioning on the previous sample. Random walk will add the proposal to the previously observed value.
101
- If you are constructing a ` Proposal ` by hand, you can determine whether the proposal is ` Static ` or ` RandomWalk ` using
101
+ If you are constructing a ` Proposal ` by hand, you can determine whether the proposal is a
102
+ ` StaticProposal ` or a ` RandomWalkProposal ` using
102
103
103
104
``` julia
104
- static_prop = Proposal ( Static (), Normal (0 ,1 ))
105
- rw_prop = Proposal ( RandomWalk (), Normal (0 ,1 ))
105
+ static_prop = StaticProposal ( Normal (0 ,1 ))
106
+ rw_prop = RandomWalkProposal ( Normal (0 ,1 ))
106
107
```
107
108
108
109
Different methods are easily composeable. One parameter can be static and another can be a random walk,
0 commit comments