Time Series Forecasting

What-if Analysis Reports use the Reporting Line Forecast Values that are generated using the ARIMA Algorithm in the R code seeded with the Application. R has a base package called stats which provides the function called ARIMA (). This function enables the usage of the ARIMA Technique for Time Series Forecasting.

Projected Data is generated through Statistical Modeling. ARIMA/ARIMAX Modeling is used to create the projected data for up to five years. Historical Data for the last two years is used for creating the projections. The projections are made at an Account level. When making the projections for Accounts based on the life of the Accounts following rules need to be followed:

  • 1 to 12 MOB – Use Segment Information of the Account to create projections.
  • More than 12 MOB – The projections should be solely based on Historical Data of the Account.

Guidelines:

Following are the guidelines associated with the execution R code:

  • Data should be generated for at least one group for more than 12 continuous MIS Dates. 12 is the parameter n. Consider where we are setting how many records is significant to be considered for prediction.
  • The assumption is that the data is chronological for consecutive End-of-Month dates. By default, the prediction is done for 60 months starting with the immediate month after the last available MIS Date.
  • If the data provided is not for the chronological End-of-Month dates, the results generated will not be accurate.
  • ARIMA is a statistical technique used for Time-Series Predictions. It accepts a host of parameters of which the basic parameters are p, q, and d. p is the order of Autoregressive Process, q is the parameter for the Moving Average Process, and d is the number of differences after which the data can be considered stationary with the desired confidence level. It has more parameters that can be customized.

    Detailed documentation of the technique can be found at:

    Documentation of implementation of ARIMA in R can be found at:

  • Logging for the individual groups' ARIMA Model summaries happens in a file named "out.log". This log file is generated in the $FIC_DB_HOME/bin folder. If a particular group has unstable data and prediction fails, the corresponding error is also documented in the out.log file against that particular group.

Files Used:

Two files are required for R script execution. Both the files are present at the $FIC_DB_HOME/bin folder and need to execute permissions. Following are the files used:

  • RExec executable
  • ARIMA_AVF.r

Common Errors:

Following are the errors:

  • Subscript out of bounds usually means that sufficient data has not gone in. The model is trying to apply an algorithm on a dataset that is returning a null chunk.
  • Error: Error in if ((lv > nr) || (lv == 0L && nr > 0L) || (nr%%lv != 0L)) stop(gettextf("replacement data has %s rows, data has %s",:
    • Missing value where TRUE/FALSE is needed.
    • Means and if a condition is receiving null and is unable to evaluate true or false.