程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式師世界 >> 編程語言 >  >> 更多編程語言 >> Python

Python encountered an unexpected value using SARIMA in statsmodels

編輯:Python
I'm going through python Of statsmodels library Used SARIMA Model ( Seasonal models ) when , It is found that one of the fitted values is an outlier ( That's ridiculous ), I don't know where the problem is , Please give advice or comments !
The relevant code is as follows :

from statsmodels.tsa.statespace.sarimax import SARIMAX
ma1 = SARIMAX(data, order=(1, 1, 0), seasonal_order=(2, 1, 2, 12)).fit(disp=-1)
data_predict = ma1.predict(1, 180) # The raw data is 180 It's worth , So I got the fitting value here 180 individual
print(data_predict)

Here is the output , You can find that the twelfth data is 150, It's crazy , The original data is 100

[100.0000096109118, 101.15303384694222, 100.63112439498134, 100.31567363403576, 99.91803956099183, 99.31320516579122, 99.2397688074824, 99.364323335374, 99.52178627690145, 99.45265585371217, 99.49356766206385, 150.0341647908478, 102.84198529283533, 101.47911673873134, 101.11699271808635, 101.37760872581055, 101.1685510531693, 101.33988998853111, 100.488788366019, 101.18850135595663, 101.46986894138168, 101.25005990128196, 102.42937729832464, 105.26940063047681, 104.87885340178424, 104.20125495784576, 104.84513917227072, 104.30022473325242, 104.46049561364545, 105.29435103198844, 106.3475855628987, 107.61385171513777, 106.9382963851156, 107.71724758109836, 109.92471844312325, 111.21180776921327, 112.43455125259666, 114.43596745782826, 113.54149551313978, 113.7218288902396, 112.95427147105222, 113.53741294134637, 114.24323976345313, 113.58930337298389, 113.38446389838384, 113.18168099064437, 112.58951784814005, 112.95421179477988, 113.70230348519428, 112.25550057064648, 112.80464501954361, 112.19564690154974, 111.71182828474684, 111.32112954894211, 112.16955223179887, 112.34337277612268, 112.60523528614348, 112.66203544223158, 114.11469664158247, 115.67549449125391, 116.86263542618549, 116.3684467784849, 115.86171281450966, 116.39856626989614, 116.26116014798856, 115.24133213166293, 116.13478578931088, 116.43329306222995, 116.91740759677609, 118.36527405459269, 120.40142869480563, 121.27557047873259, 122.24509489603263, 121.81997780091191, 122.10820944150993, 122.17469205564329, 122.46021497459577, 122.7848550345488, 123.40444211821995, 123.67132534154342, 123.94180674180787, 123.95731029599305, 124.26614313962757, 125.42340985264909, 126.5243696378469, 126.4517946358037, 127.15898133292063, 126.79104907015234, 125.96164959506963, 125.05031640408676, 125.25174721386756, 126.14035376798601, 126.15745825838636, 126.65658295639122, 127.16711894221291, 128.64719254450335, 129.4430594831542, 128.76651621504757, 127.97386935183557, 126.53982574666448, 125.58744389681397, 126.30065915497896, 126.3657759688291, 127.12857066843702, 127.8898862002363, 127.8958947670478, 127.6742277678832, 128.8534124340911, 129.61592605743442, 128.82882802488442, 128.6552725067492, 127.87521051368374, 128.41241374794424, 128.23694887461224, 128.39011262082425, 128.47445398577122, 128.22212935961596, 128.45827082682305, 128.45648790139415, 129.50733014012027, 128.62773348731326, 129.0534434248029, 128.6009763530045, 127.82800003004664, 127.75275583667784, 128.29702450259308, 128.89112720565294, 129.0352846117657, 128.28921377843602, 128.44563585870537, 128.72651099716572, 129.86564813182687, 130.0389799011457, 130.44020856595293, 130.12549320153946, 129.7325692539693, 129.56062757451213, 129.52120245695298, 130.04303128914145, 129.83352202937002, 130.0318968298099, 130.2319376088793, 131.1805598398521, 131.8638897689569, 132.65944300194283, 131.02865678853144, 131.0437330738731, 131.21216558784903, 130.6580568218715, 130.55625164699703, 130.67415222046816, 131.39757510958736, 131.37617313032905, 132.13774306336853, 132.73833084158164, 133.29144167807678, 134.5473792388466, 133.83437313510402, 132.56805308862553, 132.926789818526, 133.13955050877314, 133.13802220719876, 133.7213621368412, 134.3464523127745, 134.98540872260784, 135.92296518068227, 135.29796755764949, 135.04397144390765, 135.5569141963225, 135.34390323344778, 135.67886362625677, 135.58668709669354, 135.74508415275383, 135.43247713852162, 135.91169063475382, 137.08291828465187, 137.6655185560233, 139.2037957183354, 139.64147311951277, 139.77882294005656]


  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式師世界 All Rights Reserved