Skip to main content

Linearly extrapolating the current trend of a tag to estimate what its value is going to be at some point in the future is the probably the simplest form of predictive analytics, but it can be very effective in some cases.

We can implement such a tag by taking the current value of the tag and adding the increase over the last x time. For example, if a tag currently has a value of 10, and the value 5 minutes ago was 8, then we would extrapolate that the value in 5 minutes will be 10 + (10-8) = 12. An obvious requirement is that the tag behaves somewhat linearly within the scope of our use case. Linear extrapolation will always be a simplification of your process. Of course, should you have a more custom formula can predict future values better you should implement that formula instead.

After creating the predictive tag we will typically want to monitor on those future values to receive early warnings. Some use cases I have seen solved this way include:

  • Monitor whether a tank will be empty in the next hour
  • Predict (and monitor) whether performance will drop below a threshold the coming week

Below is a simple example of a formula predicting the tank level in 4 minutes. Since the level cannot become negative, we set the lower threshold of the formula to 0.

Formula for estimated tank level in 4 minutes.

Note that we use the previous 4m to predict the next 4m. We could play with the shift and a multiply the rate by a certain factor to change what interval we use to estimate the rate and how long into the future we want to calculate our value. Suppose we would want to use the last 15m to predict the next 4m, the shift in our formula would become 15m, and the formula itself would become:
max(current + (4/15)*(current - previous), 0)

Keep in mind that the formula tag we create always plots the expected future value at the current time, as plotting values into the future does not work in TrendMiner.

Rather than the future value, you might also use a similar mechanism to create a time remaining formula tag. To use the rate of the last 4m of our level tag to plot the time remaining (in minutes) until our tank is completely empty, our formula would become something like:
if(current < previous, 4*current/(previous - current), -1)

In the formula above, rather than adding the rate, we divide by it. To normalize our shift of 4m to 1m, we multiply by 4. Finally, to avoid infinite or nonsense negative values, we set our formula tag to a default value of -1 whenever the level of the tank is not decreasing.

If you have any questions or remarks about this type of formulas, let me know in the comments!

Be the first to reply!

Reply