display predicted values for initial data using auto.arima in R

馋奶兔 提交于 2019-12-02 02:57:02

Those values are known as fitted values and they can be obtained with the function fitted as follows:

lapply(listed_arima, fitted)
# $Hornschickens
#          Jan      Feb      Mar      Apr      May      Jun      Jul      Aug      Sep      Oct      Nov
# 2017 223.8182 223.8182 223.8182 223.8182 223.8182 223.8182 223.8182 223.8182 223.8182 223.8182 223.8182
#
# $Hornshooves
#           Jan      Feb      Mar      Apr      May      Jun      Jul      Aug      Sep      Oct      Nov      Dec
# 2017 336.9231 336.9231 336.9231 336.9231 336.9231 336.9231 336.9231 336.9231 336.9231 336.9231 336.9231 336.9231
# 2018 336.9231                                                                                                   
#
# $KornevOysters
#          Jan     Feb     Mar     Apr     May     Jun     Jul     Aug     Sep     Oct     Nov     Dec
# 2017 137.125 137.125 137.125 137.125 137.125 137.125 137.125 137.125 137.125 137.125 137.125 137.125
# 2018 137.125 137.125 137.125 137.125   

In this case results are not very interesting as all the fitted models are ARIMA(0,0,0) - white noise.


As a side comment, note that the solution is equivalent to

lapply(listed_arima, function(x) fitted(x))

For the same reason you may also use

listed_arima <- lapply(listed_ts, auto.arima)
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!