netrd/reconstruction/mutual_information_matrix.py
def find_joint_probability_distribution(TS, rang, nbins):
    """
    Assign each node j to a vector of length nbins where each element is the product of its own
    individual_probability_distribution and its neighbors'. P(x) * P(y) <-- as opposed to P(x,y)

    Params
    ------
    TS (np.ndarray): Array consisting of $L$ observations from $N$ sensors.
    rang (list): list of the minimum and maximum value in the time series
    nbins (int): number of bins for the pre-processing step (to yield a discrete probability distribution)

    Returns
    -------
    JointP (dict): a dictionary where the keys are nodes in the graph and the
                         are nbins x nbins arrays corresponding to joint probability vectors
    """

    N, L = TS.shape # N nodes and L length
    JointP = dict() # create a dict to put the joint prob distributions into

    for l in range(N): # for each node
        for j in range(l): # for each possible edge
            P, _, _ = np.histogram2d(TS[j], TS[l], bins=nbins, range=np.array([rang,rang]))
            JointP[(j,l)] = P / L

    return JointP

    Assign each node j to a vector of length nbins where each element is the product of its own
    individual_probability_distribution and its neighbors'. P(x) * P(y) <-- as opposed to P(x,y)

    Params
    ------
    TS (np.ndarray): Array consisting of $L$ observations from $N$ sensors.
    rang (list): list of the minimum and maximum value in the time series
    nbins (int): number of bins for the pre-processing step (to yield a discrete probability distribution)

    Returns
    -------
    JointP (dict): a dictionary where the keys are nodes in the graph and the
                         are nbins x nbins arrays corresponding to joint probability vectors
    
Assign each node j to a vector of length nbins where each element is the product of its own
individual_probability_distribution and its neighbors'.

Params

TS (np.ndarray): Array consisting of $L$ observations from $N$ sensors.
rang (list): list of the minimum and maximum value in the time series
nbins (int): number of bins for the pre-processing step (to yield a discrete probability distribution)

Returns

JointP (dict): a dictionary where the keys are nodes in the graph and the
are nbins x nbins arrays corresponding to joint probability vectors
Assign each node j to a vector of length nbins where each element is the product of its own individual_probability_distribution and its neighbors ' . Params TS ( np . ndarray ) : Array consisting of $L$ observations from $N$ sensors . rang ( list ) : list of the minimum and maximum value in the time series nbins ( int ) : number of bins for the pre - processing step ( to yield a discrete probability distribution ) Returns JointP ( dict ) : a dictionary where the keys are nodes in the graph and the are nbins x nbins arrays corresponding to joint probability vectors
def find_joint_probability_distribution(TS, rang, nbins):
    N, L = TS.shape 
    JointP = dict() 
    for l in range(N): 
        for j in range(l): 
            P, _, _ = np.histogram2d(TS[j], TS[l], bins=nbins, range=np.array([rang,rang]))
            JointP[(j,l)] = P / L
    return JointP
def find_joint_probability_distribution ( TS , rang , nbins ) : N , L = TS . shape JointP = dict ( ) for l in range ( N ) : for j in range ( l ) : P , _ , _ = np . histogram2d ( TS [ j ] , TS [ l ] , bins = nbins , range = np . array ( [ rang , rang ] ) ) JointP [ ( j , l ) ] = P / L return JointP
Assign each node j to a vector of length nbins where each element is the product of its own
individual_probability_distribution and its neighbors'.
Assign each node j to a vector of length nbins where each element is the product of its own individual_probability_distribution and its neighbors ' .
"""
    Assign each node j to a vector of length nbins where each element is the product of its own
    individual_probability_distribution and its neighbors'. P(x) * P(y) <-- as opposed to P(x,y)

    Params
    ------
    TS (np.ndarray): Array consisting of $L$ observations from $N$ sensors.
    rang (list): list of the minimum and maximum value in the time series
    nbins (int): number of bins for the pre-processing step (to yield a discrete probability distribution)

    Returns
    -------
    JointP (dict): a dictionary where the keys are nodes in the graph and the
                         are nbins x nbins arrays corresponding to joint probability vectors
    """ # N nodes and L length # create a dict to put the joint prob distributions into # for each node # for each possible edge
TS
rang
nbins