Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

sparse dirichlet discrete #83

Open
stephentu opened this issue Sep 7, 2014 · 3 comments
Open

sparse dirichlet discrete #83

stephentu opened this issue Sep 7, 2014 · 3 comments

Comments

@stephentu
Copy link
Contributor

I think Fritz and I had a conversation somewhat related to this topic, but I sort of forgot the outcome. If I have a DD where the dim is very large, and I expect the non-zero entries of the suffstats (e.g. the counts) to be very sparse, what's the right way to do this in distributions?

Essentially I want a DD where the counts[] is a Sparse<> instead of float[]. Would it be worth created a separate model which is SparseDD?

@fritzo
Copy link
Contributor

fritzo commented Sep 8, 2014

The DPD datatype degenerates to DD when shared.beta0 = 0. In this case, you'll get a dense shared.betas analogous to DD shared.alphas, and you'll get a sparse group.counts. Would that work for you?

@stephentu
Copy link
Contributor Author

Yes this will be sufficient for now. Thanks!

@fritzo
Copy link
Contributor

fritzo commented Sep 9, 2014

A slight correction: the DPD with shared.beta0=0 is equivalent to the DD via the equation

dpd.shared.betas[i] * dpd.shared.alpha = dd.shared.alphas[i]

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants