Docs
Toggle main menu visibility
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
29
class
RWMH
:
public
U_sampler
{
30
31
private
:
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
119
void
Robbins_Monro_tuning
();
120
121
public
:
142
RWMH
(
NGGP_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
};
U_sampler.hpp
Base class for sampling the latent variable U in NGGP mixture models.
Data
Manages distance matrices and cluster allocations for points.
Definition
Data.hpp:26
RWMH::sampling_V
void sampling_V()
Performs one RWMH update step for V = log(U).
Definition
RWMH.cpp:62
RWMH::update_U
void update_U() override
Updates the latent variable U using Random Walk Metropolis-Hastings.
Definition
RWMH.cpp:9
RWMH::RWMH
RWMH(NGGP_params &p, Data &d, bool use_V=false, double prop_sd=1, bool tuning=false)
Constructor for the RWMH sampler.
Definition
RWMH.hpp:142
RWMH::use_V
bool use_V
Flag to use V = log(U) scale for sampling instead of U directly.
Definition
RWMH.hpp:44
RWMH::Robbins_Monro_tuning
void Robbins_Monro_tuning()
Performs Robbins-Monro adaptive tuning of the proposal standard deviation.
Definition
RWMH.cpp:87
RWMH::tuning_enabled
bool tuning_enabled
Flag to enable/disable Robbins-Monro automatic tuning.
Definition
RWMH.hpp:47
RWMH::proposal_sd
double proposal_sd
Standard deviation for the Gaussian proposal distribution.
Definition
RWMH.hpp:38
RWMH::accept
bool accept
Flag indicating whether the last proposal was accepted.
Definition
RWMH.hpp:41
RWMH::sampling_U
void sampling_U()
Performs one RWMH update step for U on the original scale.
Definition
RWMH.cpp:25
U_sampler::U_sampler
U_sampler(NGGP_params &p, Data &d)
Constructor for the U_sampler class.
Definition
U_sampler.hpp:154
NGGP_params
Struct for storing parameters of the NGGP (Normalized Generalized Gamma Process).
Definition
NGGP-params.hpp:28
BNPClust
samplers
U_sampler
RWMH.hpp
Generated by
1.17.0