numerics 0.1.0
Loading...
Searching...
No Matches
mcmc.hpp
Go to the documentation of this file.
1/// @file stochastic/mcmc.hpp
2/// @brief Metropolis-Hastings sweep API.
3#pragma once
4#include "core/types.hpp"
5
6namespace num::markov {
7
12 return total > 0 ? static_cast<real>(accepted) / total : 0.0;
13 }
14};
15
21
23 idx lo = 0;
24 idx hi = 0;
25 bool contains(idx v) const { return v >= lo && v <= hi; }
26};
27
28} // namespace num::markov
29
Core type definitions.
Template implementations for stochastic/mcmc.hpp. Included at the bottom of mcmc.hpp – do not include...
double real
Definition types.hpp:10
std::size_t idx
Definition types.hpp:11
real acceptance_rate() const
Definition mcmc.hpp:11
MetropolisStats mc
Definition mcmc.hpp:17
bool contains(idx v) const
Definition mcmc.hpp:25