Version 4¶
Version 4.31¶
Updated formulaic support of 0.6.0 and added optional support for not sorting variables from formulas. The default will continue to sort variables. You can enable the future behavior now using
from linearmodels.__future__ import ordering
The key difference between the old and the new behavior is that the old would reorder the variables in a formula so that
y ~ 1 + x + z + w
would return parameter estimates in the order1
,w
,x
,z
due to sorting. The new behavior will default to not sorting so that when usingy ~ 1 + x + z + w
will return parameter estimates in the order1
,x
,z
,w
.
Version 4.30¶
Improved compatability with unreleased versions of NumPy and pandas.
Version 4.29¶
Added average \(R^2\) and average adjusted \(R^2\) properties to
FamaMacBethResults
asavg_rsquared()
andavg_adj_rsquared()
.Initial compatability with pandas 2.0 Copy-on-Write feature.
Version 4.28¶
Expanded compatability for formulaic from 0.3.2 to 0.5.2
Fixed a few issues related to pandas 2.0
Added tests and wheel support for Python 3.11
Version 4.27¶
Switched from patsy for formulaic for linear constraint translation when using the formula interface. This allows formulas to be specified using a dictionary of constraints in addition to the standard single string of list of strings (GH439, GH440).
Fixed a bug when using escaped variable names, e.g.,
y ~ 1 + `x 3`
, in panel data models (GH435).Fixed a bug that affected creating IV models using formulas with missing data (GH438).
Fixed examples in documentation (GH434).
Version 4.26¶
Fixed a bug in
IV2SLS
and related models wherepredict()
would produceNaN
values whenexog
andendog
had different indices. AnIndexWarning
is now shown.Added
stacklevel
to all warnings to improve accuracy of warning location.
Version 4.25¶
Clarified the null in the F-statistic
Improved the error message when dependent and exog have different numbers of observations
Added formulaic as the preferred formula parser
Fixed a bug in
ACCovariance
estimator where the number of observations was incorrectly overwrittenFixed a bug in
linearmodels.panel.results.PanelResults.corr_squared_between()
,linearmodels.panel.results.PanelResults.corr_squared_overall()
, andlinearmodels.panel.results.PanelResults.corr_squared_within()
where the correlation was not squared.
Version 4.24¶
Added
breusch_pagan()
andlikelihood_ratio()
to test whether the shock covariance is diagonal.
Version 4.21¶
Fixed a bug that affected
SUR
when estimating models usingmethod="gls"
and heteroskedasticity-, hac, or cluster-robust inference.Added
rank_check
argument to panel-data models that allows the rank check to be skipped. Estimating a model that is rank deficient may result in unreliable estimates and so caution is needed if using this option.Changed the rank check to use
numpy.linalg.lstsq()
which is better aligned with parameter estimation than thenumpy.linalg.svd()
-basednumpy.linalg.matrix_rank()
.Changed the default least squares used to
scipy.linalg.lstsq()
so that thelapack_driver
can be changed to use QR factorization.
Version 4.20¶
Correct calculation of first-stage F-statistic in IV models.
Version 4.19¶
Minor release to fix a wheel-building issue on Python 3.9
Version 4.18¶
Improved performance of
fit()
by deferring some operations.Added support for the method available in PyHDFE in
AbsorbingLS
. These methods can only be used when the variables absorbed are categorical (i.e., fixed-effects only) and when the model is unweighted.Added alternative measures of \(R^2\) using the squared correlation. See
corr_squared_overall()
,corr_squared_within()
, andcorr_squared_between()
(GH157).Added a clustered covariance estimator (
linearmodels.system.covariance.ClusteredCovariance
) for system regressions (GH241).Fixed a bug in
kernel_optimal_bandwidth
which used incorrect values for a tuning parameter in the bandwidth estimation for the Parzen and Quadratic Spectral kernels (GH242).
Version 4.17¶
Version 4.16¶
Added typing to all public-facing classes and methods (GH228, GH229).
Added
FamaMacBethResults
which has the propertyall_params()
that contains a (nobs, nparam) DataFrame of parameters estimated in each time period (GH230).
Version 4.15¶
Blackened the code.
Added McElroy’s and Berndt’s measures of system fit (GH215).
Removed support for Python 3.5 inline with NEP-29 (GH222).
Version 4.14¶
Fixed issue where datasets were not installed with wheels (GH217).
Switched to property-cached to inherit cached property from property (GH211).
Removed all use of
pandas.Panel
(GH211).
Version 4.13¶
Added
AbsorbingLS
which allows a large number of variables to be absorbed. This model can handle very high-dimensional dummy variables and has been tested using up to 1,000,000 categories in a data set with 5,000,000 observations.Fixed a bug when estimating weighted panel models that have repeated observations (i.e., more than one observation per entity and time id).
Added
drop_absorbed
option toPanelOLS
which automatically drops variables that are absorbed by fixed effects. (GH206)Added optional Cythonized node selection for dropping singletons
Added preconditioning to the dummy variable matrix when
use_lsmr-True
infit()
. In models with many effects, this can reduce run time by a factor of 4 or more.
Version 4.12¶
Added an option to drop singleton observations in
PanelOLS
by setting the keyword argumentsingletons-False
. WhenFalse
, singelton observations are dropped before the model is fit, so the the result is as-if the observations were never inexog
ordependent
.Added a method to construct the 2-core graph for 2-way effects models, which allows singleton observations with no effect on estimated slopes to be excluded. (GH191)
Added support for LSMR estimation of parameters in
fit()
through the keyword argumentuse_lsmr
. LSMR is a sparse estimation method that can be used to extendPanelOLS
to more than two effects.Fixed a bug where IV models estimated with only exogenous regressors where not being correctly labeled as OLS models in output. (GH185)
Added
wald_test
to panel-model results.Renamed
test_linear_constraint
towald_test
Added a low-memory option to
fit()
that avoids constructing dummy variables. Only used when bothentity_effects
andtime_effects
areTrue
. By default, the low memory algorithm will be used whenever constructing the dummy variable array would require more than 1 GiB. (GH182)Added an option in model comparison (
compare()
andcompare()
) to report standard errors or pvalues instead of t-stats. (GH178)
Version 4.11¶
Fixed a bug which did not correctly check the rank of the cross-section regression in
FamaMacBeth
(GH176)Fixed a bug which failed to correctly check rank conditions when specifying asset pricing models (GH173)
Switched to external package cached-property to manage caching instead of custom and less-well-tested solution (GH172)
Version 4.10¶
Fixed a bug where weights were incorrectly calculated for HAC covariances when the weight function was
'parzen'
or'gallant'
(GH170)
Version 4.9¶
Changed the return type of Wooldridge’s over identification test when invalid to
InvalidTestStatistic
Add typing information to IV models
Allow optimization parameters to be passed to
IVGMMCUE
Removed internal use of pandas Panel
Improved performance in panel models when using
from_formula()
Switched to retaining index column names when original input index is named
Modified tests that were not well conceived
Added spell check to documentation build
Improve docstring for
summary
properties
Version 4.8¶
Corrected bug that prevented single character names in IV formulas
Corrected kappa estimation in LIML when there are no exogenous regressors
Version 4.7¶
Improved performance of Panel estimators by optimizing data structure construction
Version 4.6¶
Added a license
Version 4.5¶
Added System GMM estimator
Added automatic bandwidth for kernel-based GMM weighting estimators
Cleaned up HAC estimation across models
Added
predict
method to IV, Panel and System model to allow out-of-sample prediction and simplify retrieval of in-sample resultsFixed small issues with Fama-MacBeth which previously ignored weights
Version 4.0¶
Added Seemingly Unrelated Regression (SUR) Estimator
Added Three-stage Least Squares (3SLS) Estimator