Thesis 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 <algorithm>
24#include <Eigen/Dense>
25
50class Sampler {
51protected:
52 // ========== Core Components ==========
53
57
61
65
69
70 // ========== Random Number Generation ==========
71
74 std::random_device rd;
75
76public:
77 // ========== Constructor ==========
78
99 : data(d), params(p), likelihood(l), process(pr) {};
100
101 // ========== Pure Virtual Interface ==========
102
126 virtual void step() = 0;
127
131 virtual ~Sampler() = default;
132};
Data structure for managing point distances and cluster allocations.
Likelihood computation for clustering with cohesion and repulsion.
Parameter management for Bayesian nonparametric MCMC models.
Abstract interface for Bayesian nonparametric processes.
Manages distance matrices and cluster allocations for points.
Definition Data.hpp:26
Computes log-likelihood for clusters based on distance-based cohesion and repulsion.
Definition Likelihood.hpp:19
Abstract base class for Bayesian nonparametric processes.
Definition Process.hpp:41
Likelihood & likelihood
Reference to the likelihood computation object for evaluating cluster assignments.
Definition Sampler.hpp:64
Sampler(Data &d, Params &p, Likelihood &l, Process &pr)
Constructor initializing sampler with required components.
Definition Sampler.hpp:98
virtual ~Sampler()=default
Virtual destructor for proper cleanup of derived classes.
Params & params
Reference to the parameters object containing model hyperparameters and MCMC settings.
Definition Sampler.hpp:60
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:56
Process & process
Reference to the stochastic process object (DP, NGGP, DPW, NGGPW)
Definition Sampler.hpp:68
std::random_device rd
Random device for generating random numbers across sampling algorithms.
Definition Sampler.hpp:74
Structure containing all parameters needed for the NGGP (Normalized Generalized Gamma Process) and DP...
Definition Params.hpp:35