Joel Korpi Posted August 15 Share Posted August 15 Hello. I am trying to perform some forecasting for a signal, which only becomes active whenever it's derivative goes above a high threshold. I have built two OILS models based on the formula regressionModelOLS() for this. One model is linear and one is 2nd degree polynomial. I am now trying to validate that they work, so I've shifted forward my signal to the critical event where they would start to forecast, which is a re-occuring seasonal event happening one time per year. These models forecast over a horizon of one week, and the at the critical event it looks like this: I am very satisfied with this result, and it performs as I would like to with the fitting. The next thing I would like to do is to quantify the time from now until the warning capsules occur, which you see in the capsule tab at the bottom right. How do I calculate the time from now() until the “Poly warning” at 9 AM on Aug 18, or the “Linear warning” at 5 PM on Aug 19? This needs to be some dynamic type of measurement, as these conditions will move in time when the models become re-fitted as the data becomes updated. It's best if I could get this time difference in d:hh:mm format if possible, to precisely know how long left the forecasting predicts the warning levels to be breached. I've experiemented using the Timesince() function a little bit, but it doesn't give me any result at the moment. Some ideas/help would be greatly appreciated, thanks! Link to comment Share on other sites More sharing options...
Solution Thorsten Vogt Posted August 15 Solution Share Posted August 15 Hi Joel, you can try the following formula to create a capsule from now to the capsule in the future: condition(1d, capsule(now(), now()+1s)) .join($warning, 10d) - $warning Regards, Thorsten 1 Link to comment Share on other sites More sharing options...
Joel Korpi Posted August 15 Author Share Posted August 15 Thank you Thorsten, you are a magician! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now