rusandris / StateTransitionNetworks.jl

Toolkit for dynamics on state transition networks
2 stars 0 forks source link

Add keyword argument to `bit_number_measures` #10

Closed sbulcsu closed 1 month ago

sbulcsu commented 9 months ago

It should be possible to provide a stationary distribution, something like this: function bit_number_measures(P::AbstractMatrix; x=nothing)

rusandris commented 9 months ago

Since bit_number_measures only depend on the stationary distribution x, maybe it would make more sense to get rid of P entirely:


function bit_number_measures(x::Vector{Float64})

 l = -log.(x)
 replace!(l, Inf=>0.0)
 entropy = sum((x .* l)) #C1
 variance =  sum(x .* l .* l) - entropy^2 #C2

 return real(entropy), real(variance), :Success
end

If x is not readily available, one can use bit_number_measures( stationary_distribution(P) )