简体   繁体   English

如何检查时间序列数据是线性还是非线性

[英]how to check time series data is linear or non linear

I have data of idle duration of a system as follows: 我有系统空闲时间的数据,如下所示:

Date | 日期| Idle Time Start | 空闲时间开始| Idle Time End | 空闲时间结束| Idle Duration | 空闲时间|

2017/07/11 | 2017/07/11 | 10:36:21 | 10:36:21 | 10:37:28 | 10:37:28 | 67 | 67 |

2017/07/11 | 2017/07/11 | 10:45:44 | 10:45:44 | 10:46:58 | 10:46:58 | 74 | 74 | ....... .......

I want to check whether the idle duration is linear or non linear using python. 我想使用python检查空闲时间是线性还是非线性。 My second question is if I want to predict idle duration for future time then any suggestions that how can I convert this data into dataframe so that i can perform some kind of regression analysis. 我的第二个问题是,如果我想预测将来的空闲时间,那么关于如何将这些数据转换为数据帧以便进行某种回归分析的任何建议。 I have stored the idle duration and the starting of idle duration in an array. 我已经将空闲时间和空闲时间的开始存储在一个数组中。 I have also plotted the data using the following code: 我还使用以下代码绘制了数据:

SampleOne, Times = get_idletime_set(1000)
FMT = '%Y-%m-%d %H:%M:%S'
Dates=[]
for i in Times:
    Dates.append(datetime.strptime(i, FMT))


plt.plot(Dates, SampleOne)
plt.ylabel('Idle Duration')
plt.xlabel('Time')
plt.show()

I got this graph. 我得到了这张图。 enter image description here 在此处输入图片说明

The obtained graph is not straight line. 获得的图形不是直线。 Does it mean that idle duration is not linear with respect to time. 这是否意味着空闲时间相对于时间不是线性的。

  1. excuse that i will make this a little more statistical now. 借口,我现在将对此进行更多统计。 So you want to check if you model look like idle = c * t + u or idle = g(t) + u (with some constant c , t as time and u as factor for everything unobserved ) right ? 因此,您想检查模型是否看起来像是闲置= c * t + u或闲置= g(t)+ u(其中一些常数c,t是时间,u是所有未观察到的因素)对吗? so first thing first, your graph is not a valide time-series graph since the dates seem not to be ordered correctly ( some line are crossing which is not correct) 因此首先,您的图形不是有效时间序列图,因为日期似乎未正确排序(某些线在交叉,这是不正确的)

  2. As proposed this is imo a statistical question about modelselection. 按照提议,这是关于模型选择的统计问题。 So you could run either test about linear or non-linear relationship between two variable or regress it as timeseries model without autoregressive term and compare with information criterions. 因此,您可以测试两个变量之间的线性或非线性关系,也可以将其作为没有自回归项的时间序列模型进行回归,并与信息准则进行比较。 But modelselection is a huge topic. 但是模型选择是一个巨大的话题。 Easy way would be to make an average idle time per day and regress it on a time-index as idel ~ t + t²+ln(t) in various combination and compare their performance and significance. 一种简单的方法是将每天的平均空闲时间设置为idel〜t +t²+ ln(t)的各种组合,然后比较它们的性能和重要性。

  3. I would consider that you read up on this or propose this question as the statistical stack exchange 我认为您已阅读或建议此问题作为统计堆栈交换

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM