View source: R/FcBayesianStructuralTimeSeries.R
FcBayesianStructuralTimeSeries | R Documentation |
Forecasting with Bayesian Structural Time Series
FcBayesianStructuralTimeSeries(DataVec, SplitAt, Time, Frequency = "months", ForecastHorizon, nseasons = 12, niter = 250, burn = 100, PlotIt=FALSE)
DataVec |
[1:n] numerical vector of time series data. |
SplitAt |
Index of row where the DataVec is divided into test and train data. If not given n is used |
Time |
[1:n] character vector of Time in the length of data |
Frequency |
Either |
nseasons |
Optional, number of seasons. See |
niter |
Optional, number of Iterations. See |
burn |
Optional, Number of MCMC iterations to be discarded as burn-in. See |
PlotIt |
FALSE (default), do nothing. TRUE: plots the forecast versus test data of time series data. |
Wrapper for functions of the bsts package.
List with
Forecast |
[1:ForecastHorizon] forecasted values |
ForecastTime |
[1:ForecastHorizon] Time values of forecasts |
UpperLower |
[1:2,1:ForecastHorizon] matrix of upper and lower bounds of the credible interval for the prediction, see |
ModelPrediction |
Object of class predict of bsts package, see |
Model |
Model object of class bsts, see |
doku to be written...
Michael Thrun
[Scott/Varian, 2014] Scott, S. L., & Varian, H. R.: Predicting the present with bayesian structural time series, International Journal of Mathematical Modelling and Numerical Optimisation, Vol. 5(1-2), pp. 4-23. 2014.
bsts
data("AirPassengers")
AirPassengers=TSAT::ConvertTS2DF(AirPassengers)
ff=FcBayesianStructuralTimeSeries(log(AirPassengers$Data),AirPassengers$Time,SplitDataAt=144-12,PlotIt=TRUE)
##New Data
data("AirPassengers")
AirPassengers=TSAT::ConvertTS2DF(AirPassengers)
ff=FcBayesianStructuralTimeSeries(log(AirPassengers$Data),AirPassengers$Time,SplitDataAt=144,PlotIt=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.