Library
Types
DPMNeal3.DPM
— TypeDPM(rng::AbstractRNG, N; K0 = 1, a0 = 2.0, b0 = 4.0)
Initialize a generic DPM with N
observations, K0
initial clusters and a Gamma(a0, b0)
prior distribution for the DP mass parameter.
Accessors
DPMNeal3.n_clusters
— Functionn_clusters(m::AbstractDPM)
Return the current number of active clusters.
DPMNeal3.active_clusters
— Functionactive_clusters(m::AbstractDPM)
Return the current set of active clusters.
DPMNeal3.passive_clusters
— Functionpassive_clusters(m::AbstractDPM)
Return (a subset of) the current set of passive clusters.
DPMNeal3.cluster_capacity
— Functioncluster_capacity(m::AbstractDPM)
Return the current cluster storage capacity.
DPMNeal3.cluster_labels
— Functioncluster_labels(m::AbstractDPM)
Return the current cluster labels.
DPMNeal3.cluster_sizes
— Functioncluster_sizes(m::AbstractDPM)
Return the current cluster sizes.
DPMNeal3.dp_mass
— Functiondp_mass(m::AbstractDPM)
Return the current DP mass parameter.
Interface
DPMNeal3.parent_dpm
— Methodparent_dpm(m::AbstractDPM)
Return the parent DPM.
DPMNeal3.update_suffstats!
— Methodupdate_suffstats!(m::AbstractDPM, data)
Update the sufficient statistics in m
from scratch, given the dataset data
.
DPMNeal3.update_suffstats!
— Methodupdate_suffstats!(m::AbstractDPM, data, i::Int, k::Int, l::Int)
Update the sufficient statistics in m
after the i
th cluster label changes from k
to l
, given the dataset data
.
DPMNeal3.update_hyperpars!
— Functionupdate_hyperpars!(rng::AbstractRNG, m::AbstractDPM, data)
Update the kernel hyperparameters in m
, given the dataset data
.
DPMNeal3.logpredlik
— Functionlogpredlik(m::AbstractDPM, data, i::Int, k::Int)
Return the log-pdf of the i
th response at its current value, given the other responses, the other cluster labels, and the own cluster label fixed at k
. The responses should be present in data
.