-
Notifications
You must be signed in to change notification settings - Fork 4.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trend that saturates on only one end #307
Comments
Hi @bletham, I am interested in taking a shot at this, is it a Python or R fix? |
This is a little bit of everything - A new Stan model, and then the interfaces in both Python and R. This should be everything that needs to be done:
This can be done in parts. |
Hey all, do we have any update on this? |
Let's hold off on this until after #501, which will make it much easier and require much less code duplication. |
@BernierCR the latest Stan a few months ago (2.18) did add a standalone generated quantities functionality that we were planning to use for #501, but it has not yet been piped into rstan or pystan. That piping seems to be going slowly so we are right now looking into handling #501 without waiting for standalone generated quantities. We had tried this last summer and ran into some upstream bugs, hopefully it is successful this time. In the meantime, you can get that behavior by using the logistic trend but setting the bound on the side that you don't want a bound to just be a a larger number than your forecast ever reaches. |
@bletham I noticed that the forecast changes based on the upper bond, it seems to scale inversely, the higher the upper bond the smaller the forecast, is this the supposed behaviour? |
Could you post the plot so I can see what you mean? |
Any update on when this will be available? |
#865 is the PR that moves predictions to Stan. There are still some issues there but we're working through them, and once they're resolved this would be next. |
Ok, sounds good, thanks! :) Setting the upper bound to a very high relative value will work though, right? |
hello! just that check the current progress of prophet's feature of not need an upper bound for saturating floor. I currently face the issue of needing to only bound my forecast to 0 yet do not want to enforce an upper bound. not sure if setting an upper bound will actually alter the intended forecast (even if we set an arbitrary high bound) |
No progress, ran into some difficulty in #865 and trying to figure out a good workaround on the rstan side. |
Does anybody have an alternative solution for this meanwhile? because #307 not moving forward. |
I was targeting for this to happen after #501, which would have made it easier / more generic, but after the addition of the cmdstanpy backend I've decided to no longer pursue #501 so this should just be done directly. The new trend function can be added in the same way that the linear and logistic trends are. This is basically what needs to be done, in R and Py:
|
How does inputing an arbitrary large value on cap would affect the results? |
I think one of the main applications of this is data that has to be positive but isn't necessarily saturating at an upper limit. There's discussion of that setting in #1668 along with some strategies so I just wanted to point people to that issue in case anyone wants to try the approaches described there. I'm especially interested to hear if the |
Following up on my last comment: The documentation now provides examples of how to add custom trends in both R and Py (#1466, #1794, #1778). For now we are not going to add any new trend functions; there is a long tail of trends that one might be interested in, and we don't want to add that much complexity/weight to the package. So the PRs listed above will provide a guide for those who would like to try something totally custom, including a trend that saturates on only one end. I suspect the main source of interest in this issue is to produce forecasts that saturate at 0 and thus stay positive. There is discussion on that problem in #1668. A trend that saturates at 0 would not be sufficient by itself to produce positive forecasts, so I think that problem should be discussed separately from this. |
The logistic growth trend saturates at both lower and upper bounds. It would be useful to have a trend that saturates only on one end, e.g. that saturates at 0 but does not require specifying an upper bound.
This will require adding a new trend, adding to the linear and logistic growth trends that we already have. I think that the logistic loss function$log(1 + exp(k * (t - m)))$ should work very nicely.
If anyone is interested in making a PR for this we can discuss what is involved.
The text was updated successfully, but these errors were encountered: