7 #ifndef SSMPACK_PROCESS_MARKOV_HPP
8 #define SSMPACK_PROCESS_MARKOV_HPP
15 #include <type_traits>
27 template <
typename TPDF,
typename TParamMap,
typename TInitialPDF>
29 :
public BaseProcess<Markov<TPDF, TParamMap, TInitialPDF>> {
50 : cpdf_(std::move(cpdf)), init_pdf_(std::move(init_pdf)) {}
62 state_ = init_pdf_.random();
75 template <
typename... Args>
76 auto random(
const Args &... args) -> decltype(std::declval<TPDF>().
random()) {
77 state_ = cpdf_.random(state_, args...);
90 template <
typename... Args>
92 const Args &... args) {
93 return cpdf_.likelihood(rv, state_, args...);
107 TInitialPDF init_pdf_;
109 decltype(std::declval<TPDF>().
random()) state_;
121 template <typename TPDF, typename TParamMap, typename TInitialPDF>
122 Markov<TPDF, TParamMap, TInitialPDF>
124 TInitialPDF init_pdf) {
132 #endif // SSMPACK_PROCESS_MARKOV_HPP
distribution::Conditional< TPDF, TParamMap > & getCPDF()
Returns a reference to internal CPDF.
TInitialPDF & getInitialPDF()
Returns a reference to initial PDF.
double likelihood(const decltype(std::declval< TPDF >().random())&rv, const Args &...args)
Calculate likelihood.
Conditional distribution function.
auto random(const Args &...args) -> decltype(std::declval< TPDF >().random())
Sample from process.
A first-order Markov process.
Markov(distribution::Conditional< TPDF, TParamMap > cpdf, TInitialPDF init_pdf)
Constructor.
auto initialize() -> decltype(std::declval< TPDF >().random())
initialize process
Markov< TPDF, TParamMap, TInitialPDF > makeMarkov(distribution::Conditional< TPDF, TParamMap > cpdf, TInitialPDF init_pdf)
Convenient builder for Markov process.