1

I am using arfima function (arfima package 1.6-8 version) for forecasting the future requests workload on the server. I split my dataset into training and test datasets. I trained my model on training dataset for forecasting future requests values. Now, i want to fit this model on test dataset. I didn't find any method for this purpose in the arfima package document. I request you to provides information about how can i fit the trainted model on test data set.

Thanking You

1 Answers1

2

For models like ARIMA and ARFIMA, you don't fit a model to test data. You fit a model to the training (i.e. past) data, then you use the resulting model to generate forecasts into the future. This is called recursive forecasting. Then you evaluate the forecasts against your test data using various accuracy metrics.

In the arfima package, forecasting is performed using using the predict function:

fit <- arfima(data, order = c(0, 1, 1), back=T)
pred <- predict(fit, n.ahead = 5)
Skander H.
  • 10,602
  • 2
  • 33
  • 81
  • 1
    Thanks, how could we save the fitted model parameters for forecasting in a dynamic environment? – Satish Kumar Oct 16 '18 at 13:37
  • 1
    @SatishKumar you could save the parameters (they are all stored as R variables) however in a dynamic environment, you are likely going to want to refit your model everytime, since the best fitting model will change depending on the new data coming in. See [here](https://towardsdatascience.com/3-facts-about-time-series-forecasting-that-surprise-experienced-machine-learning-practitioners-69c18ee89387) – Skander H. Oct 16 '18 at 22:56