Python, Arima prediction out of sample -
i trying use arima model fitted arima_mod = sm.tsa.arima(residual, (p,d,q)).fit(trend="c",maxiter = 20)
out of sample prediction of next value in residual series. to that, may apply 1 of following:
next_pred1 = arima_mod.predict(start,end,dynamic=true)[-1] next_pred2 = arima_mod.predict(start,end,dynamic=false)[-1]
the results of both predictions bad. correction - dynamic=false
these bad. dynamic=true
these horrible. trying understand why: when set start distant past , end next value (which out of sample), prediction bad @ least not change between different values. i.e., start = 4 , start = 8 prediction give same output (i have 40 samples base prediction on). when set same start/end values , use dynamic=true, output gets worse given more past. not make sense - arima - (2,0,2) prediction should use estimate of last 2 values dynamic setting, seems uses past samples forecasting. output value 1e-20 rather than, 0.15 or 1.1... if strange (weighted p or similar) approximation of mean of series used prediction... please advise - how many samples should take forecasting of next out-of-sample value arima = (p,d,q)? last p values only? else? why results of prediction bad (model trained on 40 values - not "sufficiently enough" small p , q? know more values better, have). advice appreciated. thanks!
Comments
Post a Comment