netrd/reconstruction/mutual_information_matrix.py
def find_individual_probability_distribution(TS, rang, nbins):
    """
    Assign each node to a vector of length nbins where each element is the probability of the
    node in the time series being in that binned "state"

    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
    -------
    IndivP (dict): a dictionary where the keys are nodes in the graph and the values are vectors
                   of empirical probabilities of that node's time series being in that binned state.
    """

    N, L = TS.shape  # N nodes and L length
    IndivP = dict()  # create a dict to put the individual binned probability vectors into

    for j in range(N):
        P, _ = np.histogram(TS[j], bins=nbins, range=rang) # bin node j's time series data into nbins
        IndivP[j] = P / L # normalize that by the length of time series data to make it a vector of probs

    return IndivP

    Assign each node to a vector of length nbins where each element is the probability of the
    node in the time series being in that binned "state"

    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
    -------
    IndivP (dict): a dictionary where the keys are nodes in the graph and the values are vectors
                   of empirical probabilities of that node's time series being in that binned state.
    
Assign each node to a vector of length nbins where each element is the probability of the
node in the time series being in that binned "state"

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

IndivP (dict): a dictionary where the keys are nodes in the graph and the values are vectors
of empirical probabilities of that node's time series being in that binned state.
Assign each node to a vector of length nbins where each element is the probability of the node in the time series being in that binned " state " 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 IndivP ( dict ) : a dictionary where the keys are nodes in the graph and the values are vectors of empirical probabilities of that node ' s time series being in that binned state .
def find_individual_probability_distribution(TS, rang, nbins):
    N, L = TS.shape  
    IndivP = dict()  
    for j in range(N):
        P, _ = np.histogram(TS[j], bins=nbins, range=rang) 
        IndivP[j] = P / L 
    return IndivP
def find_individual_probability_distribution ( TS , rang , nbins ) : N , L = TS . shape IndivP = dict ( ) for j in range ( N ) : P , _ = np . histogram ( TS [ j ] , bins = nbins , range = rang ) IndivP [ j ] = P / L return IndivP
Assign each node to a vector of length nbins where each element is the probability of the
node in the time series being in that binned "state"
Assign each node to a vector of length nbins where each element is the probability of the node in the time series being in that binned " state "
"""
    Assign each node to a vector of length nbins where each element is the probability of the
    node in the time series being in that binned "state"

    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
    -------
    IndivP (dict): a dictionary where the keys are nodes in the graph and the values are vectors
                   of empirical probabilities of that node's time series being in that binned state.
    """ # N nodes and L length # create a dict to put the individual binned probability vectors into # bin node j's time series data into nbins # normalize that by the length of time series data to make it a vector of probs
TS
rang
nbins