Fitting an arimax model on out of sample dataset
the arima function from the stats library does not take an argument called model, which is why you are receiving an error. Here is the function signature:

arima(x, order = c(0L, 0L, 0L),
      seasonal = list(order = c(0L, 0L, 0L), period = NA),
      xreg = NULL, include.mean = TRUE,
      transform.pars = TRUE,
      fixed = NULL, init = NULL,
      method = c("CSS-ML", "ML", "CSS"), n.cond,
      SSinit = c("Gardner1980", "Rossignol2011"),
      optim.method = "BFGS",
      optim.control = list(), kappa = 1e6)


The returned object, does contain the model. Read the related documentation for more details.



I think your workflow is perhaps a little confused. You fit a model first on 20 data points, which is fine (more data would be nice!). You make some forecasts and plot it, which is also good - you can see if the model learned much and if there is perhaps some systematic error, e.g. simply predicting the previous time-step and not a more intelligent trend.

The final step, however, should be to once again make predictions on your hold-out data; the last 4 data points. You should not fit another model to the hold-out data! Just predict what you model would say for that data, which it has never before seen.

The reason we work like this, is so we can assess the model's performance independently from the data that was used to train it. We want to know what will happen in the future, when you get your 25th datapoint.



Have a look at this nice tutorial, which explains the mains concepts of ARIMA and has a working example. Here is a very similar tutorial, but it is a video.