p_entropy.py
def complexity(op):
    ''' This function computes the complexity of a time series defined as: Comp_JS = Q_o * JSdivergence * pe
    Q_o = Normalizing constant
    JSdivergence = Jensen-Shannon divergence
    pe = permutation entopry
    ARGS: ordinal pattern'''
    pe = p_entropy(op)
    constant1 = (0.5+((1 - 0.5)/len(op)))* np.log(0.5+((1 - 0.5)/len(op)))
    constant2 = ((1 - 0.5)/len(op))*np.log((1 - 0.5)/len(op))*(len(op) - 1)
    constant3 = 0.5*np.log(len(op))
    Q_o = -1/(constant1+constant2+constant3)

    temp_op_prob = np.divide(op, sum(op))
    temp_op_prob2 = (0.5*temp_op_prob)+(0.5*(1/len(op)))
    JSdivergence = (s_entropy(temp_op_prob2) - 0.5 * s_entropy(temp_op_prob) - 0.5 * np.log(len(op)))
    Comp_JS = Q_o * JSdivergence * pe
    return(Comp_JS)
 This function computes the complexity of a time series defined as: Comp_JS = Q_o * JSdivergence * pe
    Q_o = Normalizing constant
    JSdivergence = Jensen-Shannon divergence
    pe = permutation entopry
    ARGS: ordinal pattern
This function computes the complexity of a time series defined as: Comp_JS = Q_o * JSdivergence * pe
Q_o = Normalizing constant
JSdivergence = Jensen-Shannon divergence
pe = permutation entopry
ARGS: ordinal pattern
This function computes the complexity of a time series defined as : Comp_JS = Q_o * JSdivergence * pe Q_o = Normalizing constant JSdivergence = Jensen - Shannon divergence pe = permutation entopry ARGS : ordinal pattern
def complexity(op):
    pe = p_entropy(op)
    constant1 = (0.5+((1 - 0.5)/len(op)))* np.log(0.5+((1 - 0.5)/len(op)))
    constant2 = ((1 - 0.5)/len(op))*np.log((1 - 0.5)/len(op))*(len(op) - 1)
    constant3 = 0.5*np.log(len(op))
    Q_o = -1/(constant1+constant2+constant3)
    temp_op_prob = np.divide(op, sum(op))
    temp_op_prob2 = (0.5*temp_op_prob)+(0.5*(1/len(op)))
    JSdivergence = (s_entropy(temp_op_prob2) - 0.5 * s_entropy(temp_op_prob) - 0.5 * np.log(len(op)))
    Comp_JS = Q_o * JSdivergence * pe
    return(Comp_JS)
def complexity ( op ) : pe = p_entropy ( op ) constant1 = ( 0.5 + ( ( 1 - 0.5 ) / len ( op ) ) ) * np . log ( 0.5 + ( ( 1 - 0.5 ) / len ( op ) ) ) constant2 = ( ( 1 - 0.5 ) / len ( op ) ) * np . log ( ( 1 - 0.5 ) / len ( op ) ) * ( len ( op ) - 1 ) constant3 = 0.5 * np . log ( len ( op ) ) Q_o = - 1 / ( constant1 + constant2 + constant3 ) temp_op_prob = np . divide ( op , sum ( op ) ) temp_op_prob2 = ( 0.5 * temp_op_prob ) + ( 0.5 * ( 1 / len ( op ) ) ) JSdivergence = ( s_entropy ( temp_op_prob2 ) - 0.5 * s_entropy ( temp_op_prob ) - 0.5 * np . log ( len ( op ) ) ) Comp_JS = Q_o * JSdivergence * pe return ( Comp_JS )
This function computes the complexity of a time series defined as: Comp_JS = Q_o * JSdivergence * pe
Q_o = Normalizing constant
JSdivergence = Jensen-Shannon divergence
pe = permutation entopry
ARGS: ordinal pattern
This function computes the complexity of a time series defined as : Comp_JS = Q_o * JSdivergence * pe Q_o = Normalizing constant JSdivergence = Jensen - Shannon divergence pe = permutation entopry ARGS : ordinal pattern
''' This function computes the complexity of a time series defined as: Comp_JS = Q_o * JSdivergence * pe
    Q_o = Normalizing constant
    JSdivergence = Jensen-Shannon divergence
    pe = permutation entopry
    ARGS: ordinal pattern'''
op