Time-series-plot-of-differenced-GDP-between-1960-to-2013-math-homework-help

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

 
Do you need a similar assignment done for you from scratch? We have qualified writers to help you. We assure you an A+ quality paper that is free from plagiarism. Order now for an Amazing Discount!
Use Discount Code "Newclient" for a 15% Discount!

NB: We do not resell papers. Upon ordering, we do an original paper exclusively for you.