Skip to content

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

Open
@scheidan

Description

@scheidan

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)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions