简体   繁体   English

ACF和PACF的图

[英]Plot of ACF & PACF

There are 96 observations of energy consumption per day from 01/05/2016 - 31/05/2017. 从01/05/2016-31/05/2017每天有96观察到的能源消耗。 I am trying an ARIMA model in R to be fitted to these time series observations. 我正在尝试将R中的ARIMA模型拟合到这些时间序列观测值。 I have chosen the frequency of time series as 96. In total, there are 38016 observations. 我选择时间序列的频率为96。总共有38016个观测值。 I have cleaned the series using tsclean command in R to remove the outliers. 我已经在R中使用tsclean命令清理了系列,以删除异常值。

timeseries <- ts(full$consumption, frequency = 96)

在此处输入图片说明

Cleansed time series: 清洗时间序列:

timeseries <- tsclean(timeseries)

在此处输入图片说明

I have then differenced the series: 然后,我改变了系列:

diffts <- diff(timeseries)

在此处输入图片说明

I have then decomposed the series to obtain the seasonal component from it. 然后,我将序列分解以从中获取季节成分。 Subtracted the seasonal component from it to deseasonalize it. 从中减去季节成分以使其季化。

difftscomponent <- decompose(diffts)
adjusted_diffts <- diffts - difftscomponent$seasonal

The ACF plot of final time series: 最终时间序列的ACF图:

acf(adjusted_diffts)

在此处输入图片说明

The PACF of the final time series: 最终时间序列的PACF:

pacf(adjusted_diffts)

在此处输入图片说明

There are three questions: 有三个问题:

  1. Normally, the X-axis of ACF and the PACF plot of the time series will show lag order from 1 to ... . 通常,ACF的X轴和时间序列的PACF图将显示从1到...的滞后顺序。 There will be integer values indicating the number of lags. 将有整数值指示滞后次数。 Then why in my case there are decimal values from 0.1.... ? 那为什么在我的情况下从0.1 ....开始有十进制值? What does that indicate? 这说明什么? What to do to get number of lags? 如何获得滞后次数?

  2. What will be the probable order of AR and MA in my case by looking at ACF and PACF plot? 通过查看ACF和PACF图,在我的情况下AR和MA的可能顺序是什么?

    3.I have transformed the original time series ie made it stationary and deseasonalized it in order to fit an ARIMA model. 3.我对原始时间序列进行了转换,即使其固定并对其进行了反季节化处理,以适合ARIMA模型。 By looking at the final adjusted time series, can it be said that it is fit to be modelled OR will it require any further transformation? 通过查看最终调整后的时间序列,可以说适合建模吗?还是需要任何进一步的转换?

  1. This is the result of formatting your data.frame as time.series . 这是将data.frame格式化为time.series的结果。 I can't test it right now since I don't have access to R right now but going back to a simple data.frame should do the job, something along (there probably is a more elegant way): 我现在无法对其进行测试,因为我现在无法访问R,但是回到简单的data.frame应该可以完成工作,总有可能(有一种更优雅的方式):

     acf(data.frame(adjusted_diffts) 
  2. While the plotted ACF/PACF gives you an indication which lags need to be corrected the selection of the ARIMA-Order should be done by eg checking multiple combinations of ARIMA(p,d,q) and choose the one with the best (lowest) AIC. 尽管绘制的ACF / PACF可以指示需要纠正的滞后,但应通过例如检查ARIMA(p,d,q)的多个组合并选择最佳(最低)的ARIMA来选择ARIMA-Order。 AIC。 Here is an article + code example to test for different orders. 是一个用于测试不同订单的文章和代码示例。

  3. This I can't answer with certainty. 我不能确定地回答。 I would use the data you have and after, fitting an ARIMA model, check the residuals for any remaining structure. 我将使用您拥有的数据,然后在拟合ARIMA模型之后,检查任何剩余结构的残差。 If there still is structure in the residuals you might need need to adjust your data/model. 如果残差中仍存在结构,则可能需要调整数据/模型。

Edit: formatting 编辑:格式化

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

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