Sample autocorrelation | 您所在的位置:网站首页 › acf自相关函数 › Sample autocorrelation |
Open Live Script Compute the ACF of a time series, which is one variable in a table. Load the electricity spot price data set Data_ElectricityPrices.mat, which contains the daily spot prices in the timetable DataTimeTable. load Data_ElectricityPrices.mat DataTimeTable.Properties.VariableNamesans = 1x1 cell array {'SpotPrice'}Plot the series. plot(DataTimeTable.SpotPrice)The time series plot does not clearly indicate an exponential trend or unit root. Compute the ACF of the raw spot price series. ACFTbl = autocorr(DataTimeTable)ACFTbl=21×2 table Lags ACF ____ _______ 0 1 1 0.55405 2 0.38251 3 0.31713 4 0.25107 5 0.21436 6 0.21275 7 0.19396 8 0.18292 9 0.18826 10 0.19476 11 0.19043 12 0.19963 13 0.19397 14 0.19957 15 0.25495 ⋮autocorr returns the results in the table ACFTbl, where variables correspond to the ACF (ACF) and associated lags (Lags). By default, autocorr computes the ACF of the last variable in the table. To select a variable from an input table, set the DataVariable option. |
CopyRight 2018-2019 实验室设备网 版权所有 |