1
$\begingroup$

Question: I want to do a timeforecast for the next 30 days, but only the business days (weekends excluded). My dataset look likes:

data={{DateObject[{2020, 6, 15, 0, 0, 0.}], 541.92},{DateObject[{2020, 6, 16, 0, 0, 0.}], 560.01},{DateObject[{2020, 6, 17, 0, 0, 0.}], 566.48},{DateObject[{2020, 6, 18, 0, 0, 0.}], 562.61},{DateObject[{2020, 6, 19, 0, 0, 0.}], 567.83},{DateObject[{2020, 6, 22, 0, 0, 0.}], 565.07},{DateObject[{2020, 6, 23, 0, 0, 0.}], 574.19},{DateObject[{2020, 6, 24, 0, 0, 0.}], 557.33}, 
{DateObject[{2020, 6, 25, 0, 0, 0.}], 560.41},{DateObject[{2020, 6, 26, 0, 0, 0.}], 559.82},{DateObject[{2020, 6, 29, 0, 0, 0.}], 560.16},{DateObject[{2020, 6, 30, 0, 0, 0.}], 559.73},{DateObject[{2020, 7, 1, 0, 0, 0.}], 562.67}, {DateObject[{2020, 7, 2, 0, 0, 0.}], 570.75},{DateObject[{2020, 7, 3, 0, 0, 0.}], 568.63}, {DateObject[{2020, 7, 6, 0, 0, 0.}], 578.52},{DateObject[{2020, 7, 7, 0, 0, 0.}], 575.52},{DateObject[{2020, 7, 8, 0, 0, 0.}], 572.18},{DateObject[{2020, 7, 9, 0, 0, 0.}], 567.38},{DateObject[{2020, 7, 10, 0, 0, 0.}], 570.52},{DateObject[{2020, 7, 13, 0, 0, 0.}], 578.85},{DateObject[{2020, 7, 14, 0, 0, 0.}], 572.51},{DateObject[{2020, 7, 15, 0, 0, 0.}], 577.56},{DateObject[{2020, 7, 16, 0, 0, 0.}], 573.94},{DateObject[{2020, 7, 17, 0, 0, 0.}], 573.8},{DateObject[{2020, 7, 20, 0, 0, 0.}], 579.14},{DateObject[{2020, 7, 21, 0, 0, 0.}], 581.29},{DateObject[{2020, 7, 22, 0, 0, 0.}], 572.9}, 
{DateObject[{2020, 7, 23, 0, 0, 0.}], 576.67}, {DateObject[{2020, 7, 24, 0, 0, 0.}], 563.95}}

dataFit = 
 TimeSeriesModelFit[TimeSeries[TimeSeriesResample[data]], "ARIMA", 
  Method -> Automatic]

without 'TimeSeriesResample'it doesn't work.

When I want te forecast the next 30 days like

dataFC = TimeSeriesForecast[dataFit, {30}]

the result is a dataset and weekends are included.

Is there a method available that you can do forecast for only businessdays

$\endgroup$

1 Answer 1

2
$\begingroup$

Assuming there is no change expected over the weekends or holidays:

dataFC = Table[{
  DatePlus[Last[data][[1]], {n, "BusinessDay"}], 
  TimeSeriesForecast[dataFit, n]
}, {n, 1, 30}];
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.