@@ -114,16 +114,11 @@ struct RobustAdaptiveMetropolisState{T1,L,A,T2,T3}
114
114
end
115
115
116
116
AbstractMCMC. getparams (state:: RobustAdaptiveMetropolisState ) = state. x
117
- AbstractMCMC. setparams!! (state:: RobustAdaptiveMetropolisState , x) =
118
- RobustAdaptiveMetropolisState (
119
- x,
120
- state. logprob,
121
- state. S,
122
- state. logα,
123
- state. η,
124
- state. iteration,
125
- state. isaccept,
117
+ function AbstractMCMC. setparams!! (state:: RobustAdaptiveMetropolisState , x)
118
+ return RobustAdaptiveMetropolisState (
119
+ x, state. logprob, state. S, state. logα, state. η, state. iteration, state. isaccept
126
120
)
121
+ end
127
122
128
123
function ram_step_inner (
129
124
rng:: Random.AbstractRNG ,
@@ -181,7 +176,7 @@ function AbstractMCMC.step(
181
176
rng:: Random.AbstractRNG ,
182
177
model:: AbstractMCMC.LogDensityModel ,
183
178
sampler:: RobustAdaptiveMetropolis ;
184
- initial_params = nothing ,
179
+ initial_params= nothing ,
185
180
kwargs... ,
186
181
)
187
182
# This is the initial state.
@@ -262,9 +257,7 @@ function AbstractMCMC.step_warmup(
262
257
S_new, η = ram_adapt (sampler, state, logα, U)
263
258
# Check that `S_new` has eigenvalues in the desired range.
264
259
if ! valid_eigenvalues (
265
- S_new,
266
- sampler. eigenvalue_lower_bound,
267
- sampler. eigenvalue_upper_bound,
260
+ S_new, sampler. eigenvalue_lower_bound, sampler. eigenvalue_upper_bound
268
261
)
269
262
# In this case, we just keep the old `S` (p. 13 in Vihola, 2012).
270
263
S_new = state. S
0 commit comments