The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,High School,College,University,PHD
| Teaching Since: | May 2017 |
| Last Sign in: | 352 Weeks Ago, 4 Days Ago |
| Questions Answered: | 20103 |
| Tutorials Posted: | 20155 |
MBA, PHD
Phoniex
Jul-2007 - Jun-2012
Corportae Manager
ChevronTexaco Corporation
Feb-2009 - Nov-2016
r studio check the codes below.correct the error please
Â
#loading packages
require(tseries)
#setting a working dirctory
setwd("C:/Users/MBEO/Desktop")
data=read.csv("GDP_DATA.csv",header=T);data
GDP=data$VALUES;GDP
Year=data$YEAR;Year
plot(Year,GDP,type="l",main="Time series plot of GDP between 1960 to 2013",col="purple")
acf(GDP)
pacf(GDP)
#testing for stationarity
adf.test(GDP,alternative="stationary",k=10)
#Differencing
d_gdp=diff(GDP);d_gdp
year=1960:2012;year
plot(year,d_gdp,type="l",col="blue",main="Time series plot of differenced GDP between 1960 to 2013")
acf(d_gdp)
pacf(d_gdp)
adf.test(d_gdp,alternative="stationary",k=10)
#ftting ARIMA models
require(forecast)
model1=Ari(x, order=c(1,1,1),lambda=0)
summary(model1)Â
#Diagonistic checks
acf (residuals(best model))
pf (residuals(best model))
#testing for independence
Box.test(residuals(best_model),lag=10,type="Ljung")
#Forecasting
f1=forecast(bestmodel, h=5, level=c(95,99), fan=FALSE);f1Â
Hel-----------lo -----------Sir-----------/Ma-----------dam----------- T-----------han-----------k Y-----------ou -----------for----------- us-----------ing----------- ou-----------r w-----------ebs-----------ite----------- an-----------d a-----------cqu-----------isi-----------tio-----------n o-----------f m-----------y p-----------ost-----------ed -----------sol-----------uti-----------on.----------- Pl-----------eas-----------e p-----------ing----------- me----------- on----------- ch-----------at -----------I a-----------m o-----------nli-----------ne -----------or -----------inb-----------ox -----------me -----------a m-----------ess-----------age----------- I -----------wil-----------l