spkit
.show_farmulas¶
- spkit.show_farmulas()¶
Usuful Formulas
Usuful FormulasDifferential Entropy of Normally distribuated Multivariant X
for .. math:: x ∼ N(μ,Σ)
entropy in nats
(1/2)n + (n/2)ln(2π) => are constant values for fixed dimension
code:
H_x = entropy_differential(x,is_multidim=True, emb_dim=1, delay=1,)
Self-Conditional Entropy
Information of X(i+1) given X(i)
using:
code:
H_x1x = entropy_diff_cond_self(X, present_first=True)
Conditional Entropy
Information of X(i+1) given X(i) and Y(i)
- code::
H_x1xy = entropy_diff_cond(X,Y,present_first=True)
Joint Entropy
code:
H_xy = entropy_diff_joint(X,Y)
Joint-Conditional Entropy
code:
H_xy1xy = entropy_diff_joint_cond(X,Y,present_first=True)
Self Mutual Information
Predictibility of X(i+1) given X(i)
code:
I_xx = mutual_info_diff_self(X,present_first=True)
Mutual Information
Predictibility of X(i+1) given X(i) and Y(i)
code:
I_xy = mutual_info_diff(X,Y,present_first=True)
Transfer Entropy
[Eq1] [Eq2]Using:
| entropy_diff_cond_self(X) | entropy_diff_cond(X,Y)code:
TE_x2y = transfer_entropy(X,Y,present_first=True)
Partial Transfer Entropy Or Conditional Transfer Entopry
code:
TE_x2y1z = partial_transfer_entropy(X,Y,Z,present_first=True,verbose=False)
Granger Causality based on Differential Entropy
GC_XY (X–>Y) :
GC_YX (Y–>X) :
GC_XdY (X.Y) :
- if normalize True
Using::
code:
gc_xy, gc_yx,gc_xdy = entropy_granger_causality(X,Y,present_first=True, normalize=False)