NumericalInverse.py
def _smooth_boundary(self, y_smooth, window_length: int):
        """
        Finishes the moving average smoothing - makes sure that even the
            boundaries will be averaged out, and they will have values
            that make sense

        Args:
            y_smooth ... array of already smoothed values from moving averages
            window_length ... how many windows should be combine together
                              when performing the smoothing
        """

        # Cloning the initial array, not to overwrite it in place
        y_smoothed_boundaries = y_smooth[:]

        # Determining the size of the boundary, which is half of the window length
        half = window_length / 2

        # Transforming the left boundary
        for i in range(math.floor(half)):
            coefficient = window_length / (math.ceil(half) + i)
            y_smoothed_boundaries[i] = y_smooth[i] * coefficient

        # Transforming the right boundary, but only if the window is larger than 2
        if window_length > 2:
            # There is a slight difference in having even or odd number of
            #   windows. Reason being that in even number of windows,
            #   the algorithm is taking more previous points than next points
            if window_length % 2 == 0:
                for i in range(1, math.floor(half)+1):
                    coefficient = window_length / (math.ceil(half) + i)
                    y_smoothed_boundaries[-i] = y_smooth[-i] * coefficient
            else:
                for i in range(1, math.floor(half)+1):
                    coefficient = window_length / (math.ceil(half) + i - 1)
                    y_smoothed_boundaries[-i] = y_smooth[-i] * coefficient

        return y_smoothed_boundaries

        Finishes the moving average smoothing - makes sure that even the
            boundaries will be averaged out, and they will have values
            that make sense

        Args:
            y_smooth ... array of already smoothed values from moving averages
            window_length ... how many windows should be combine together
                              when performing the smoothing
        
Finishes the moving average smoothing - makes sure that even the
boundaries will be averaged out, and they will have values
that make sense


Finishes the moving average smoothing - makes sure that even the boundaries will be averaged out and they will have values that make sense
def _smooth_boundary(self, y_smooth, window_length: int):
        y_smoothed_boundaries = y_smooth[:]
        half = window_length / 2
        for i in range(math.floor(half)):
            coefficient = window_length / (math.ceil(half) + i)
            y_smoothed_boundaries[i] = y_smooth[i] * coefficient
        if window_length > 2:
            if window_length % 2 == 0:
                for i in range(1, math.floor(half)+1):
                    coefficient = window_length / (math.ceil(half) + i)
                    y_smoothed_boundaries[-i] = y_smooth[-i] * coefficient
            else:
                for i in range(1, math.floor(half)+1):
                    coefficient = window_length / (math.ceil(half) + i - 1)
                    y_smoothed_boundaries[-i] = y_smooth[-i] * coefficient
        return y_smoothed_boundaries
def _smooth_boundary ( self , y_smooth , window_length : int ) : y_smoothed_boundaries = y_smooth [ : ] half = window_length / 2 for i in range ( math . floor ( half ) ) : coefficient = window_length / ( math . ceil ( half ) + i ) y_smoothed_boundaries [ i ] = y_smooth [ i ] * coefficient if window_length > 2 : if window_length % 2 == 0 : for i in range ( 1 , math . floor ( half ) + 1 ) : coefficient = window_length / ( math . ceil ( half ) + i ) y_smoothed_boundaries [ - i ] = y_smooth [ - i ] * coefficient else : for i in range ( 1 , math . floor ( half ) + 1 ) : coefficient = window_length / ( math . ceil ( half ) + i - 1 ) y_smoothed_boundaries [ - i ] = y_smooth [ - i ] * coefficient return y_smoothed_boundaries
Finishes the moving average smoothing - makes sure that even the
boundaries will be averaged out, and they will have values
that make sense
Finishes the moving average smoothing - makes sure that even the boundaries will be averaged out and they will have values that make sense
"""
        Finishes the moving average smoothing - makes sure that even the
            boundaries will be averaged out, and they will have values
            that make sense

        Args:
            y_smooth ... array of already smoothed values from moving averages
            window_length ... how many windows should be combine together
                              when performing the smoothing
        """ # Cloning the initial array, not to overwrite it in place # Determining the size of the boundary, which is half of the window length # Transforming the left boundary # Transforming the right boundary, but only if the window is larger than 2 # There is a slight difference in having even or odd number of #   windows. Reason being that in even number of windows, #   the algorithm is taking more previous points than next points
self
y_smooth
window_length
int