arimapred {TSPred} | R Documentation |
Automatic ARIMA fitting and prediction
Description
The function predicts and returns the next n consecutive values of a time
series using an automatically fitted ARIMA model. It may also plot the
predicted values against the actual ones using the function
plotarimapred
.
Usage
arimapred(
timeseries,
timeseries.cont = NULL,
n.ahead = NULL,
na.action = stats::na.omit,
xreg = NULL,
newxreg = NULL,
se.fit = FALSE,
plot = FALSE,
range.p = 0.2,
ylab = NULL,
xlab = NULL,
main = NULL
)
Arguments
timeseries |
A vector or univariate time series which contains the values used for fitting an ARIMA model. |
timeseries.cont |
A vector or univariate time series containing a
continuation for |
n.ahead |
Number of consecutive values of the time series, which are to
be predicted. If |
na.action |
A function for treating missing values in |
xreg |
A vector, matrix, data frame or times series of external
regressors used for fitting the ARIMA model. It must have the same number
of rows as |
newxreg |
A vector, matrix, data frame or times series with new values
of |
se.fit |
If |
plot |
If |
range.p |
A percentage which defines how much the range of the graphic's y-axis will be increased from the minimum limits imposed by data. |
ylab |
A title for the graphic's y-axis. Ignored if |
xlab |
A title for the graphic's x-axis. Ignored if |
main |
An overall title for the graphic. Ignored if |
Details
The ARIMA model used for time series prediction is automatically fitted by
the auto.arima
function in the forecast
package. In
order to avoid drift errors, the function introduces an auxiliary regressor
whose values are a sequence of consecutive integer numbers starting from 1.
The fitted ARIMA model is used for prediction by the
predict.Arima
function in the stats
package. For more
details, see the auto.arima
function in the forecast
package and the predict.Arima
function in the stats package.
Value
A time series of predictions, or if se.fit
is TRUE
, a
list with the components pred
, the predictions, and se
, the
estimated standard errors. Both components are time series. See the
predict.Arima
function in the stats package.
Author(s)
Rebecca Pontes Salles
References
R.J. Hyndman and G. Athanasopoulos, 2013, Forecasting: principles and practice. OTexts.
R.H. Shumway and D.S. Stoffer, 2010, Time Series Analysis and Its Applications: With R Examples. 3rd ed. 2011 edition ed. New York, Springer.
See Also
auto.arima
, predict.Arima
,
plotarimapred
, marimapred
Examples
data(SantaFe.A,SantaFe.A.cont)
arimapred(SantaFe.A[,1],SantaFe.A.cont[,1])
arimapred(SantaFe.A[,1],n.ahead=100)