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

reestimation frequency historic vol #595

Merged
merged 20 commits into from
Feb 21, 2023

Conversation

Magnus167
Copy link
Member

@Magnus167 Magnus167 commented Nov 14, 2022

This branch changes how the historic volatility function runs.
Till now, the historic volatility was being calculated on every date in the input dataframe. This is now changed, to allow for a specific frequency (w, m, q, y) of dates when the hist. vol. is being calculated. The lookback period remains unaffected, still calculated in days; with the only change coming to the actual dates for which the calculation is done.

@Magnus167 Magnus167 linked an issue Nov 14, 2022 that may be closed by this pull request
@Magnus167 Magnus167 requested review from Ksteeds and rsueppel and removed request for Ksteeds November 14, 2022 20:18
@Magnus167
Copy link
Member Author

In case of a daily reestimation freq., the program still uses pandas.DataFrame.rolling. However, in case of a monthly/weekly/quarterly reestimation freq., python loop is used to drive the calculation. There should be a way to use indexed addressing for the latter; which will dramatically increase execution speed (and readability).

@codecov-commenter
Copy link

codecov-commenter commented Feb 14, 2023

Codecov Report

Base: 59.23% // Head: 59.47% // Increases project coverage by +0.24% 🎉

Coverage data is based on head (d548ed4) compared to base (e76dd01).
Patch coverage: 56.70% of modified lines in pull request are covered.

❗ Current head d548ed4 differs from pull request most recent head 3fb4e0e. Consider uploading reports for the commit 3fb4e0e to get more accurate results

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #595      +/-   ##
===========================================
+ Coverage    59.23%   59.47%   +0.24%     
===========================================
  Files           29       29              
  Lines         3049     3119      +70     
===========================================
+ Hits          1806     1855      +49     
- Misses        1243     1264      +21     
Impacted Files Coverage Δ
macrosynergy/download/dataquery.py 32.87% <0.00%> (+0.11%) ⬆️
macrosynergy/panel/view_timelines.py 10.95% <0.00%> (-2.84%) ⬇️
macrosynergy/pnl/naive_pnl.py 55.21% <0.00%> (-0.87%) ⬇️
macrosynergy/panel/historic_vol.py 95.45% <93.22%> (+0.85%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@rsueppel rsueppel merged commit aefb325 into develop Feb 21, 2023
@Magnus167 Magnus167 deleted the feature/reestimation_frequency_historic_vol_589 branch February 28, 2023 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add re-estimation frequency to historic_vol()
3 participants