INNER CODE UNIT · Python

make_complexity_AV

target/matrixprofile-ts · matrixprofile/annotation_vector.py:14

def make_complexity_AV(ts, m):
    """
    returns a complexity annotation vector for timeseries ts with window m.
    The complexity of a window is the average absolute difference between consecutive data points.
    """
    diffs = np.diff(ts, append=0)**2
    diff_mean, diff_std = movmeanstd(diffs, m)

    complexity = np.sqrt(diff_mean)
    complexity = complexity - complexity.min()
    complexity = complexity / complexity.max()
    return complexity


def make_meanstd_AV(ts, m):
    """ returns boolean annotation vector which selects windows with a standard deviation greater than average """
    _, std = movmeanstd(ts, m)
    mu = std.mean()

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…