【问题标题】:How to find number of lags in autocorrelation and partial autocorrelation?如何找到自相关和偏自相关的滞后数?
【发布时间】:2020-01-24 14:42:07
【问题描述】:

我正在尝试在 python 中使用 tsfresh 包来从加速度计传感器输入中提取特征,我遇到了几个需要延迟变量的特征:

tsfresh.feature_extraction.feature_calculators.agg_autocorrelation(x, param)
Where:
                  x (numpy.ndarray) – the time series to calculate the feature of
                  param (list) – contains dictionaries {“f_agg”: x, “maxlag”, n} with x str, the name of a numpy function (e.g. “mean”, “var”, “std”, “median”), its the name of the aggregator function that is applied to the autocorrelations. Further, n is an int and the maximal number of lags to consider.
tsfresh.feature_extraction.feature_calculators.autocorrelation(x, lag)
Where:
                  x (numpy.ndarray) – the time series to calculate the feature of
                  lag (int) – the lag
tsfresh.feature_extraction.feature_calculators.c3(x, lag)
Where:
                  x (numpy.ndarray) – the time series to calculate the feature of
                  lag (int) – the lag
tsfresh.feature_extraction.feature_calculators.partial_autocorrelation(x, param)
Where:
                  x (numpy.ndarray) – the time series to calculate the feature of
                  param (list) – contains dictionaries {“lag”: val} with int val indicating the lag to be returned
tsfresh.feature_extraction.feature_calculators.time_reversal_asymmetry_statistic(x, lag)
Where:
                  x (numpy.ndarray) – the time series to calculate the feature of
                  lag (int) – the lag that should be used in the calculation of the feature

那么,我想知道如何找到滞后变量?

亲切的问候

【问题讨论】:

    标签: python machine-learning time-series feature-extraction autocorrelation


    【解决方案1】:

    TSFRESH 使用滞后变量作为参数来计算相关特征。
    因此,例如在 c3 计算中,它将使用 lag=1 然后 lag=2,这样做会将具有计算数据的列添加为 tsXcolname__c3__lag_1 .
    您应该在 TSFRESH 中查找如何更改此参数,即它将为每个功能计算多少滞后。我认为 c3 的标准值为 3,自相关的标准值为 9。

    【讨论】:

      猜你喜欢
      • 2020-10-28
      • 1970-01-01
      • 2017-01-13
      • 2019-09-25
      • 2012-05-09
      • 2015-01-19
      • 1970-01-01
      • 2023-03-11
      • 2019-09-30
      相关资源
      最近更新 更多