Univariate time series forecasts for short and long time series data using the appropriate model.

ts.forecast(ts_modelx, h=1, tojson=F)

Arguments

ts_modelx

The input univariate time series data

h

The number of prediction steps

tojson

If TRUE the results are returned in json format, default returns a list

Value

A list with the parameters:

  • ts.model a string indicating the arima orders

  • data_year The time that time series data were sampled

  • data The time series values

  • predict_time The time that defined by the prediction_steps parameter

  • predict_values The predicted values that defined by the prediction_steps parameter

  • up80: The upper limit of the 80% predicted confidence interval

  • low80: The lower limit of the 80% predicted confidence interval

  • up95: The upper limit of the 95% predicted confidence interval

  • low95: The lower limit of the 95% predicted confidence interval

Details

This function is used internally in ts.analysis and forecasts the model that fits the input data using the auto.arima function(see forecast package). The model selection depends on the results of some diagnostic tests (acf,pacf,pp adf and kpss). For short time series the selected arima model is among various orders of the AR part using the first differences and the first order moving average component, with the lower AIC value.

See also

ts.analysis, forecast

Examples

Athens_draft <- ts.non.seas.model(Athens_draft_ts) #Hold the model object of non seasonal modeling draft<-Athens_draft$model.summary ts.forecast(draft)
#> $ts.model #> [1] "ARIMA(1,1,1)" #> #> $data_year #> Time Series: #> Start = 2004 #> End = 2015 #> Frequency = 1 #> [1] 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 #> #> $data #> Time Series: #> Start = 2004 #> End = 2015 #> Frequency = 1 #> [1] 720895000 628937000 618550000 724830000 858942000 919508000 977488000 #> [8] 931607000 866517393 667108000 773422555 759559284 #> #> $predict_time #> Time Series: #> Start = 2016 #> End = 2016 #> Frequency = 1 #> [1] 2016 #> #> $predict_values #> Time Series: #> Start = 2016 #> End = 2016 #> Frequency = 1 #> [1] 757082035 #> #> $up80 #> Time Series: #> Start = 2016 #> End = 2016 #> Frequency = 1 #> 80% #> 891925346 #> #> $low80 #> Time Series: #> Start = 2016 #> End = 2016 #> Frequency = 1 #> 80% #> 622238724 #> #> $up95 #> Time Series: #> Start = 2016 #> End = 2016 #> Frequency = 1 #> 95% #> 963307083 #> #> $low95 #> Time Series: #> Start = 2016 #> End = 2016 #> Frequency = 1 #> 95% #> 550856987 #>