Skip to content
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

Pyaf 5.0 Final Touch 7 : Improve the Guess of Window Length for Moving Average Trends #238

Closed
antoinecarme opened this issue Apr 2, 2023 · 2 comments

Comments

@antoinecarme
Copy link
Owner

antoinecarme commented Apr 2, 2023

Moving Average and Moving Median Trends are using windows of variable lengthds. These lengths are by default

self.mMovingAverageLengths = [5, 7, 12, 24 , 30, 60];

These lengths can be customized according to the time resolution detected in the dataset. A daily signal can have [5, 7, 30] windows (business week , week, month). An hourly signal can have [12, 24] (half-day, day) windows.

The user choice, of course, will override this setting.

This issue only impacts slow modeling processes. Will not have impact by default.

Model Trend Explainability improves.

@antoinecarme
Copy link
Owner Author

New settings by default

    def get_moving_window_lengths_for_time_resolution(self, iResolution):
        # self.mOptions.mMovingAverageLengths self.mOptions.mMovingMedianLengths 
        lWindows = {}
        lWindows[eTimeResolution.SECOND] = [60] # Minute
        lWindows[eTimeResolution.MINUTE] = [60] # Hour
        lWindows[eTimeResolution.HOUR] = [12, 24] # Half-Day, Day
        lWindows[eTimeResolution.DAY] = [5, 7, 30] # Business Week, Week, Month
        lWindows[eTimeResolution.MONTH] = [3, 6, 12] # 3, 6 and 12 months
        return lWindows.get(iResolution , [])

@antoinecarme
Copy link
Owner Author

FIXED.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant