Closed seabbs closed 3 months ago
would have expected perhaps also to see an as_quantile.forecast_point (setting the 0.5 quantile to the point forecast)?
Given the original issue was just for as_point
I think this might be a new feature request.
My main points are the duplication of the as_quantile() function for sample-based forecasts and the changes to as_forecast() which I'm not sure I completely understand.
Hoopefully the responses cover the rational here and the proposed actions.
Once #813 has been implemented I can revisit this
Description
This PR closes #432. It adds basic s3 methods for
as_point
andas_quantile
to map from sample and quantile forecasts to quantile and point forecasts.It also adds an option to
as_forecast
to skip checks as these are a bit annoying and adds an internal functionremake_forecast
to reclass a forecast and then useassert_forecast
. Potentially we may want to expose the latter.Do we have an issue for refactoring
as_forecast.default
in a later release as the current monolithic approach will probably make user class extensions hard/annoying.@pearsonca this is a good example of having to reinvent the wheel quantile wise (i.e your epinowcast community post)
Note: Several of these implementations could be more efficient but I see this as putting the groundwork and I think improving them etc. are topics for their own issues.
Checklist
lintr::lint_package()
to check for style issues introduced by my changes.