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

Updating to version 1.6.0 #145

Merged
merged 5 commits into from
Aug 13, 2024
Merged

Updating to version 1.6.0 #145

merged 5 commits into from
Aug 13, 2024

Conversation

pedrovma
Copy link
Member

@pedrovma pedrovma commented Aug 12, 2024

The changes in this new version are:

  • Pandas objects (Series or DF) can now be passed as regression variables (y, x, yend, q, regimes), suppressing the need to explicitly provide their respective names in these cases. The names are automatically collected from the pandas objects. This applies to all regression functions.

  • Implementation of Flexible WX. Through a list of Booleans in argument slx_vars, the user can now select which x variables are to be lagged. This new feature applies to OLS, TSLS, ML and GM spatial models (both lag and error).

  • Kernel weights are now allowed in SLX and SDM models.

  • Added Durbin-Wu-Hausman test on endogeneity of variables to TSLS.

  • Spatial impacts are now computed for regression models with regimes.

  • Added VIF method to OLS results.

  • Added compatibility with libpysal.Graph.

The changes in this new version are:

-	Pandas objects (Series or DF) can now be passed as regression variables (y, x, yend, q, regimes), suppressing the need to explicitly provide their respective names in these cases. The names are automatically collected from the pandas objects. This applies to all regression functions.

-	Implementation of `Flexible WX`. Through a list of Booleans in argument `slx_vars`, the user can now select which x variables are to be lagged. This new feature applies to OLS, TSLS, ML and GM spatial models (both lag and error).

-	Kernel weights are now allowed in SLX and SDM models.

-	Added Durbin-Wu-Hausman test on endogeneity of variables to TSLS.

-	Spatial impacts are now computed for regression models with regimes.

-	Added VIF method to OLS results.
Copy link

codecov bot commented Aug 12, 2024

Codecov Report

Attention: Patch coverage is 58.57988% with 210 lines in your changes missing coverage. Please review.

Project coverage is 67.6%. Comparing base (326100f) to head (ab7353f).

Files Patch % Lines
spreg/user_output.py 60.5% 19 Missing and 11 partials ⚠️
spreg/error_sp.py 46.2% 25 Missing and 3 partials ⚠️
spreg/error_sp_het.py 34.1% 23 Missing and 4 partials ⚠️
spreg/error_sp_hom.py 35.7% 23 Missing and 4 partials ⚠️
spreg/sputils.py 46.9% 16 Missing and 1 partial ⚠️
spreg/panel_utils.py 6.7% 12 Missing and 2 partials ⚠️
spreg/output.py 75.0% 10 Missing and 2 partials ⚠️
spreg/twosls_sp.py 58.6% 9 Missing and 3 partials ⚠️
spreg/ml_lag.py 47.1% 7 Missing and 2 partials ⚠️
spreg/probit.py 53.3% 4 Missing and 3 partials ⚠️
... and 9 more
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##            main    #145     +/-   ##
=======================================
+ Coverage   67.5%   67.6%   +0.1%     
=======================================
  Files         41      41             
  Lines       9365    9626    +261     
  Branches    1370    1433     +63     
=======================================
+ Hits        6320    6508    +188     
- Misses      2651    2704     +53     
- Partials     394     414     +20     
Files Coverage Δ
spreg/diagnostics.py 87.0% <100.0%> (+1.0%) ⬆️
spreg/error_sp_het_regimes.py 82.2% <100.0%> (+0.2%) ⬆️
spreg/error_sp_hom_regimes.py 82.0% <100.0%> (+0.2%) ⬆️
spreg/error_sp_regimes.py 64.4% <100.0%> (+0.4%) ⬆️
spreg/ml_error_regimes.py 83.6% <100.0%> (+0.1%) ⬆️
spreg/panel_fe.py 94.5% <100.0%> (ø)
spreg/sp_panels.py 87.0% <100.0%> (ø)
spreg/sur.py 76.8% <ø> (ø)
spreg/twosls_regimes.py 64.5% <100.0%> (+0.7%) ⬆️
spreg/ml_error.py 88.2% <66.7%> (+1.0%) ⬆️
... and 18 more

@martinfleis
Copy link
Member

Just a technical - this should probably be a 1.6.0 given there's new stuff coming, not 1.5.1 indicating a patch release as per semantic versioning.

@knaaptime
Copy link
Member

sweet. +1 on the 1.6 instead of 1.5.1

one quick question @pedrovma, is it possible to get impacts as a dataframe in the current API? specifically,

  • with model.summary you get a text printout of coefs and impacts (etc),
    • with model.output, you get coefs as a dataframe,
    • but there's no equivalent like model.impacts to get you direct and indirect in pandas form, right?

@pedrovma
Copy link
Member Author

pedrovma commented Aug 12, 2024

one quick question @pedrovma, is it possible to get impacts as a dataframe in the current API? specifically,

* with  `model.summary` you get a text printout of coefs and impacts (etc),
  
  * with `model.output`, you get coefs as a dataframe,
  * but there's no equivalent like `model.impacts` to get you direct and indirect in pandas form, right?

You are right! What you can get is model.sp_multipliers, a dictionary with the multipliers (direct, indirect, total). There is no attribute with a pandas object containing the spatial impacts. It is something we can consider adding!

@pedrovma pedrovma changed the title Updating to version 1.5.1 Updating to version 1.6.0 Aug 13, 2024
Copy link
Member

@knaaptime knaaptime left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we might want to add one test that sends a graph through the estimation, just to show that it works, but otherwise, great

@pedrovma
Copy link
Member Author

we might want to add one test that sends a graph through the estimation, just to show that it works, but otherwise, great

There is one here. =)

@knaaptime
Copy link
Member

snap :P 🙌

@pedrovma pedrovma merged commit c9565aa into pysal:main Aug 13, 2024
10 of 11 checks passed
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.

3 participants