Forecasting with ARIMA: R Code

Step-1: ###R Packages Installed

library(fpp2)

library(readxl)

library(SPlit)

library(fpp2)

 

###Declare time-series data

###In this study I have file naming as HPI_AUS. All the date excel format.

HPI_AUS <-ts(AUSHPI[,2], start=c(2002,3), frequency=4)

 

Step-3: ###While forecasting, first that should be done within the sample, and if it is found valid, then only we forrecast out of sample.

###Split the given data into the training and test sets

split_HPI_AUS <- ts_split(ts.obj = HPI_AUS, sample.out= 8)

training <- split_AUSHPI$train

testing <- split_AUSHPI$test

length(training)

length(testing)


 Step-4:###Select the appropriate forecasting tool. Here I have used ARIMA (easy and quick model)

###ARIMA In-sample testing

arima_diag(training)

 

 

###Model forecasting In-sample

arima1 <- auto.arima(training, seasonal= TRUE)

autoplot(arima1)

check_res(arima1)

 

###Forecasting In-sample

fcast1<- forecast(arima1, h=8)

test_forecast(actual=HPI_AUS, forecast.obj = fcast1, test = testing)

accuracy(fcast1, testing)

 

###Auto ARIMA model Out of Sample

arima_diag(HPI_AUS)

fit_arima <- auto.arima(HPI_AUS, seasonal = TRUE )

autoplot(fit_arima)

check_res(fit_arima)

 

###Forecasting Out of Sample

fcast1 <- forecast(HPI_AUS, model = fit_arima, h=8)

plot_forecast(fcast1)

summary(fcast1)

 

###Do we have any option to validate the Forecasting Result?

Box.test(resid(fcast1), lag=1, type = "Ljung-Box")

Box.test(resid(fcast1), lag=5, type = "Ljung-Box")

Box.test(resid(fcast1), lag=10, type = "Ljung-Box")

Box.test(resid(fcast1), lag=15, type = "Ljung-Box")

Box.test(resid(fcast1), lag=20, type = "Ljung-Box")

Thank you

Inflation is a Hidden form of Tax in Nepal: A Granger Causality Test

Abstract 

Inflation is taken as a secret form of taxing people, thus in literature it is also known as an indirect form of tax. This has been tested by using the secondary data since 1975 to 2010 on government tax revenue (GTAX) and national consumer price index (NCPI) of Nepal. Initially, ADF test, then Granger Causality and finally OLS has been conducted. Granger Causality has suggested that NCPI causes GTAX which helped later to consider NCPI as an independent variable and GTAX as a dependent variable. After conducting OLS test it is found that NCPI impacts GTAX directly. 

Key Words: Inflation, Tax, Granger Causality and OLS. 

Click here for this article.

Four Growth Theories

Keynesian Economics