-
Notifications
You must be signed in to change notification settings - Fork 266
Add MAMean (MA(q)) model with volatility & forecasting support #778
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
base: main
Are you sure you want to change the base?
Conversation
Hi @bashtage Could you please approve the workflow so the tests can run? Happy to iterate if needed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The following CodeQL flags were raised and addressed:
Overwriting _name:
This override is intentional and consistent with models like ConstantMean, ZeroMean, and ARX, which also set _name explicitly for internal identification.
Unused variable index and debug prints:
index was unused and commented out. Debugging statements (e.g., print(...)) have been removed to clean up the production code.
Hi @bashtage, Could you please approve the workflow so that the tests can run? The currently failing tests don’t appear to be caused by this commit, but may instead be due to an environment issue. Also, a deprecation warning is being raised for the windows-2019 runner:
Let me know if I should update the runner image or make any further changes. Thanks! |
rescale=rescale, | ||
) | ||
|
||
self._name = "MA" # noqa: B024 # if you use flake8 or CodeQL config to ignore subclass overwrites |
Check warning
Code scanning / CodeQL
Overwriting attribute in super-class or sub-class Warning
ARCHModel
# def name(self): | ||
# return "MA" |
Check notice
Code scanning / CodeQL
Commented-out code Note
Approved. I think the runners need to be updated. Ubuntu should be ubuntu-latest |
Based on my analysis, the model performs as expected within the scoped
range and is ready to be merged.
That said, I’d welcome any further remarks or suggestions you may have.
Once this PR is finalized, I plan to extend the implementation to support
additional volatility models as well.
Thank you...
…On Thu, Jun 26, 2025 at 12:24 PM Kevin Sheppard ***@***.***> wrote:
*bashtage* left a comment (bashtage/arch#778)
<#778 (comment)>
Approved.
I think the runners need to be updated. Ubuntu should be ubuntu-latest
—
Reply to this email directly, view it on GitHub
<#778 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/A4YDYZPGNFDCTSL6LP2QGXL3FOKK7AVCNFSM6AAAAAB7MAY6I6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTAMBXGM3TKNBVGU>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
This PR introduces an implementation of the Moving Average (MA) mean model—
MAMean
—as a new subclass ofARCHModel
.It fills a longstanding gap in ARCH’s mean model suite, enabling direct modeling of MA(q) dynamics in return series.
Key Features
MAMean
, supporting flexible lag orderq
, with optional constant term.-API:
.fit()
,.simulate()
,.forecast()
,.resids
-Volatility support: Tested with
GARCH(1,1)
(others welcome)__init__.py
and__all__
🧪 Testing
MAMean
+GARCH(1,1)
:📝 Notes
GARCH(1,1)
and Future tests with EGARCH, APARCH is encouragedARX
/HARX
, making future extensions trivial