Suppose I build a Probabilities
object Prs
from a vector x
like so:
using ComplexityMeasures
x = rand([true, false], 10)
Prs, outs = allprobabilities_and_outcomes(UniqueElements(), x)
I would like to have a Dict
-like interface whereby Prs[out]
returns the probability of outcome out
in outs
. Is there a built-in (to ComplexityMeasures.jl) or best-practices way to do this?
In ComplexityMeasures.OutcomeSpace
’s documentation under “Implementation details” I found
The element type of Ω varies between outcome space models, but it is guaranteed to be hashable and sortable . This allows for conveniently tracking the counts of a specific event across experimental realizations, by using the outcome as a dictionary key and the counts as the value for that key (or, alternatively, the key remains the outcome and one has a vector of probabilities, one for each experimental realization).
but have not figured out how to use a Probabilities
object this way aside from manually constructing something like
PrsDict = Dict(zip(outs, Prs))
which feels redundant. I’d appreciate any pointers or tips if I’m missing something!