This commit is contained in:
2022-11-24 17:23:28 +09:00
parent b3635d65c6
commit 4725b93b1e
3 changed files with 369 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
install.packages("WDI")
library(WDI)
gdp = WDI(country = "KR", indicator = c("NY.GDP.PCAP.CD", "NY.GDP.MKTP.CD"), start = 1960, end = 2017)
head(gdp)
names(gdp) = c("country", "iso2c", "iso3c", "year", "perCapGDP", "GDP")
head(gdp)
kr = gdp$perCapGDP[gdp$country=="Korea, Rep."]
kr
kr = ts(kr, start=min(gdp$year), end=max(gdp$year))
kr
install.packages("forecast")
library(forecast)
krts = auto.arima(x=kr)
krts
forecastResult = forecast(object=krts, h=5)
forecastResult
plot(forecastResult)