Power BI ARIMA 预测自定义视觉与脚本视觉

时间:2021-07-28 21:26:05

标签: r powerbi powerbi-desktop arima

我决定使用 R 和 Power BI 工具来帮助我建立预测模型,而不是反驳我多年的计量经济学笔记。

我正在使用的 Data 只是一个数量级的月度观测。

一方面,我使用了 MAQ Software ARIMA 预测视觉。但是,我还必须获取 p、q、d 参数,这就是为什么我还编写了一个 R 脚本视觉对象来获取模型(我可以在 RStudio 中看到)和作为网格的预测; BI 网格视觉和 Rstudio 网格打印都给出了相同的结果。

R 模型查看

library(gridExtra)
library(quantmod)
library(forecast)
library(openxlsx)
library(tseries)
library(zoo)

Total_Mensual <- read.csv(" ", row.names=NULL)                             #wherever you download the file

dataset <- aggregate(ï..Total ~ Fecha, data = Total_Mensual, FUN = sum)    # for some reason the header becomes all weird, change it if you must. By the way, Fecha is spanish for Date

calendario <- head(dataset, -1)                                            # the data is updated daily, so I try to ignore the current month. I the pbix file, I filter the data so that its only for the last CALENDAR MONTHS
calendario

Values <- ts(calendario$ï..Total, start = c(2017, 5), frequency = 12)
Values                                                                     # the dataframes are shown right after they are created, so use RStudio to check the consistency

modelo <- auto.arima(Values, seasonal = TRUE)
summary(modelo)

Prediction <- forecast(modelo, h = 12)

Prediction <- data.frame(coredata(Prediction))

grid.table(Prediction)

问题是使用 auto.arima 和预测函数得出的预测结果与 MAQ 软件视觉所接受的预测相差太大,其中我输入了 auto.arima 给出的参数 (1, 0, 0),包括 12 个月的季节性。

我接受任何想法或建议。

先谢谢了。

0 个答案:

没有答案