Skip to content

BUG: Accept endog and instruments without exog in IV3SLS.multivariate_iv - #804

Merged
bashtage merged 2 commits into
mainfrom
lm71-fix-multivariate-iv-no-exog
Oct 13, 2026
Merged

bashtage merged 2 commits into
mainfrom
lm71-fix-multivariate-iv-no-exog

Conversation

@bashtage

Copy link
Copy Markdown
Owner

The documentation of IV3SLS.multivariate_iv requires at least one of exog and
endog, but exog was converted without the number of observations. With endog and
instruments and no exog, exog is None and IVData has no array to take the number
of observations from:

IV3SLS.multivariate_iv(dependent, endog=endog, instruments=instruments)
ValueError: nobs required when x is None

The number of observations of dependent is now given for exog, as it is for endog
and instruments. Specifications with exog are not changed.

test_multivariate_iv.py checks that the model with endog and instruments, with
arrays and with data frames, has the estimates of the 2SLS regression of each
dependent variable, which the 3SLS estimator reduces to when the equations have the
same regressors and instruments, that exog alone and all three work as before, and
the errors for a wrong number of observations.

The documentation of IV3SLS.multivariate_iv requires at least one of exog and
endog, but exog was converted without the number of observations. With endog and
instruments and no exog, exog is None and IVData has no array to take the number
of observations from:

    IV3SLS.multivariate_iv(dependent, endog=endog, instruments=instruments)
    ValueError: nobs required when x is None

The number of observations of dependent is now given for exog, as it is for endog
and instruments. Specifications with exog are not changed.

test_multivariate_iv.py checks that the model with endog and instruments, with
arrays and with data frames, has the estimates of the 2SLS regression of each
dependent variable, which the 3SLS estimator reduces to when the equations have the
same regressors and instruments, that exog alone and all three work as before, and
the errors for a wrong number of observations.
…iate_iv test

The call passes endog only, so the comment no longer mentions exog.
@codecov

codecov Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.62%. Comparing base (6bbe885) to head (5f233cd).
⚠️ Report is 12 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #804   +/-   ##
=======================================
  Coverage   99.61%   99.62%           
=======================================
  Files         139      140    +1     
  Lines       28008    28055   +47     
  Branches     1971     1973    +2     
=======================================
+ Hits        27901    27950   +49     
+ Misses         41       40    -1     
+ Partials       66       65    -1     
Flag Coverage Δ
adder 99.61% <100.00%> (+<0.01%) ⬆️
subtractor 99.61% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bashtage
bashtage merged commit fa5aee6 into main Oct 13, 2026
24 checks passed
@bashtage
bashtage deleted the lm71-fix-multivariate-iv-no-exog branch October 13, 2026 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.

1 participant