Docs
Loading...
Searching...
No Matches
Sampler.hpp
Go to the documentation of this file.
1
13
14#pragma once
15
16#include "Data.hpp"
17#include "Likelihood.hpp"
18#include "Params.hpp"
19#include "Process.hpp"
20
21#include <random>
22#include <Rcpp.h>
23#include <Eigen/Dense>
24
49class Sampler {
50protected:
51 // ========== Core Components ==========
52
56
59 const Params &params;
60
64
68
69 // ========== Random Number Generation ==========
70
73 std::random_device rd;
74
75public:
76 // ========== Constructor ==========
77
97 Sampler(Data &d, const Params &p, const Likelihood &l, Process &pr)
98 : data(d), params(p), likelihood(l), process(pr) {};
99
100 // ========== Pure Virtual Interface ==========
101
125 virtual void step() = 0;
126
130 virtual ~Sampler() = default;
131};
Data structure for managing point distances and cluster allocations.
Abstract base class for likelihood computation in clustering models.
Parameter management for Bayesian nonparametric MCMC models.
Abstract interface for Bayesian nonparametric processes.
Manages distance matrices and cluster allocations for points.
Definition Data.hpp:27
Abstract base class for likelihood computation.
Definition Likelihood.hpp:27
Abstract base class for Bayesian nonparametric processes.
Definition Process.hpp:41
const Likelihood & likelihood
Reference to the likelihood computation object for evaluating cluster assignments.
Definition Sampler.hpp:63
virtual ~Sampler()=default
Virtual destructor for proper cleanup of derived classes.
Sampler(Data &d, const Params &p, const Likelihood &l, Process &pr)
Constructor initializing sampler with required components.
Definition Sampler.hpp:97
virtual void step()=0
Pure virtual method to perform one MCMC sampling step.
Data & data
Reference to the data object containing observations and current allocations.
Definition Sampler.hpp:55
const Params & params
Reference to the parameters object containing model hyperparameters and MCMC settings.
Definition Sampler.hpp:59
Process & process
Reference to the stochastic process object (DP, NGGP, DPW, NGGPW).
Definition Sampler.hpp:67
std::random_device rd
Random device for generating random numbers across sampling algorithms.
Definition Sampler.hpp:73
Structure containing all parameters needed for the NGGP (Normalized Generalized Gamma Process) and DP...
Definition Params.hpp:35