Mathematica Asked on April 17, 2021
I am trying to do some exploration around the multi-dimensional version of [truncated moment problem], where I work with various distributions (uni- or multi-variate), and use some truncated moment sequences of them. I frequently use three different types of sequences:
when the distribution is a fully independent joint, the truncated sequence is represented as a $Ktimes tau$ matrix,
where $K$ is the valence of the distribution and $tau$ is the truncation to the order of moments;
from this matrix desired joint moments can be readily computed.
when the distribution is correlated:
Therefore, I am trying to find out which construct I should use to represent the third kind of truncated sequence. The options that I currently know of are:
List
in which each sublist is of different length)List
s with integer entries) as keys.Which has the better performance? Is there better ways to handle such arrays?
Update I find a similar question at MMA SE; the accepted answer suggests using a dispatch table, but as associations are introduced, won’t (speaking for this case only) replacing dispatch tables with associations avoid invoking the pattern-matching mechanism and make things faster?
Theoretically, with some optimised byte alignment, float-valued integer-partition (from now on I’ll call them intpart
for short) indexed arrays can be represented compactly in the memory; these however may be slow to access, and will definitely be hard to mutate. A hash map is a more flexible alternative. The real problem is which Wolfram built-in hashes the way best suited for this case (for the lack of better phrasing). Compared to Dispatch
and Association
, is using compiled ragged lists a good idea?
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP