Skip to content

incorrect restoration of marginalizedNodes values for nonconjugate sampling in sampler_CRP when number of clusters exceeds truncated number #1513

@paciorek

Description

@paciorek

In sampler_CRP, if a user sets the max number of clusters to be less than the number of "observations", then we warn the user that that max number is exceeded and simply avoid setting the cluster membership value to be more than the max number.

However, when this happens it turns out that our logic for restoring values of marginalizedNodes when they are sampled by the non-conjugate sampler is faulty but no cluster is opened with those cluster parameter values. When we are at the max, no sampling of the marginalizedNodes is done, so the call to sample(i,0) resets values of an arbitrary index to arbitrary values (the last stored index and values). This will presumably cause incorrect sampling. Fortunately, this is in a case where we have already warned the user they should increase the max number of clusters, so the MCMC output is already invalid (albeit as an incorrectly constrained model rather than incorrect samples per se).

I will fix this shortly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions