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

What is the most convinient format for the population sampels? #20

Open
scheidan opened this issue Sep 18, 2024 · 0 comments
Open

What is the most convinient format for the population sampels? #20

scheidan opened this issue Sep 18, 2024 · 0 comments

Comments

@scheidan
Copy link
Collaborator

scheidan commented Sep 18, 2024

Currently we return the samples as Vector{Vector} . This makes it not very nice to work with the samples and most user would probably run

stack(result.samples)

to get a matrix n_parameter x n_samples matrix back. Should we return the result directly in this format?

Other ideas:

  • DimensionalData.jl looks but may be an overkill great:

https://rafaqz.github.io/DimensionalData.jl/stable/basics

using DimensionalData
A = DimArray(stack(res_1.population),
             (para = ["p_$i" for i in 1:2], sample = ["s_$i" for i in 1:5000]),
             name = "population sample")

A[1:2, 4:6]
A[para=2, sample=:]
Array(A)
using AxisKeys

B = KeyedArray(stack(res_1.population),;
               para = [Symbol("p_$i") for i in 1:2],
               iter = 1:5000)

B[1, 3:10]
B[iter = 2:40]

B(:p_1)
B(:p_1, :)
B(:p_1, 10:20)
@scheidan scheidan changed the title use ArraysOfArrays.jl for population sampels? What is the most convinient format for the population sampels? Sep 19, 2024
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

1 participant