首页 > 解决方案 > Power BI ARIMA 预测自定义视觉与脚本视觉

问题描述

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

我正在使用的数据只是一个量级的每月观察。

一方面,我使用了 MAQ 软件 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月季节性。

我接受任何想法或建议。

预先感谢。

标签: rpowerbipowerbi-desktoparima

解决方案


推荐阅读