简体   繁体   English

R建模中的ARIMA?

[英]ARIMA in R modeling?

So im quite new to R, and I need some help!所以我对 R 很陌生,我需要一些帮助!

This is what I've done so far这是我到目前为止所做的

library("readxl")

my_data <- read_excel(file.choose())

View(my_data)

library(ggplot2)

theme_set(theme_light())

ggplot(my_data, aes(x=DATES)) +
geom_line(aes(y=GDPBD))

ggplot(my_data, aes(x=DATES)) + 
geom_line(aes(y=GDPBD), color = "#00AFBB") +
labs(y="GDP", x="Year")

Basically I'm trying to predict GDP for the upcoming 5 years.基本上,我试图预测未来 5 年的 GDP。

Since i don't know the exact ARIMA (p,d,q) model, i wanted to try the auto.arima function.由于我不知道确切的 ARIMA (p,d,q) 模型,我想尝试 auto.arima 函数。

Yet it says:然而它说:

Error in auto.arima(my_data) : auto.arima can only handle univariate time series. auto.arima(my_data) 错误:auto.arima 只能处理单变量时间序列。

Dates are already yearly.日期已经是每年。

Can you help me?你能帮助我吗?

Also, do you have other methods that allow me to find d in (p,d,q) using the lags?另外,您是否有其他方法可以让我使用滞后在 (p,d,q) 中找到 d? i dont know when to stop just by looking at the graphs.我不知道什么时候停止只看图表。

EDIT: i know that the process is not stationary编辑:我知道这个过程不是静止的

Your help is much appreciated!非常感谢您的帮助!

Thank you !谢谢 !

convert your data into ts object, like below example将您的数据转换为 ts 对象,如下例所示

 my_data = ts(my_data)
 forecast = auto.arima(mydata)

Hope answer to your question.希望回答你的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM