Repository navigation
BUG: Let set_smooth_method set the smooth_univariate flag - #11052
Merged
bashtage merged 2 commits intoNov 24, 2026
Merged
Conversation
4 of 5 tasks
KalmanSmoother.set_smooth_method(**kwargs) sets the boolean flags named in KalmanSmoother.smooth_methods, which listed smooth_conventional, smooth_alternative and smooth_classical but not smooth_univariate, although SMOOTH_UNIVARIATE is documented in its Notes and the smooth_univariate attribute exists. set_smooth_method(smooth_univariate= True) therefore did nothing, and smooth_univariate=True as a constructor argument (of KalmanSmoother, or of a model such as SARIMAX) raised "TypeError: Unknown keyword arguments: ['smooth_univariate']". Changes - smooth_univariate is added to KalmanSmoother.smooth_methods, so set_smooth_method and the constructors accept it like the other smoothing flags. - The univariate smoother needs the univariate filter (smoothing raises "Invalid smoothing method" otherwise, as it does when the smooth_univariate attribute is set). Without univariate filtering, set_smooth_method(smooth_univariate=True) ran on main and smoothed with the default method, so it still ignores the flag there, now with a FutureWarning that the flag will be set (and smoothing will raise) after statsmodels 0.17 is released. - The set_smooth_method docstring has a versionchanged note. Not changed - Results: with univariate filtering, univariate smoothing is already the default, so setting the flag gives the same output. - The other smoothing flags, the default smoothing method, and setting the smooth_univariate attribute directly. Tests (appended to test_options.py) - set_smooth_method(smooth_univariate=True), and the constructor argument, set the same bitmask as setting the attribute with univariate filtering, and False clears it; with the flag set, smoothing gives the output of the default smoothing method. - Without univariate filtering, both warn, leave the flag unset and smoothing gives main's output; the attribute still makes smoothing raise; False and the other flags do not warn.
bashtage
force-pushed
the
wip-ss-smooth-univariate-method
branch
from
November 24, 2026 11:48
6fccf0a to
4c4106a
Compare
bashtage
marked this pull request as ready for review
November 24, 2026 23:23
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Based on main. Conflicts with #11036 (filter option flags) only in
test_options.py, where both append: keep both blocks and both imports.KalmanSmoother.set_smooth_method(**kwargs) sets the boolean flags named in
KalmanSmoother.smooth_methods, which listed smooth_conventional,
smooth_alternative and smooth_classical but not smooth_univariate,
although SMOOTH_UNIVARIATE is documented in its Notes and the
smooth_univariate attribute exists. set_smooth_method(smooth_univariate=
True) therefore did nothing, and smooth_univariate=True as a constructor
argument (of KalmanSmoother, or of a model such as SARIMAX) raised
"TypeError: Unknown keyword arguments: ['smooth_univariate']".
Changes
set_smooth_method and the constructors accept it like the other
smoothing flags.
"Invalid smoothing method" otherwise, as it does when the
smooth_univariate attribute is set). Without univariate filtering,
set_smooth_method(smooth_univariate=True) ran on main and smoothed with
the default method, so it still ignores the flag there, now with a
FutureWarning that the flag will be set (and smoothing will raise) after
statsmodels 0.17 is released.
Not changed
default, so setting the flag gives the same output.
smooth_univariate attribute directly.
Tests (appended to test_options.py)
set_smooth_method(smooth_univariate=True), and the constructor argument,
set the same bitmask as setting the attribute with univariate filtering,
and False clears it; with the flag set, smoothing gives the output of
the default smoothing method.
Without univariate filtering, both warn, leave the flag unset and
smoothing gives main's output; the attribute still makes smoothing
raise; False and the other flags do not warn.
tests added / passed.
code/documentation is well formatted.
properly formatted commit message. See
NumPy's guide.
AI Disclosure
Contributions must comply with the statsmodels AI Policy.
Tick exactly one of the following. If AI tools were used, replace the
<...>placeholders in the second option with the tool name(s) and how the tool's output was
used.
Tool(s): Claude Code (Claude Opus 5.5).
Used for: finding the bug in a contract audit, writing the fix and its tests, and checking them (tests failing on main, mutation check).
I have personally read, understood, and can explain every line of this diff, and
have verified the statistical/numerical correctness of the change.
🤖 Generated with Claude Code