Home Artificial Intelligence Hitting Time Forecasting: The Other Way for Time Series Probabilistic Forecasting Introducing Hitting Time Forecasting From Point-wise to Probabilistic Forecasting From Probabilistic to Hitting Time Forecasting Summary

Hitting Time Forecasting: The Other Way for Time Series Probabilistic Forecasting Introducing Hitting Time Forecasting From Point-wise to Probabilistic Forecasting From Probabilistic to Hitting Time Forecasting Summary

3
Hitting Time Forecasting: The Other Way for Time Series Probabilistic Forecasting
Introducing Hitting Time Forecasting
From Point-wise to Probabilistic Forecasting
From Probabilistic to Hitting Time Forecasting
Summary

How long does it take to achieve a particular value?

Photo by Mick Haupt on Unsplash

The flexibility to make accurate predictions is key for each time series forecasting application. Following this purpose, . That’s correct but is probably not all the time one of the best effective approach.

Data scientists must also consider the potential of developing probabilistic forecasting models. These models produce, along with point estimates, also upper and lower reliability bands during which future observations are more likely to fall in. Despite probabilistic forecasting seeming to be a prerogative of statistical or deep learning solutions, . The concept is explained in considered one of my previous posts where .

Needless to say some extent forecast is considerably easier to speak to non-technical stakeholders. At the identical time, the likelihood to generate KPIs on the reliability of our predictions is an added value. . Communicating that there’s a 60% probability of rain in the subsequent hours could also be more informative than reporting what number of millimeters of rain will fall.

On this post, . It reveals to be because it’s based on conformal prediction, since it has probabilistic interpretability, and with any forecasting technique.

is an idea commonly utilized in various fields. It , often within the context of reaching a particular threshold or level.

Simulated seasonality and trend [image by the author]
Simulated time series (seasonality + trend) with an example of hitting time level [image by the author]

Essentially the most known applications of hitting time discuss with fields like reliability evaluation and survival evaluation. It involves estimating the time it takes for a system or process to experience a particular event, comparable to a failure or reaching a specific state. In finance, hitting time is usually applied to find out which is the probability of a signal/index following a desired direction.

Overall, forecasting hitting time involves making predictions concerning the time it takes for a specific event, which follows temporal dynamics, to occur.

. As a primary step, we decide the specified forecasting algorithm. For this text, we adopt a straightforward recursive estimator easily available in scikit-learn style from .

Predicted vs real data points on test set [image by the author]
model = ForecastingCascade(
Ridge(),
lags=range(1,24*7+1),
use_exog=False,
)

. This is finished following a three-step approach and making use of the idea behind conformal prediction:

  • Forecasts are collected on the training set through cross-validation after which averaged together.
CV = TemporalSplit(n_splits=10, test_size=y_test.shape[0])

pred_val_matrix = np.full(
shape=(X_train.shape[0], CV.get_n_splits(X_train)),
fill_value=np.nan,
dtype=float,
)

for i, (id_train, id_val) in enumerate(CV.split(X_train)):

pred_val = model.fit(
X_train[id_train],
y_train[id_train]
).predict(X_train[id_val])

pred_val_matrix[id_val, i] = np.array(
pred_val, dtype=float
)

pred_val = np.nanmean(pred_val_matrix, axis=1)

  • Conformity scores are calculated on the training data as absolute residuals from cross-validated predictions and real values.
conformity_scores  = np.abs(
np.subtract(
y_train[~np.isnan(pred_val)],
pred_val[~np.isnan(pred_val)]
)
)
  • Future forecast distributions are obtained by adding conformity scores to check predictions.
pred_test = model.fit(
X_train,
y_train
).predict(X_test)

estimated_test_distributions = np.add(
pred_test[:, None], conformity_scores
)

Predicted distribution on test data [image by the author]

Following the procedure depicted above, we find yourself with a group of plausible trajectories that future values may follow. We have now all that we want to supply a probabilistic representation of our forecasts.

For every future time point, it’s recorded . This count is transformed right into a probability simply normalizing by the variety of values in each estimated test distribution.

Finally, a metamorphosis is applied to the array of probabilities to have a series of monotonic increasing probabilities.

THRESHOLD = 40

prob_test = np.mean(estimated_test_distributions > THRESHOLD, axis=1)

prob_test = pd.Series(prob_test).expanding(1).max()

Predicted vs real data points on test set plus hitting time probabilities [image by the author]

. The interpretation stays straightforward, i.e. for every forecasted time point we will derive the probability of our goal series reaching a predefined level.

On this post, we introduced a solution to provide probabilistic outcomes to our forecasting models. It doesn’t require the appliance of strange and intensive additional estimation techniques. Simply ranging from some extent forecasting problem, it’s possible so as to add a probabilistic overview of the duty by applying a hitting time approach.

3 COMMENTS

LEAVE A REPLY

Please enter your comment!
Please enter your name here