hops
MarkovChainFactory.hpp
Go to the documentation of this file.
1 #ifndef HOPS_MARKOVCHAINFACTORY_HPP
2 #define HOPS_MARKOVCHAINFACTORY_HPP
3 
4 #include <type_traits>
5 
26 #include <hops/Model/Model.hpp>
28 #include <utility>
29 #include "ModelWrapper.hpp"
30 
31 namespace hops {
33  public:
42  template<typename MatrixType, typename VectorType, typename Proposal>
43  static std::unique_ptr<MarkovChain> createMarkovChain(
44  Proposal m_proposal
45  ) {
46  return addRecordersAndAdapter(MetropolisHastingsFilter(m_proposal));
47  }
48 
59  template<typename MatrixType, typename VectorType>
60  static std::unique_ptr<MarkovChain> createMarkovChain(
61  MarkovChainType type,
62  MatrixType inequalityLhs,
63  VectorType inequalityRhs,
64  VectorType startingPoint
65  ) {
66  if (!isInteriorPoint(inequalityLhs, inequalityRhs, startingPoint)) {
67  throw std::domain_error("Starting point outside polytope is always constant.");
68  }
69 
70  switch (type) {
72  return addRecordersAndAdapter(
75  Eigen::Matrix<typename MatrixType::Scalar, Eigen::Dynamic, Eigen::Dynamic>(
76  inequalityLhs), inequalityRhs, startingPoint)
77  )
78  );
79  }
81  return addRecordersAndAdapter(
84  Eigen::Matrix<typename MatrixType::Scalar, Eigen::Dynamic, Eigen::Dynamic>(
85  inequalityLhs), inequalityRhs, startingPoint)
86  )
87  );
88  }
90  return addRecordersAndAdapter(
92  DikinProposal(inequalityLhs, inequalityRhs, startingPoint)
93  )
94  );
95  }
97  return addRecordersAndAdapter(
100  Eigen::Matrix<typename MatrixType::Scalar, Eigen::Dynamic, Eigen::Dynamic>(
101  inequalityLhs), inequalityRhs, startingPoint)
102  )
103  );
104  }
106  return addRecordersAndAdapter(
109  Eigen::Matrix<typename MatrixType::Scalar, Eigen::Dynamic, Eigen::Dynamic>(
110  inequalityLhs), inequalityRhs, startingPoint)
111  )
112  );
113  }
114  default: {
115  throw std::invalid_argument("MarkovChainType not supported for uniform sampling.");
116  }
117  }
118  }
119 
130  template<typename MatrixType, typename VectorType, typename Proposal>
131  static std::unique_ptr<MarkovChain> createMarkovChain(
132  Proposal m_proposal,
133  MatrixType unroundingTransformation,
134  VectorType unroundingShift
135  ) {
136  return addRecordersAndAdapter(
139  m_proposal, Transformation(unroundingTransformation, unroundingShift)
140  )
141  )
142  );
143  }
144 
157  template<typename MatrixType, typename VectorType>
158  static std::unique_ptr<MarkovChain> createMarkovChain(
159  MarkovChainType type,
160  MatrixType roundedInequalityLhs,
161  VectorType roundedInequalityRhs,
162  VectorType startingPoint,
163  MatrixType unroundingTransformation,
164  VectorType unroundingShift
165  ) {
166  if (!isInteriorPoint(roundedInequalityLhs, roundedInequalityRhs, startingPoint)) {
167  throw std::domain_error("Starting point outside polytope is always constant.");
168  }
169 
170  switch (type) {
172  return addRecordersAndAdapter(
176  Eigen::Matrix<typename MatrixType::Scalar, Eigen::Dynamic, Eigen::Dynamic>(
177  roundedInequalityLhs),
178  roundedInequalityRhs,
179  startingPoint),
180  Transformation(unroundingTransformation, unroundingShift)
181  )
182  )
183  );
184  }
186  return addRecordersAndAdapter(
190  Eigen::Matrix<typename MatrixType::Scalar, Eigen::Dynamic, Eigen::Dynamic>(
191  roundedInequalityLhs),
192  roundedInequalityRhs,
193  startingPoint),
194  Transformation(unroundingTransformation, unroundingShift)
195  )
196  )
197  );
198  }
200  return addRecordersAndAdapter(
204  roundedInequalityLhs,
205  roundedInequalityRhs,
206  startingPoint),
207  Transformation(unroundingTransformation, unroundingShift)
208  )
209  )
210  );
211  }
213  return addRecordersAndAdapter(
217  Eigen::Matrix<typename MatrixType::Scalar, Eigen::Dynamic, Eigen::Dynamic>(
218  roundedInequalityLhs),
219  roundedInequalityRhs,
220  startingPoint),
221  Transformation(unroundingTransformation, unroundingShift)
222  )
223  )
224  );
225  }
227  return addRecordersAndAdapter(
231  Eigen::Matrix<typename MatrixType::Scalar, Eigen::Dynamic, Eigen::Dynamic>(
232  roundedInequalityLhs),
233  roundedInequalityRhs,
234  startingPoint),
235  Transformation(unroundingTransformation, unroundingShift)
236  )
237  )
238  );
239  }
240  default: {
241  throw std::invalid_argument("MarkovChainType not supported for uniform sampling.");
242  }
243  }
244  }
245 
256  template<typename MatrixType, typename VectorType, typename Proposal>
257  static std::unique_ptr<MarkovChain> createMarkovChain(
258  Proposal m_proposal,
259  std::shared_ptr<Model> model
260  ) {
261  return addRecordersAndAdapter(
264  ModelMixin(
265  m_proposal,
266  Coldness(ModelWrapper(std::move(model)))
267  )
268  )
269  )
270  );
271  }
272 
285  template<typename MatrixType, typename VectorType>
286  static std::unique_ptr<MarkovChain> createMarkovChain(
287  MarkovChainType type,
288  MatrixType inequalityLhs,
289  VectorType inequalityRhs,
290  VectorType startingPoint,
291  const std::shared_ptr<Model> &model
292  ) {
293  if (!isInteriorPoint(inequalityLhs, inequalityRhs, startingPoint)) {
294  throw std::domain_error("Starting point outside polytope is always constant.");
295  }
296 
297  switch (type) {
299  return addRecordersAndAdapter(
301  ModelMixin(
302  AdaptiveMetropolisProposal<Eigen::Matrix<typename MatrixType::Scalar, Eigen::Dynamic, Eigen::Dynamic>,
303  decltype(inequalityRhs)>(
304  inequalityLhs, inequalityRhs, startingPoint),
305  ModelWrapper(model)
306  )
307  )
308  );
309  }
311  return addRecordersAndAdapter(
314  ModelMixin(
315  BallWalkProposal<Eigen::Matrix<typename MatrixType::Scalar, Eigen::Dynamic, Eigen::Dynamic>,
316  decltype(inequalityRhs)>(
317  inequalityLhs, inequalityRhs, startingPoint),
318  ModelWrapper(model)
319  )
320  )
321  )
322  );
323  }
325  return addRecordersAndAdapter(
328  ModelMixin(
329  CoordinateHitAndRunProposal<Eigen::Matrix<typename MatrixType::Scalar, Eigen::Dynamic, Eigen::Dynamic>,
330  decltype(inequalityRhs),
331  GaussianStepDistribution<typename decltype(inequalityRhs)::Scalar>>(
332  inequalityLhs, inequalityRhs, startingPoint),
333  ModelWrapper(model)
334  )
335  )
336  )
337  );
338  }
340  return addRecordersAndAdapter(
344  inequalityLhs,
345  inequalityRhs,
346  startingPoint)
347  )
348  )
349  );
350  }
352  return addRecordersAndAdapter(
355  ModelMixin(
356  DikinProposal(inequalityLhs, inequalityRhs, startingPoint),
357  ModelWrapper(model)
358  )
359  )
360  )
361  );
362  }
364  return addRecordersAndAdapter(
367  ModelMixin(
369  Eigen::Matrix<typename MatrixType::Scalar, Eigen::Dynamic, Eigen::Dynamic>,
370  decltype(inequalityRhs)
371  >(inequalityLhs, inequalityRhs, startingPoint),
372  ModelWrapper(model)
373  )
374  )
375  )
376  );
377  }
379  return addRecordersAndAdapter(
382  ModelMixin(
383  HitAndRunProposal<Eigen::Matrix<typename MatrixType::Scalar, Eigen::Dynamic, Eigen::Dynamic>,
384  decltype(inequalityRhs),
385  GaussianStepDistribution<typename decltype(inequalityRhs)::Scalar>>(
386  inequalityLhs, inequalityRhs, startingPoint),
387  ModelWrapper(model)
388  )
389  )
390  )
391  );
392  }
393  default: {
394  throw std::invalid_argument("Type not supported.");
395  }
396  }
397  }
398 
412  template<typename MatrixType, typename VectorType>
413  static std::unique_ptr<MarkovChain> createMarkovChainWithParallelTempering(
414  MarkovChainType type,
415  MatrixType inequalityLhs,
416  VectorType inequalityRhs,
417  VectorType startingPoint,
418  const std::shared_ptr<Model> &model,
419  RandomNumberGenerator synchronizedRandomNumberGenerator
420  ) {
421  if (!isInteriorPoint(inequalityLhs, inequalityRhs, startingPoint)) {
422  throw std::domain_error("Starting point outside polytope is always constant.");
423  }
424 
425  switch (type) {
427  return addRecordersAndAdapter(
429  ModelMixin(
430  AdaptiveMetropolisProposal<Eigen::Matrix<typename MatrixType::Scalar, Eigen::Dynamic, Eigen::Dynamic>,
431  decltype(inequalityRhs)>(
432  inequalityLhs, inequalityRhs, startingPoint),
433  Coldness(ModelWrapper(model))
434  )
435  ),
436  synchronizedRandomNumberGenerator
437  );
438  }
440  return addRecordersAndAdapter(
443  ModelMixin(
444  BallWalkProposal<Eigen::Matrix<typename MatrixType::Scalar, Eigen::Dynamic, Eigen::Dynamic>,
445  decltype(inequalityRhs)>(
446  inequalityLhs, inequalityRhs, startingPoint),
447  Coldness(ModelWrapper(model))
448  )
449  )
450  ),
451  synchronizedRandomNumberGenerator
452  );
453  }
455  return addRecordersAndAdapter(
458  ModelMixin(
459  CoordinateHitAndRunProposal<Eigen::Matrix<typename MatrixType::Scalar, Eigen::Dynamic, Eigen::Dynamic>,
460  decltype(inequalityRhs),
461  GaussianStepDistribution<typename decltype(inequalityRhs)::Scalar>>(
462  inequalityLhs, inequalityRhs, startingPoint),
463  Coldness(ModelWrapper(model))
464  )
465  )
466  ),
467  synchronizedRandomNumberGenerator
468  );
469  }
471  return addRecordersAndAdapter(
475  inequalityLhs,
476  inequalityRhs,
477  startingPoint)
478  )
479  ),
480  synchronizedRandomNumberGenerator
481  );
482  }
484  return addRecordersAndAdapter(
487  ModelMixin(
488  DikinProposal(inequalityLhs, inequalityRhs, startingPoint),
489  Coldness(ModelWrapper(model))
490  )
491  )
492  ),
493  synchronizedRandomNumberGenerator
494  );
495  }
497  return addRecordersAndAdapter(
500  ModelMixin(
502  Eigen::Matrix<typename MatrixType::Scalar, Eigen::Dynamic, Eigen::Dynamic>,
503  decltype(inequalityRhs)
504  >(inequalityLhs, inequalityRhs, startingPoint),
505  Coldness(ModelWrapper(model))
506  )
507  )
508  ),
509  synchronizedRandomNumberGenerator
510  );
511  }
513  return addRecordersAndAdapter(
516  ModelMixin(
517  HitAndRunProposal<Eigen::Matrix<typename MatrixType::Scalar, Eigen::Dynamic, Eigen::Dynamic>,
518  decltype(inequalityRhs),
519  GaussianStepDistribution<typename decltype(inequalityRhs)::Scalar>>(
520  inequalityLhs, inequalityRhs, startingPoint),
521  Coldness(ModelWrapper(model))
522  )
523  )
524  ),
525  synchronizedRandomNumberGenerator
526  );
527  }
528  default: {
529  throw std::invalid_argument("Type not supported.");
530  }
531  }
532  }
533 
546  template<typename MatrixType, typename VectorType, typename Proposal>
547  static std::unique_ptr<MarkovChain> createMarkovChain(
548  Proposal m_proposal,
549  MatrixType unroundingTransformation,
550  VectorType unroundingShift,
551  std::shared_ptr<Model> model
552  ) {
553 
554  return addRecordersAndAdapter(
557  ModelMixin(
559  m_proposal,
560  Transformation(unroundingTransformation, unroundingShift)
561  ),
562  Coldness(ModelWrapper(model))
563  )
564  )
565  )
566  );
567  }
568 
583  template<typename MatrixType, typename VectorType>
584  static std::unique_ptr<MarkovChain> createMarkovChain(
585  MarkovChainType type,
586  MatrixType roundedInequalityLhs,
587  VectorType roundedInequalityRhs,
588  VectorType startingPoint,
589  MatrixType unroundingTransformation,
590  VectorType unroundingShift,
591  const std::shared_ptr<Model> &model
592  ) {
593  if (!isInteriorPoint(roundedInequalityLhs, roundedInequalityRhs, startingPoint)) {
594  throw std::domain_error("Starting point outside polytope is always constant.");
595  }
596 
597  switch (type) {
599  return addRecordersAndAdapter(
602  ModelMixin(
604  BallWalkProposal<Eigen::Matrix<typename MatrixType::Scalar, Eigen::Dynamic, Eigen::Dynamic>,
605  decltype(roundedInequalityRhs)>(
606  roundedInequalityLhs,
607  roundedInequalityRhs,
608  startingPoint),
609  Transformation(unroundingTransformation, unroundingShift)
610  ),
611  ModelWrapper(model)
612  )
613  )
614  )
615  );
616  }
618  return addRecordersAndAdapter(
621  ModelMixin(
623  CoordinateHitAndRunProposal<Eigen::Matrix<typename MatrixType::Scalar, Eigen::Dynamic, Eigen::Dynamic>,
624  decltype(roundedInequalityRhs),
625  GaussianStepDistribution<typename decltype(roundedInequalityRhs)::Scalar>>(
626  roundedInequalityLhs,
627  roundedInequalityRhs,
628  startingPoint),
629  Transformation(unroundingTransformation, unroundingShift)
630  ),
631  ModelWrapper(model)
632  )
633  )
634  )
635  );
636  }
638  return addRecordersAndAdapter(
641  ModelMixin(
644  Eigen::Matrix<typename MatrixType::Scalar, Eigen::Dynamic, Eigen::Dynamic>,
645  decltype(roundedInequalityRhs)>(
646  roundedInequalityLhs,
647  roundedInequalityRhs,
648  startingPoint
649  ),
650  Transformation(unroundingTransformation, unroundingShift)
651  ),
652  ModelWrapper(model)
653  )
654  )
655  )
656  );
657  }
659  return addRecordersAndAdapter(
662  ModelMixin(
664  HitAndRunProposal<Eigen::Matrix<typename MatrixType::Scalar, Eigen::Dynamic, Eigen::Dynamic>,
665  decltype(roundedInequalityRhs),
666  GaussianStepDistribution<typename decltype(roundedInequalityRhs)::Scalar>>(
667  roundedInequalityLhs,
668  roundedInequalityRhs,
669  startingPoint),
670  Transformation(unroundingTransformation, unroundingShift)
671  ),
672  ModelWrapper(model)
673  )
674  )
675  )
676  );
677  }
678  default: {
679  throw std::invalid_argument("Type not supported.");
680  }
681  }
682  }
683 
699  template<typename MatrixType, typename VectorType>
700  static std::unique_ptr<MarkovChain> createMarkovChainWithParallelTempering(
701  MarkovChainType type,
702  MatrixType roundedInequalityLhs,
703  VectorType roundedInequalityRhs,
704  VectorType startingPoint,
705  MatrixType unroundingTransformation,
706  VectorType unroundingShift,
707  const std::shared_ptr<Model>& model,
708  RandomNumberGenerator synchronizedRandomNumberGenerator
709  ) {
710  if (!isInteriorPoint(roundedInequalityLhs, roundedInequalityRhs, startingPoint)) {
711  throw std::domain_error("Starting point outside polytope is always constant.");
712  }
713 
714  switch (type) {
716  return addRecordersAndAdapter(
719  ModelMixin(
721  BallWalkProposal<Eigen::Matrix<typename MatrixType::Scalar, Eigen::Dynamic, Eigen::Dynamic>,
722  decltype(roundedInequalityRhs)>(
723  roundedInequalityLhs,
724  roundedInequalityRhs,
725  startingPoint),
726  Transformation(unroundingTransformation, unroundingShift)
727  ),
728  Coldness(ModelWrapper(model))
729  )
730  )
731  ),
732  synchronizedRandomNumberGenerator
733  );
734  }
736  return addRecordersAndAdapter(
739  ModelMixin(
741  CoordinateHitAndRunProposal<Eigen::Matrix<typename MatrixType::Scalar, Eigen::Dynamic, Eigen::Dynamic>,
742  decltype(roundedInequalityRhs),
743  GaussianStepDistribution<typename decltype(roundedInequalityRhs)::Scalar>>(
744  roundedInequalityLhs,
745  roundedInequalityRhs,
746  startingPoint),
747  Transformation(unroundingTransformation, unroundingShift)
748  ),
749  Coldness(ModelWrapper(model))
750  )
751  )
752  ),
753  synchronizedRandomNumberGenerator
754  );
755  }
757  return addRecordersAndAdapter(
760  ModelMixin(
763  Eigen::Matrix<typename MatrixType::Scalar, Eigen::Dynamic, Eigen::Dynamic>,
764  decltype(roundedInequalityRhs)>(
765  roundedInequalityLhs,
766  roundedInequalityRhs,
767  startingPoint
768  ),
769  Transformation(unroundingTransformation, unroundingShift)
770  ),
771  Coldness(ModelWrapper(model))
772  )
773  )
774  ),
775  synchronizedRandomNumberGenerator
776  );
777  }
779  return addRecordersAndAdapter(
782  ModelMixin(
784  HitAndRunProposal<Eigen::Matrix<typename MatrixType::Scalar, Eigen::Dynamic, Eigen::Dynamic>,
785  decltype(roundedInequalityRhs),
786  GaussianStepDistribution<typename decltype(roundedInequalityRhs)::Scalar>>(
787  roundedInequalityLhs,
788  roundedInequalityRhs,
789  startingPoint),
790  Transformation(unroundingTransformation, unroundingShift)
791  ),
792  Coldness(ModelWrapper(model))
793  )
794  )
795  ),
796  synchronizedRandomNumberGenerator
797  );
798  }
799  default: {
800  throw std::invalid_argument("Type not supported.");
801  }
802  }
803  }
804 
805 
806  private:
807  template<typename MatrixType, typename VectorType>
808  static bool isInteriorPoint(const MatrixType &A, const VectorType &b, const VectorType &x) {
809  return ((b - A * x).array() >= 0).all();
810  }
811 
817  template<typename MarkovChainImpl>
818  static std::unique_ptr<MarkovChain>
819  addRecordersAndAdapter(const MarkovChainImpl &markovChainImpl,
820  RandomNumberGenerator synchronizedRandomNumberGenerator) {
821  if constexpr(IsSetColdnessAvailable<MarkovChainImpl>::value) {
822  auto mc = MarkovChainAdapter(
823  ParallelTempering(
824  AcceptanceRateRecorder(
825  TimestampRecorder(
826  StateRecorder(
827  markovChainImpl
828  )
829  )
830  ),
831  synchronizedRandomNumberGenerator
832  )
833  );
834  return std::make_unique<decltype(mc)>(mc);
835  } else {
836  throw std::invalid_argument("Can not use Parallel Tempering without model.");
837  }
838  };
839 
845  template<typename MarkovChainImpl>
846  static std::unique_ptr<MarkovChain>
847  addRecordersAndAdapter(const MarkovChainImpl &markovChainImpl) {
848  auto mc = MarkovChainAdapter(
849  AcceptanceRateRecorder(
850  TimestampRecorder(
851  StateRecorder(
852  markovChainImpl
853  )
854  )
855  )
856  );
857  return std::make_unique<decltype(mc)>(mc);
858  }
859  };
860 }
861 
862 #endif //HOPS_MARKOVCHAINFACTORY_HPP
hops::ModelWrapper
Definition: ModelWrapper.hpp:11
ParallelTempering.hpp
MarkovChainAdapter.hpp
hops::Transformation
Definition: Transformation.hpp:13
hops::MatrixType
Eigen::MatrixXd MatrixType
Definition: MatrixType.hpp:7
TimestampRecorder.hpp
hops::MarkovChainType::CoordinateHitAndRun
@ CoordinateHitAndRun
hops::CoordinateHitAndRunProposal
Definition: CoordinateHitAndRunProposal.hpp:12
hops::MarkovChainFactory::createMarkovChain
static std::unique_ptr< MarkovChain > createMarkovChain(Proposal m_proposal, MatrixType unroundingTransformation, VectorType unroundingShift)
Creates a Markov chain for uniform sampling of rounded convex polytopes.
Definition: MarkovChainFactory.hpp:131
hops::MarkovChainFactory::createMarkovChain
static std::unique_ptr< MarkovChain > createMarkovChain(MarkovChainType type, MatrixType roundedInequalityLhs, VectorType roundedInequalityRhs, VectorType startingPoint, MatrixType unroundingTransformation, VectorType unroundingShift)
Creates a Markov chain for uniform sampling of rounded convex polytopes.
Definition: MarkovChainFactory.hpp:158
NegativeLogLikelihoodRecorder.hpp
hops::MarkovChainFactory::createMarkovChain
static std::unique_ptr< MarkovChain > createMarkovChain(Proposal m_proposal)
Creates a Markov chain for uniform sampling of convex polytopes using an arbitrary m_proposal class.
Definition: MarkovChainFactory.hpp:43
hops::ModelMixin
ModelMixin Mixin to add model likelihood to computeLogAcceptanceRate().
Definition: ModelMixin.hpp:17
MetropolisHastingsFilter.hpp
hops::MarkovChainFactory
Definition: MarkovChainFactory.hpp:32
pcg_detail::engine
Definition: pcg_random.hpp:364
MarkovChainType.hpp
hops::MarkovChainFactory::createMarkovChain
static std::unique_ptr< MarkovChain > createMarkovChain(Proposal m_proposal, MatrixType unroundingTransformation, VectorType unroundingShift, std::shared_ptr< Model > model)
Creates a Markov chain for sampling the likelihood of a model with the domain of a rounded convex pol...
Definition: MarkovChainFactory.hpp:547
Transformation.hpp
ModelWrapper.hpp
DikinProposal.hpp
Coldness.hpp
hops::MarkovChainFactory::createMarkovChain
static std::unique_ptr< MarkovChain > createMarkovChain(MarkovChainType type, MatrixType inequalityLhs, VectorType inequalityRhs, VectorType startingPoint)
Creates a Markov chain for uniform sampling of convex polytopes.
Definition: MarkovChainFactory.hpp:60
hops::MarkovChainType::AdaptiveMetropolis
@ AdaptiveMetropolis
hops::NegativeLogLikelihoodRecorder
Definition: NegativeLogLikelihoodRecorder.hpp:16
CoordinateHitAndRunProposal.hpp
hops::HitAndRunProposal
Definition: HitAndRunProposal.hpp:11
hops::GaussianProposal
Definition: GaussianProposal.hpp:11
hops::NoOpDrawAdapter
Definition: NoOpDrawAdapter.hpp:9
hops::MarkovChainFactory::createMarkovChain
static std::unique_ptr< MarkovChain > createMarkovChain(MarkovChainType type, MatrixType roundedInequalityLhs, VectorType roundedInequalityRhs, VectorType startingPoint, MatrixType unroundingTransformation, VectorType unroundingShift, const std::shared_ptr< Model > &model)
Creates a Markov chain for sampling the likelihood of a model with the domain of a rounded convex pol...
Definition: MarkovChainFactory.hpp:584
hops::RandomNumberGenerator
pcg64 RandomNumberGenerator
Definition: RandomNumberGenerator.hpp:7
Model.hpp
HitAndRunProposal.hpp
hops::BallWalkProposal
Definition: BallWalkProposal.hpp:11
StateTransformation.hpp
hops::MarkovChainType::HitAndRun
@ HitAndRun
hops
Definition: CsvReader.hpp:8
hops::MarkovChainFactory::createMarkovChainWithParallelTempering
static std::unique_ptr< MarkovChain > createMarkovChainWithParallelTempering(MarkovChainType type, MatrixType roundedInequalityLhs, VectorType roundedInequalityRhs, VectorType startingPoint, MatrixType unroundingTransformation, VectorType unroundingShift, const std::shared_ptr< Model > &model, RandomNumberGenerator synchronizedRandomNumberGenerator)
Creates a Markov chain for sampling the likelihood of a model with the domain of a rounded convex pol...
Definition: MarkovChainFactory.hpp:700
MarkovChain.hpp
hops::MarkovChainFactory::createMarkovChainWithParallelTempering
static std::unique_ptr< MarkovChain > createMarkovChainWithParallelTempering(MarkovChainType type, MatrixType inequalityLhs, VectorType inequalityRhs, VectorType startingPoint, const std::shared_ptr< Model > &model, RandomNumberGenerator synchronizedRandomNumberGenerator)
Creates a Markov chain for sampling the likelihood of a model with the domain of a convex polytope wi...
Definition: MarkovChainFactory.hpp:413
AdaptiveMetropolisProposal.hpp
hops::MarkovChainType::CSmMALA
@ CSmMALA
hops::GaussianStepDistribution
Definition: ChordStepDistributions.hpp:27
CSmMALAProposal.hpp
hops::MarkovChainType::Gaussian
@ Gaussian
AcceptanceRateRecorder.hpp
hops::MarkovChainType::DikinWalk
@ DikinWalk
hops::CSmMALAProposal
Definition: CSmMALAProposal.hpp:24
hops::VectorType
Eigen::VectorXd VectorType
Definition: VectorType.hpp:7
hops::MarkovChainType::BallWalk
@ BallWalk
ModelMixin.hpp
NoOpDrawAdapter.hpp
BallWalkProposal.hpp
hops::MarkovChainFactory::createMarkovChain
static std::unique_ptr< MarkovChain > createMarkovChain(Proposal m_proposal, std::shared_ptr< Model > model)
Creates a Markov chain for sampling the likelihood of a with the domain of a convex polytope.
Definition: MarkovChainFactory.hpp:257
StateRecorder.hpp
hops::MarkovChainType
MarkovChainType
Definition: MarkovChainType.hpp:5
hops::MetropolisHastingsFilter
Definition: MetropolisHastingsFilter.hpp:14
hops::StateTransformation
Mixin for undoing transformations to the Markov chain state.
Definition: StateTransformation.hpp:11
hops::AdaptiveMetropolisProposal
Definition: AdaptiveMetropolisProposal.hpp:12
hops::MarkovChainFactory::createMarkovChain
static std::unique_ptr< MarkovChain > createMarkovChain(MarkovChainType type, MatrixType inequalityLhs, VectorType inequalityRhs, VectorType startingPoint, const std::shared_ptr< Model > &model)
Creates a Markov chain for sampling the likelihood of a model with the domain of a convex polytope.
Definition: MarkovChainFactory.hpp:286
hops::Coldness
Mixin that adds coldness to model evaluations.
Definition: Coldness.hpp:17
hops::DikinProposal
Definition: DikinProposal.hpp:11
GaussianProposal.hpp