We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 39e4d28 commit ebe0661Copy full SHA for ebe0661
src/mcmc/abstractmcmc.jl
@@ -136,7 +136,16 @@ function AbstractMCMC.sample(
136
)
137
end
138
139
-loadstate(c::MCMCChains.Chains) = c.info.samplerstate
+function loadstate(chain::MCMCChains.Chains)
140
+ if !haskey(chain.info, :samplerstate)
141
+ throw(
142
+ ArgumentError(
143
+ "the chain object does not contain the final state of the sampler; to save the final state you must sample with `save_state=true`",
144
+ ),
145
+ )
146
+ end
147
+ return chain.info[:samplerstate]
148
+end
149
150
# TODO(penelopeysm): Remove initialstep and generalise MCMC sampling procedures
151
function initialstep end
0 commit comments