Docs
Loading...
Searching...
No Matches
RWMH.hpp
Go to the documentation of this file.
1
5
6#pragma once
7
8#include "U_sampler.hpp"
9
29class RWMH : public U_sampler {
30
31private:
38 double proposal_sd = 1.0;
39
41 bool accept = false;
42
44 bool use_V = false;
45
47 bool tuning_enabled = false;
48
54
71 void sampling_U();
72
91 void sampling_V();
92
94
120
121public:
142 RWMH(Params &p, Data &d, bool use_V = false, double prop_sd = 1,
143 bool tuning = false)
144 : U_sampler(p, d), use_V(use_V), proposal_sd(prop_sd),
145 tuning_enabled(tuning) {};
146
160 void update_U() override;
161};
Base class for sampling the latent variable U in NGGP mixture models.
Manages distance matrices and cluster allocations for points.
Definition Data.hpp:27
void sampling_V()
Performs one RWMH update step for V = log(U).
Definition RWMH.cpp:62
void update_U() override
Updates the latent variable U using Random Walk Metropolis-Hastings.
Definition RWMH.cpp:9
bool use_V
Flag to use V = log(U) scale for sampling instead of U directly.
Definition RWMH.hpp:44
void Robbins_Monro_tuning()
Performs Robbins-Monro adaptive tuning of the proposal standard deviation.
Definition RWMH.cpp:87
bool tuning_enabled
Flag to enable/disable Robbins-Monro automatic tuning.
Definition RWMH.hpp:47
double proposal_sd
Standard deviation for the Gaussian proposal distribution.
Definition RWMH.hpp:38
RWMH(Params &p, Data &d, bool use_V=false, double prop_sd=1, bool tuning=false)
Constructor for the RWMH sampler.
Definition RWMH.hpp:142
bool accept
Flag indicating whether the last proposal was accepted.
Definition RWMH.hpp:41
void sampling_U()
Performs one RWMH update step for U on the original scale.
Definition RWMH.cpp:25
U_sampler(Params &p, Data &d)
Constructor for the U_sampler class.
Definition U_sampler.hpp:154
Structure containing all parameters needed for the NGGP (Normalized Generalized Gamma Process) and DP...
Definition Params.hpp:35