Can I apply ARIMA(p, d, q) model to testing dataset and make forecast with the testing dataset? Just like the scenario of regression model? After I fit a sarima model with some historical sales data (for example A dataset), I get coefficients of sma1 and ar1. And I'd like to apply this model to current sales data (for example B dataset) and forecast future sales. That's where my concerns comes up, it seem like neither sarima.for() nor predict() or any other forecasting functions has the 'new.data' argument (I don't mean xreg, so ignore xreg here, I only mean the univariate series itself). Since for general regression models, we can store the coefficient and apply the model to future testing dataset. Does that mean we cannot store the coefficient from the ARIMA model and apply the model to other period of data? If time series works differently, what should I do if I want use the model I get? More specifically, when we say a time series model, do we only mean the p, d, q that we have get, how about the coefficient? Correct me if I'm wrong. Looking forward to any enlightenment! 
 A: For univariate time series forecasting, once you have fit a model and you want to predict new values, the only input to the model is the number of future time steps you want to perform predictions for. 
Keep in mind that in a real world business scenario (as opposed to testing the accuracy of the model) the future hasn't happened yet, so there are no inputs available to be fed to the model. 
For testing purposes, as I mentioned, the prediction function only takes the number of future steps as an argument. The test data set is used then for evaluation purposes, to be compared to the forecasts, not as an input to the model. 
For ARIMA and SARIMA models, the output of the model is fed back to the model recursively to generate future forecasts in the following matter: 
Suppose that our ARIMA model is a simple AR(1) model. Generate a forecast for one step ahead $\hat{y}_{t+1} = a*y_t$, then use that to generate a forecast for two steps ahead  $\hat{y}_{t+2} = a*\hat{y}_{t+1}$, etc...until you have $\hat{y}_{T}$ for your desired $T$ steps ahead. 
If your model is an AR(2) model. Generate a forecast for one step ahead $\hat{y}_{t+1} = a*y_t + b*y_{t-1}$, then use that to generate a forecast for two steps ahead  $\hat{y}_{t+2} = a*\hat{y}_{t+1} + b*y_t$,  $\hat{y}_{t+3} = a*\hat{y}_{t+2} + b*\hat{y}_{t+1} $, etc...until you have $\hat{y}_{T}$ for your desired $T$ steps ahead. 
