« first day (3211 days earlier)      last day (16 days later) » 

1:19 PM
Maybe some of you have an idea: I'm looking for a way to implement a discrete multidimensional probability distrbution that is only sparsely populated but can still efficiently be marginalized: stackoverflow.com/questions/78323703
 
 
2 hours later…
3:36 PM
@flawr how bad would it be to use a custom class that contains the values as a list and the indices as sorted tuples? In other words, how efficient must efficient marginalising be? Access to items during marginalization would be worse.
I'm thinking you could just loop over index-value pairs and construct the sum object on the fly in O(N).
Actually, dict rather than list so you can ignore zeroes more easily. Alternatively, an auxiliary set of all indices.
 
@AndrasDeak--СлаваУкраїні well that might actually be the smartest solution in the end
I could even imagine sorting multiple copies of this list in different ways
 
3:57 PM
I've left a handwavy answer, I'm chronically short on time to provide anything more substantial, sorry :)
(I'm also aware you don't actually need me to implement any of this :P)
mid-answer I convinced myself that a dict is better because indexing becomes trivial
 
 
4 hours later…
8:27 PM
@flawr An alternative, depending on which operations you need to do on the data: en.m.wikipedia.org/wiki/R*-tree
Of course chat doesn’t do URLs properly. R*-tree link.
 

« first day (3211 days earlier)      last day (16 days later) »