Thesis docs
Loading...
Searching...
No Matches
DPW.hpp
Go to the documentation of this file.
1
6
7#pragma once
8
10#include "Eigen/src/Core/Matrix.h"
11
22class DPW : public Process {
23
24public:
32 DPW(Data &d, Params &p) : Process(d, p) {};
33
38
50 [[nodiscard]] double gibbs_prior_existing_cluster(int cls_idx,
51 int obs_idx) const override;
52
60 [[nodiscard]] Eigen::VectorXd gibbs_prior_existing_clusters(int obs_idx) const override;
61
68 [[nodiscard]] double gibbs_prior_new_cluster() const override;
69
71
76
87 [[nodiscard]] double prior_ratio_split(int ci, int cj) const override;
88
99 [[nodiscard]] double prior_ratio_merge(int size_old_ci,
100 int size_old_cj) const override;
101
115 [[nodiscard]] double prior_ratio_shuffle(int size_old_ci, int size_old_cj,
116 int ci, int cj) const override;
117
119
124
136 int get_neighbors_obs(int obs_idx, int cls_idx) const;
137
146 Eigen::VectorXi get_neighbors_obs(int obs_idx) const;
147
159 int get_neighbors_cls(int cls_idx, bool old_allo = false) const;
160
162
170 void update_params() override { return; };
171};
Abstract interface for Bayesian nonparametric processes.
void update_params() override
Updates the parameters of the Dirichlet Process with spatial Weights.
Definition DPW.hpp:170
int get_neighbors_cls(int cls_idx, bool old_allo=false) const
Returns the total number of neighbors for all observations in a given cluster.
Definition DPW.cpp:67
double gibbs_prior_new_cluster() const override
Computes the log prior probability of assigning a data point to a new cluster.
Definition DPW.cpp:134
double prior_ratio_shuffle(int size_old_ci, int size_old_cj, int ci, int cj) const override
Computes the prior ratio for a shuffle operation in a spatially-aware split-merge MCMC algorithm.
Definition DPW.cpp:203
DPW(Data &d, Params &p)
Constructor for the Dirichlet Process with spatial Weights.
Definition DPW.hpp:32
double prior_ratio_merge(int size_old_ci, int size_old_cj) const override
Computes the prior ratio for a merge operation in a spatially-aware split-merge MCMC algorithm.
Definition DPW.cpp:172
int get_neighbors_obs(int obs_idx, int cls_idx) const
Returns the number of neighbors for a given observation in a specific cluster.
Definition DPW.cpp:40
double prior_ratio_split(int ci, int cj) const override
Computes the prior ratio for a split operation in a spatially-aware split-merge MCMC algorithm.
Definition DPW.cpp:144
Eigen::VectorXd gibbs_prior_existing_clusters(int obs_idx) const override
Computes the log prior probabilities of assigning a data point to every existing cluster....
Definition DPW.cpp:88
double gibbs_prior_existing_cluster(int cls_idx, int obs_idx) const override
Computes the log prior probability of assigning a data point to an existing cluster.
Definition DPW.cpp:114
Manages distance matrices and cluster allocations for points.
Definition Data.hpp:26
Process(Data &d, Params &p)
Constructor initializing process with data and parameters.
Definition Process.hpp:75
Structure containing all parameters needed for the NGGP (Normalized Generalized Gamma Process) and DP...
Definition Params.hpp:35