
Re: QlikSense  R with Arima Prediction
Boopesh Jayabalaji May 25, 2016 4:40 AM (in response to Ashvin Ramiah)Hi Ashvin,
I went through your dataset. May i understand at what level you would want to predict the data.
Thanks
Boopesh

Re: QlikSense  R with Arima Prediction
Ashvin Ramiah May 25, 2016 4:49 AM (in response to Boopesh Jayabalaji)For instance the last period was : 200606
And what is required is to predict till 200706.
I have managed to use grouping to get the Period per month.
> csvdata < read.csv("MonthlyPassengerData_200507_to_201509.csv", header = TRUE)
> xPeriod < csvdata[1]
> yPax < csvdata["Passenger.Count"]
> df = data.frame(xPeriod,yPax);
// use library(data.table)
dfSummarize < aggregate(Passenger.Count ~ Activity.Period, df, sum)
Activity.Period total
(int) (int)
1 200507 3225769
2 200508 3195866
3 200509 2740553
4 200510 2770715
5 200511 2617333
etc etc

Convert date from YYYYMM to YYYYMMDD
// where initialy dfSummarize[[1]] has a list of date in YYYYMM
dfSummarize[[1]] < as.Date(paste(dfSummarize[[1]],"01", sep = ""), format = "%Y%m%d")
So from here... i need to get next 12 months data...

Re: QlikSense  R with Arima Prediction
Ashvin Ramiah May 25, 2016 6:10 AM (in response to Ashvin Ramiah)Ok guy, i gat it working.
// This is going to generate all the difference between the present and past row of data.
// Remember to send the DAta Measure into that. NEVER THE DATE.
// lag = 1 :: diference between 2 rows immediate
// lag = 1 :: difference bewen Two 2 rows... behind.
dif1 = diff(dfSummarize[[2]] , lag = 1 )
// When plot of you will know whether it is stationary or not.
plot(dif1)
// UNTIL you get a staiotnay plot... u need to keep on Differentioating...
// remember... you need to Diff the diff ...
// Check these tw0 ONLY WHEN YOU HAEV A STATIONARY SERIES.. u can use these fucntion.
// numbe rof AR terms
pacf(dif1) // from this chart >> locate the PEEK. The highest. VALUE ABOVE THE BLUE LINE. Max line out of the RANGE ( Blue dotted lines)
// numbe rof MA terms
acf(dif1) // from this chart >> locate the PEEK. The highest.
// calculate the Fit
c(6,1,6) = 1 here is the number of Diff we have made. No of times we have differentiate to be stationary.
fit < arima(x = dfSummarize[[2]] , order = c(6,1,6) )
fit < arima(x = dfSummarize[[2]] , order = c(6,1,6) )
fit < arima(x = dfSummarize[[2]] , order = c(12,1,12))
fit < arima(x = dfSummarize[[2]] , order = c(6,1,6) )
// WHY DONT U reduce the amount of data loaded and then when predict, do the prediction for KNOWN values.
// u will know whether the model is best fit.
// VALIDATION of Forecast data.
// Finally forcast .... H = 12.. depends on what you want to predict.. periods... how many values.
pForecast < forecast(fit, h = 12)



Re: QlikSense  R with Arima Prediction
Sangram Reddy May 25, 2016 6:26 AM (in response to Ashvin Ramiah)Hi Ashvin,
This link here will give you more information on how to implement ARIMA.
https://www.otexts.org/fpp/8/7
Also, once done with your predictive model , you can plot the data in Qliksense in a line chart as I have done in my project (I made use of random forest time series forecasting).
You can color the line chart the way you need. Please check the image below: the red and the yellow lines are the confidence bands.
!
 Sample.qvfSample.qvf192.0 K