spkit
.entropy_diff_joint_cond¶
- spkit.entropy_diff_joint_cond(X, Y, present_first=True)¶
Joint-Conditional Entropy \(H_{\partial}(X_{i+1},Y_{i+1}|X_i,Y_i)\)
Joint-Conditional Entropy
\[H_{\partial}(X_{i+1},Y_{i+1}|X_i,Y_i) = H(X_{i+1},Y_{i+1},X_i,Y_i) - H(X_i,Y_i)\]- Parameters:
- X: 2d-array,
multi-dimentional signal space, where each column (axis=1) are the delayed signals
- Y: 2d-array,
multi-dimentional signal space, where each column (axis=1) are the delayed signals
- present_first: bool, default=True
if True, X[:,0] is present, and X[:,1:] is past, in incresing order
if True, X[:,-1] is present, and X[:,:-1] is past
- Returns:
- H_x1y: scaler
Conditional Joint Entropy
See also
entropy_diff_joint
Joint-Entropy
References
wiki
Examples
#sp.entropy_diff_joint_cond import numpy as np import matplotlib.pyplot as plt import spkit as sp X, fs, ch_names = sp.data.eeg_sample_14ch() X = X - X.mean(1)[:, None] # Example 1 X1 = sp.signal_delayed_space(X[:,0].copy(),emb_dim=5,delay=2) Y1 = sp.signal_delayed_space(X[:,2].copy(),emb_dim=5,delay=2) Y2 = sp.add_noise(Y1,snr_db=0) H_xy1 = sp.entropy_diff_joint_cond(X1,Y1) H_xy2 = sp.entropy_diff_joint_cond(X1,Y2) print('Conditional Entropy') print(f'- H(X1(i+1),Y1(i+1) | X1(i),Y1(i)) = {H_xy1}') print(f'- H(X1(i+1),Y2(i+1) | X1(i),Y2(i)) = {H_xy2}')