Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing Internal Representation to StructArray or TupleVector? #337

Open
ParadaCarleton opened this issue Nov 19, 2021 · 3 comments
Open

Comments

@ParadaCarleton
Copy link
Member

Separately from #336, which would solve our AxisArray-related issues, there's the question of what data structure we want to use internally to deal with the issues caused by using regular arrays, most notably enforcing Float64 as the datatype for everything and having to deal with grouped parameters manually.

@devmotion
Copy link
Member

Ideally we would allow to use matrices/3d arrays (current setup) as well as StructArrays (as discussed in some of the issues or PRs IIRC). Both have their advantages and disadvantages for different use cases.

@ParadaCarleton
Copy link
Member Author

Ideally we would allow to use matrices/3d arrays (current setup) as well as StructArrays (as discussed in some of the issues or PRs IIRC). Both have their advantages and disadvantages for different use cases.

What advantages does a regular 3d array have?

@devmotion
Copy link
Member

Among other things, it is simple, memory-efficient, supported by base and does not require any external packages, easy to manipulate, easy to save, supported by many other (Bayesian) analysis tools, and additionally sufficient for many applications (e.g., often all types are (or at least can be converted to) Float64 and there are no missing draws, and variables are scalar or can be flattened in a straightforward way). Nevertheless, 3d arrays have their limitations and disadvantages, e.g., they require a common element type (annoying e.g. when working with discrete data), can't deal with non-array variates, and it is a bit annoying to reconstruct the original data from the flattened version.

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

No branches or pull requests

2 participants