Skip to content

BUG: Show each measurement variance in its own equation table of VARMAX - #11085

Draft
bashtage wants to merge 2 commits into
statsmodels:mainfrom
bashtage:wip-varmax-summary-measurement-error
Draft

bashtage wants to merge 2 commits into
statsmodels:mainfrom
bashtage:wip-varmax-summary-measurement-error

Conversation

@bashtage

@bashtage bashtage commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

#11083, which this PR was stacked on, is merged. No conflict with #10940 or the other C12 follow-up PRs.

BUG: Show each measurement variance in its own equation table of VARMAX

The summary of a VARMAX model with measurement_error=True puts the
measurement variance of each equation in the table "Results for equation
". The index of the parameter counted from the end of the parameter
vector in reverse order, so for k_endog >= 2 each table showed the variance
of another equation: with measurement variances 0.11 (y1) and 0.22 (y2),
the table of y1 showed 0.22 and the table of y2 showed 0.11. With three
series, the tables of the first and the last equation were swapped.

Changes

  • The table of equation i shows measurement_variance., the
    parameter at k_params - k_endog + i (the measurement variances are the
    last k_endog parameters, in the order of the equations).

Not changed

  • The parameters, the likelihood and every other row of the summary. The
    row is still labelled measurement_variance, and the "Other parameters"
    table is unchanged (the same parameters are shown in the equation
    tables).

Tests

  • For two and three series with different measurement variances (exact at
    the four decimals of the table), each equation table shows
    measurement_variance. from params. Fails on main for both.

  • TestVAR_measurement_error.test_summary compared each table with the
    parameter at the reversed index; its measurement variances are all zero,
    so it passed either way. It uses the index of the equation now.

  • 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.

  • No AI tools were used to develop this pull request.
  • AI tools were used.
    Tool(s): Claude Code (Claude Opus 5.5).
    Used for: finding the bug in a coverage audit of the state space models, 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

The summary of a VARMAX model with measurement_error=True puts the
measurement variance of each equation in the table "Results for equation
<name>". The index of the parameter counted from the end of the parameter
vector in reverse order, so for k_endog >= 2 each table showed the variance
of another equation: with measurement variances 0.11 (y1) and 0.22 (y2),
the table of y1 showed 0.22 and the table of y2 showed 0.11. With three
series, the tables of the first and the last equation were swapped.

Changes
- The table of equation i shows measurement_variance.<name of i>, the
  parameter at k_params - k_endog + i (the measurement variances are the
  last k_endog parameters, in the order of the equations).

Not changed
- The parameters, the likelihood and every other row of the summary. The
  row is still labelled measurement_variance, and the "Other parameters"
  table is unchanged (the same parameters are shown in the equation
  tables).

Tests
- For two and three series with different measurement variances (exact at
  the four decimals of the table), each equation table shows
  measurement_variance.<name> from params. Fails on main for both.
- TestVAR_measurement_error.test_summary compared each table with the
  parameter at the reversed index; its measurement variances are all zero,
  so it passed either way. It uses the index of the equation now.
@bashtage
bashtage force-pushed the wip-varmax-summary-measurement-error branch from 2b4e64c to 68a7deb Compare November 28, 2026 22:06
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.

1 participant