Time series plot of differenced GDP between 1960 to 2013, math homework help
r studio check the codes below.correct the error please
Get Your Custom Essay Written From Scratch
We have worked on a similar problem. If you need help click order now button and submit your assignment instructions.


Just from $13/Page
#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
Needs help with similar assignment?
We are available 24x7 to deliver the best services and assignment ready within 3-4 hours? Order a custom-written, plagiarism-free paper

