Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
202 commits
Select commit Hold shift + click to select a range
782f52e
Fixed bug in approx_hess3 related to floats and tuples.
justinbois Nov 4, 2016
bd3ab9a
add additional em tests
kshedden Jan 18, 2018
8031f0c
linear algebra optimization for EM
kshedden Jan 18, 2018
df5eefc
Bug: Bug fixed. Change to 'inverse of sigma (np.linalg.inv)' instead …
molgor Jan 19, 2018
1d568c3
BUG: changed np.linalg.pinv to np.linalg.inv in _get_sigma (Removed c…
molgor Jan 20, 2018
b5b934d
Merge pull request #4218 from molgor/master
josef-pkt Jan 21, 2018
4e311c7
minor code format changes
kshedden Jan 21, 2018
0d757e5
Merge pull request #4214 from kshedden/factor_em
kshedden Jan 21, 2018
69b05ef
STY: Fixed some pep8 violations, removed unused imports
tommyod Jan 21, 2018
c99558b
Merge pull request #4219 from tommyod/kde_review
josef-pkt Jan 22, 2018
252bdfc
initial commit
kshedden Jan 25, 2018
877c46c
pep8 fixes
kshedden Jan 25, 2018
822af00
minor formatting
kshedden Jan 29, 2018
b49d3a7
REF: use full dtype in issubdtype call
ChadFulton Feb 1, 2018
bbd0564
Merge pull request #4240 from ChadFulton/gh-4228-kfilter
ChadFulton Feb 2, 2018
3cb9161
Replaced https by http in a statsmodels link.
jorgecarleitao Feb 3, 2018
20f58a7
BUG: Check dtype for medcouple
bashtage Feb 3, 2018
2cc8026
Fixed non-utf8 character in data.
jorgecarleitao Feb 4, 2018
a054ca8
fix spelling error in docstring
kshedden Feb 10, 2018
9542d53
Fixed docs as per GH4253
drorata Feb 13, 2018
cd48743
Merge pull request #4254 from drorata/FIX-GH4253
josef-pkt Feb 13, 2018
62cd808
Install conda3 instead
thequackdaddy Feb 19, 2018
1b386fc
Replace genfromtext with read_csv
thequackdaddy Feb 19, 2018
e06c881
TST: Modify test for summary col regressor order to catch issue #3767
nickderobertis Feb 25, 2018
8e5b0a3
BUG: Fix summary col reordering regressors without reordering coeffic…
nickderobertis Feb 25, 2018
6e1d1c0
Notebook shoudl probably use Gaussian distribution for GLM fit
thequackdaddy Feb 26, 2018
b0238bb
Add pytest folders to .gitignore
thequackdaddy Feb 26, 2018
5a9fbe4
All we have to do is update conda
thequackdaddy Feb 26, 2018
28c929f
maxiter in ARIMA is 500 [skip ci]
thequackdaddy Feb 26, 2018
523e3c9
Merge pull request #4223 from kshedden/mixedlm_docs
kshedden Feb 26, 2018
e67ce58
BUG: Results arparams, etc. w/ nonconsecutive lags
ChadFulton Mar 3, 2018
70b2b86
ENH: Add seasonalarparams, seasonalmaparams.
ChadFulton Mar 3, 2018
b9e6c00
TST: Add test for arparams, maparams, etc.
ChadFulton Mar 3, 2018
20961c6
flake8 fixups in model.py
jbrockmendel Mar 3, 2018
2eafb70
Merge pull request #4261 from thequackdaddy/docbuild
josef-pkt Mar 3, 2018
72053ba
Merge pull request #4247 from jorgecarleitao/fix_utf8
josef-pkt Mar 3, 2018
1ab3383
Merge pull request #4244 from jorgecarleitao/fix_http
josef-pkt Mar 3, 2018
6077451
Merge pull request #4246 from bashtage/fix-medcouple
josef-pkt Mar 3, 2018
c309fda
Merge pull request #4271 from whoopnip/fix-summary-col-3767
josef-pkt Mar 3, 2018
a44a637
Merge pull request #4274 from thequackdaddy/arimadoc
josef-pkt Mar 3, 2018
015f1ff
Merge pull request #4273 from thequackdaddy/gitignore
josef-pkt Mar 3, 2018
6033797
Merge pull request #4292 from jbrockmendel/model_flake
josef-pkt Mar 3, 2018
0e4e305
get rid of redundant import
jbrockmendel Mar 3, 2018
d0d1348
TST: test_arima111_predict_exog_2127 skip for scipy < 0.16
josef-pkt Mar 4, 2018
1daf0f8
Merge pull request #4298 from josef-pkt/test_arima_exog_predict_4294
josef-pkt Mar 4, 2018
1ca7113
Merge pull request #4291 from ChadFulton/gh-4289
ChadFulton Mar 4, 2018
2486c33
Fix typo
BioGeek Mar 5, 2018
c32b3ea
Fix typo in notebook
BioGeek Mar 5, 2018
0487024
initial commit
kshedden Jan 3, 2018
5b52853
fix import path
kshedden Jan 3, 2018
e109424
rename classes
kshedden Jan 4, 2018
9e28c75
docstring work
kshedden Jan 4, 2018
a0bd626
modify tests to be faster
kshedden Jan 5, 2018
dbacfbf
rename to specify bayes
kshedden Jan 5, 2018
371aed7
docstring work:
kshedden Jan 5, 2018
77e3411
remove common pieces to a superclass
kshedden Jan 5, 2018
a99f3df
modify to work with older scipy
kshedden Jan 5, 2018
32d4a8a
aviod repeated calculations
kshedden Jan 5, 2018
2d07ba8
add docstring for results
kshedden Jan 5, 2018
bfaa13e
change prior defaults
kshedden Jan 5, 2018
ac7ef80
add formula support
kshedden Jan 6, 2018
45782c2
check passed starting values for proper length
kshedden Jan 6, 2018
a5c2f19
add poisson family for vb
kshedden Jan 6, 2018
c940974
refactor to better dry
kshedden Jan 7, 2018
be12115
fix self assignment
kshedden Jan 7, 2018
377f84e
privatize base class, restructure as mixin
kshedden Jan 7, 2018
d923455
modify unstable test
kshedden Jan 7, 2018
3cbb0f2
rectify method names
kshedden Jan 7, 2018
bdb3f40
remove unneeded assignment
kshedden Jan 7, 2018
21e77dd
poisson test fails on old scipy
kshedden Jan 7, 2018
7e2ec7d
more work on poisson vb test
kshedden Jan 7, 2018
fef9661
more checking of input parameters
kshedden Jan 8, 2018
60a5e9c
work on docstrings
kshedden Jan 10, 2018
90d4e34
add method to extract random effect parameters
kshedden Jan 12, 2018
12f8593
make test more robust
kshedden Jan 12, 2018
39aef65
add tests
kshedden Jan 13, 2018
fb9363c
continue working on tests
kshedden Jan 13, 2018
361d274
use numdiff for hessian
kshedden Jan 13, 2018
e6dd95f
work on docstrings
kshedden Jan 14, 2018
3d40ce2
mored documentation work
kshedden Jan 14, 2018
415d5f3
change import path
kshedden Jan 18, 2018
542d9fc
add classes to genmod api
kshedden Jan 21, 2018
293a20c
Docs, release notes, api, etc.
kshedden Jan 21, 2018
51c56ae
spelling errors in docs
kshedden Jan 21, 2018
c231dba
refactor so that h() is easier to define
kshedden Feb 3, 2018
90ad21c
change formula interface to resemble MixedLM
kshedden Feb 26, 2018
8c13ee6
fix unclosed files
jbrockmendel Mar 6, 2018
660610f
Merge pull request #4189 from kshedden/glimmix
kshedden Mar 6, 2018
e5e9f0b
Merge pull request #4318 from jbrockmendel/ffs
ChadFulton Mar 12, 2018
3290542
remove old survival files
kshedden Mar 13, 2018
3cb06e1
New tests for mixedlm
kshedden Mar 6, 2018
71245ed
test dietox with random slope model
kshedden Mar 6, 2018
4687151
add dietox data file for testing
kshedden Mar 6, 2018
6e94ff8
Remove a few unused imports
kshedden Mar 6, 2018
e6f2f84
Test cleanup, warn about unused keyword to fit
kshedden Mar 7, 2018
eac6519
Merge pull request #4320 from kshedden/mixedlm-tests
kshedden Mar 19, 2018
0f4fe80
Trigger
kshedden Mar 20, 2018
c1d78dc
ENH: add t_test_pairwise to LikelihoodModelResults, minimal unit test
josef-pkt Mar 20, 2018
f5b0ee6
Merge pull request #4339 from kshedden/cls
kshedden Mar 20, 2018
5142b87
TST: t_test_pairwise, unit tests for different exog parameterization/…
josef-pkt Mar 20, 2018
9515fd3
REF: avoid isinstance int, unit test poisson
josef-pkt Mar 20, 2018
c51b9d5
BUG: cast test data to int, avoid patsy long int name
josef-pkt Mar 20, 2018
bd91e53
DOC/Ref: docstrings and argument cleanup
josef-pkt Mar 20, 2018
ea51b59
ENH/TST: add _constraints_factor to contrast.py
josef-pkt Mar 20, 2018
ba959b6
ENH: add alpha option to t_test_pairwise, more test coverage
josef-pkt Mar 21, 2018
bb7982b
Merge pull request #4365 from josef-pkt/t_test_pairwise
josef-pkt Mar 21, 2018
3d977d9
BUG: Prevent warnings from scipy.stats
Mar 21, 2018
0871eba
BUG: fix MICEData if column with one missing value closes #4375
josef-pkt Mar 21, 2018
90c3c68
Merge pull request #4373 from Dimchord/master
josef-pkt Mar 21, 2018
ac87dec
Merge pull request #4377 from josef-pkt/bug_mice_onemiss_4375
josef-pkt Mar 21, 2018
b3c1e8a
make arithmetic more readable
jbrockmendel Mar 21, 2018
6d06191
TST: tukeyhsd: add smoke test for plot_simultaneous
josef-pkt Mar 22, 2018
6746910
BUG/MAINT numpy compat, scalar index
josef-pkt Mar 22, 2018
f59661a
TST: correct super call xfailing test in TestGlmPoissonPwNr
josef-pkt Jan 27, 2018
02731c7
REF/TST: FutureWarning for resid_anscombe, silence unit tests
josef-pkt Jan 27, 2018
ea966e7
TST: silence warning in test_glm.py
josef-pkt Jan 27, 2018
b55649e
TST: remove most warnings, cheating with start_params
josef-pkt Jan 28, 2018
9094b72
TST: remove print, module level filter array_split FutureWarning
josef-pkt Jan 28, 2018
2a3dd6d
TST: silence warnings in vector_ar/tests, except one convergend in SVAR
josef-pkt Jan 28, 2018
0f79ff8
REF/TST: count_models catch convergence warning in start_params fit, …
josef-pkt Jan 28, 2018
9f3e32b
TST: use pytest.warns
josef-pkt Jan 28, 2018
2c0a583
REF: set warnings filter explicitly to always for UserWarning
josef-pkt Jan 28, 2018
07ae00d
TST: assert warns only if py > 3.3, assert converged flag
josef-pkt Jan 28, 2018
e07539c
MAINT: numpy compat, keep old rcond in lstsq, see #3994
josef-pkt Mar 22, 2018
c127e43
Merge pull request #4380 from josef-pkt/bug_tukeyhsd_3584
josef-pkt Mar 22, 2018
1f495bf
Merge pull request #3253 from justinbois/approx_hess3_fix
ChadFulton Mar 22, 2018
22fceee
TST/MAINT test_discrete skip assert_produces_warning on python <= 3.3
josef-pkt Mar 22, 2018
197f490
TST: test_discrete add all disp=0 and one start_params
josef-pkt Mar 22, 2018
23c22d6
Merge pull request #4384 from josef-pkt/maint_numpy_lstsq_rcond
josef-pkt Mar 22, 2018
735fe8f
BUG: outlier_test fix index with order closes #3971
josef-pkt Mar 22, 2018
662a3dc
ENH: add more options to outlier_test
josef-pkt Mar 22, 2018
d1fceb7
TST: skip parts if pandas < 0.17
josef-pkt Mar 23, 2018
521286a
Merge pull request #4385 from josef-pkt/bug_outlier_test_order_3971
josef-pkt Mar 23, 2018
6865dcd
Merge pull request #4235 from josef-pkt/tst_genmod
josef-pkt Mar 23, 2018
f43ccca
flake8 cleanup in regime_switching
jbrockmendel Mar 23, 2018
904d059
cleanup in statespace
jbrockmendel Mar 23, 2018
dcb90b7
ENH: Allow MICE to work with regularized regression
kshedden Mar 6, 2018
42e7826
pep8 fixes to mice.py
kshedden Mar 6, 2018
66e040e
add release note
kshedden Mar 6, 2018
4ebca76
try to improve test coverage metrics
kshedden Mar 6, 2018
45c83df
Further code coverage improvements
kshedden Mar 6, 2018
d9eacb0
Merge pull request #4388 from jbrockmendel/uclean
ChadFulton Mar 24, 2018
a3f05a0
remove unused imports of assert_raises
jbrockmendel Mar 22, 2018
14573e5
replace @dec with pytest.mark
jbrockmendel Mar 22, 2018
2db4457
deletion reverted by rebase
jbrockmendel Mar 24, 2018
786cfce
ENH: inter_rater add randolph's kappa to fleiss_kappa, see #4387
josef-pkt Mar 24, 2018
a8f8bca
Merge pull request #4309 from BioGeek/master
josef-pkt Mar 24, 2018
9e95a0b
Merge pull request #4319 from kshedden/mice_reg
kshedden Mar 24, 2018
1f2fafb
Merge pull request #4395 from josef-pkt/interrater_randolph
josef-pkt Mar 24, 2018
d87eb0e
Merge pull request #4386 from jbrockmendel/raises
josef-pkt Mar 24, 2018
8a7d0fc
Initial commit to fix #4213
kshedden Feb 10, 2018
06c87c0
wordsmith comment
kshedden Feb 10, 2018
413c0c5
don't change model df
kshedden Mar 24, 2018
cb99dcc
Add comment pointing to issue 1723 for future reference
kshedden Mar 25, 2018
1d0c058
Minor formatting changes
kshedden Mar 25, 2018
935ceaa
Merge pull request #4252 from kshedden/refit
kshedden Mar 26, 2018
1dfdf52
BUG/ENH: proportion_confint: impose bounds, support asarray and panda…
josef-pkt Mar 29, 2018
9cc4146
TST: proportion_confint, unit test, corner case, 2-D, pandas
josef-pkt Mar 29, 2018
33016f2
BUG: make list work, (count.index not callable)
josef-pkt Mar 30, 2018
c16ef02
TST/DOC update docstring, test for 1-D counts
josef-pkt Mar 30, 2018
5a01211
Merge pull request #4410 from josef-pkt/bug_prop_confint_bounds_2742
josef-pkt Mar 30, 2018
52465a6
BUG/REF: GMM fix exog_names, summary closes #4340
josef-pkt Apr 5, 2018
e614a42
Merge pull request #4428 from josef-pkt/bug_gmm_xnmaes
josef-pkt Apr 5, 2018
c5120c5
BUG: tsa coint, nearly perfect colinearity, return (-inf, 0, ...) clo…
josef-pkt Apr 5, 2018
15fdb55
Merge pull request #4430 from josef-pkt/bug_coint_corner_case
josef-pkt Apr 5, 2018
ab0231a
MAINT: ignore deprecation warning histogram normed
josef-pkt Apr 6, 2018
23831fc
MAINT: test_glm, use pandas instead of genfromtxt
josef-pkt Apr 6, 2018
bc8c9c7
TST: make genfromtxt usage depend on numpy version (plus whitespace)
josef-pkt Apr 6, 2018
bdb2439
TST/MAINT : test_theil, add fittedvalues test, use pandas instead of …
josef-pkt Apr 6, 2018
70415a8
MAINT: test_glm Lbw, old genfromtxt path for python2
josef-pkt Apr 6, 2018
cee0039
REF: boxplot: use asarray in jitter
josef-pkt Apr 6, 2018
e213d07
MAINT: test_ros pandas idxmax instead of argmax, fix intend
josef-pkt Apr 6, 2018
bf8e9be
REF/BUG boxplots use asarray for data
josef-pkt Apr 6, 2018
7afa3dd
TST: improve code in tests
josef-pkt Apr 6, 2018
6d4ae4c
Merge pull request #4432 from josef-pkt/fix_warnings
josef-pkt Apr 6, 2018
98d67db
Merge pull request #4295 from jbrockmendel/comon_guys
ChadFulton Apr 7, 2018
f9f8c92
ENH: Add support for RangeIndexes
ChadFulton Apr 10, 2018
5188211
Merge pull request #4366 from jbrockmendel/simplify
ChadFulton Apr 11, 2018
9381a58
TST: Test (fails) sim. smth. w/ state intercept
ChadFulton Apr 12, 2018
f956998
BUG: Fix sim. smoothing w/ state intercept.
ChadFulton Apr 12, 2018
2b6dc9c
Merge pull request #4469 from ChadFulton/ss-ss-state-int
ChadFulton Apr 12, 2018
eb8f076
substitutions
jbrockmendel Apr 13, 2018
33330d5
typo fixup
jbrockmendel Apr 13, 2018
f6020e4
check for Q == 1 explicitly
jbrockmendel Apr 13, 2018
c7930c7
REF: Let Pandas select Int64Index vs RangeIndex
ChadFulton Apr 13, 2018
20849c0
REF: Don’t copy indexes.
ChadFulton Apr 13, 2018
bddff16
Merge pull request #4479 from jbrockmendel/alg
ChadFulton Apr 13, 2018
eab81b6
REF: No need to create shim class in test.
ChadFulton Apr 13, 2018
2169f86
BUG: Catch all RangeIndex indexing exceptions.
ChadFulton Apr 13, 2018
a759e57
TST/DOC: Include RangeIndex in list of valid ix’s
ChadFulton Apr 13, 2018
28c3c5f
TST: Allow default index to be Int64 or Range
ChadFulton Apr 13, 2018
708d5f7
TST/DOC: Add descriptive note on index test cases
ChadFulton Apr 13, 2018
e7d19dc
BUG: Syntax error…
ChadFulton Apr 14, 2018
0b1bb28
TST: Allow Range or Int64 index w/ unsupported
ChadFulton Apr 14, 2018
893f1d5
TST: Allow Range or Int64 index w/ unsupported (2)
ChadFulton Apr 14, 2018
ef4a07b
REF: Put back RangeIndex shim.
ChadFulton Apr 14, 2018
9fe12f5
Merge pull request #4457 from ChadFulton/pd-rangeindex
ChadFulton Apr 14, 2018
7677a9a
BUG: allow list exog in get_prediction, closes #4437
josef-pkt Apr 16, 2018
15799d6
Merge pull request #4491 from josef-pkt/bug_getprediction_list
josef-pkt Apr 16, 2018
379e0e7
BUG: coint use autolag in adfuller call, closes #4490
josef-pkt Apr 17, 2018
1309f15
Merge pull request #4492 from josef-pkt/bug_coint_autolag
josef-pkt Apr 17, 2018
24db0ff
Add frequency domain seasonal components to UnobservedComponents
jyoder6 Feb 14, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,7 @@ statsmodels/tsa/statespace/_smoothers/_conventional.pyx
statsmodels/tsa/statespace/_smoothers/_univariate.pyx
statsmodels/tsa/statespace/_smoothers/_alternative.pyx
statsmodels/tsa/statespace/_smoothers/_classical.pyx

#pytest
.cache
.pytest_cache
8 changes: 3 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,15 @@ notifications:

# Setup anaconda
before_install:
- wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh
- wget http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
- chmod +x miniconda.sh
- ./miniconda.sh -b
- ./miniconda.sh -b -p /home/travis/miniconda
- export PATH=/home/travis/miniconda/bin:$PATH
- export PATH=/home/travis/miniconda2/bin:$PATH
- export MKL_NUM_THREADS=1
- export NUMEXPR_NUM_THREADS=1
- export OMP_NUM_THREADS=1
- conda config --set always_yes yes
# Temporarily disabled until conda is fixed
# - conda update --quiet conda
- conda update --quiet conda
# Fix for headless TravisCI
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ For a pull request to be accepted, you must meet the below requirements. This gr

- **One branch. One feature.** Branches are cheap and github makes it easy to merge and delete branches with a few clicks. Avoid the temptation to lump in a bunch of unrelated changes when working on a feature, if possible. This helps us keep track of what has changed when preparing a release.
- Commit messages should be clear and concise. This means a subject line of less than 80 characters, and, if necessary, a blank line followed by a commit message body. We have an `informal commit format standard <http://www.statsmodels.org/devel/dev/maintainer_notes.html#commit-comments>`_ that we try to adhere to. You can see what this looks like in practice by ``git log --oneline -n 10``. If your commit references or closes a specific issue, you can close it by mentioning it in the `commit message <https://help.github.com/articles/closing-issues-via-commit-messages>`_. (*For maintainers*: These suggestions go for Merge commit comments too. These are partially the record for release notes.)
- Code submissions must always include tests. See our `notes on testing <https://www.statsmodels.org/devel/dev/test_notes.html>`_.
- Code submissions must always include tests. See our `notes on testing <http://www.statsmodels.org/devel/dev/test_notes.html>`_.
- Each function, class, method, and attribute needs to be documented using docstrings. We conform to the `numpy docstring standard <https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt#docstring-standard>`_.
- If you are adding new functionality, you need to add it to the documentation by editing (or creating) the appropriate file in ``docs/source``.
- Make sure your documentation changes parse correctly. Change into the top-level ``docs/`` directory and type::
Expand Down
33 changes: 33 additions & 0 deletions docs/source/mixed_glm.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
.. currentmodule:: statsmodels.genmod.bayes_mixed_glm

Generalized Linear Mixed Effects Models
=======================================

Generalized Linear Mixed Effects (GLIMMIX) models are generalized
linear models with random effects in the linear predictors.
Statsmodels currently supports estimation of binomial and Poisson
GLIMMIX models using two Bayesian methods: the Laplace approximation
to the posterior, and a variational Bayes approximation to the
posterior. Both methods provide point estimates (posterior means) and
assessments of uncertainty (posterior standard deviation).

The current implementation only supports independent random effects.

Technical Documentation
-----------------------

Unlike Statsmodels mixed linear models, the GLIMMIX implementation is
not group-based. Groups are created by interacting all random effects
with a categorical variable. Note that this creates large, sparse
random effects design matrices `exog_vc`. Internally, `exog_vc` is
converted to a scipy sparse matrix. When passing the arguments
directly to the class initializer, a sparse matrix may be passed.
When using formulas, a dense matrix is created then converted to
sparse. For very large problems, it may not be feasible to use
formulas due to the size of this dense intermediate matrix.

References
^^^^^^^^^^

Blei, Kucukelbir, McAuliffe (2017). Variational Inference: A review
for Statisticians https://arxiv.org/pdf/1601.00670.pdf
12 changes: 12 additions & 0 deletions docs/source/release/version0.9.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ are mentioned in the docstrings.

The following major new features appear in this version.

Generalized linear mixed models
-------------------------------

Limited support for GLIMMIX models is now included in the genmod
module. Binomial and Poisson models with independent random effects
can be fit using Bayesian methods (Laplace and mean field
approximations to the posterior).

Documentation
-------------
Expand All @@ -37,6 +44,8 @@ Documentation
Other important improvements
----------------------------

* MICE (multiple imputation) can use regularized model fitters in the
imputation step.



Expand All @@ -49,6 +58,9 @@ While most bugs are usability problems, there is now a new label `type-bug-wrong
for bugs that cause that silently incorrect numbers are returned.
https://github.com/statsmodels/statsmodels/issues?q=label%3Atype-bug-wrong+is%3Aclosed

* Refitting elastic net regularized models using the `refit=True`
option now returns the unregularized parameters for the coefficients
selected by the regularized fitter, as documented. #4213


Backwards incompatible changes and deprecations
Expand Down
43 changes: 17 additions & 26 deletions examples/notebooks/distributed_estimation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": false
},
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import numpy as np\n",
"from scipy.stats.distributions import norm\n",
"from statsmodels.base.distributed_estimation import DistributedModel\n",
"\n",
"def _exog_gen(exog, partitions):\n",
Expand Down Expand Up @@ -52,16 +51,14 @@
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": true
},
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"X = np.random.normal(size=(1000, 25))\n",
"beta = np.random.normal(size=25)\n",
"beta *= np.random.randint(0, 2, size=25)\n",
"y = X.dot(beta) + np.random.normal(size=1000)\n",
"y = norm.rvs(loc=X.dot(beta))\n",
"m = 5"
]
},
Expand All @@ -74,10 +71,8 @@
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": false
},
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"debiased_OLS_mod = DistributedModel(m)\n",
Expand All @@ -94,17 +89,17 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": null,
"metadata": {
"collapsed": false
"scrolled": false
},
"outputs": [],
"source": [
"from statsmodels.genmod.generalized_linear_model import GLM\n",
"from statsmodels.genmod.families import Binomial\n",
"from statsmodels.genmod.families import Gaussian\n",
"\n",
"debiased_GLM_mod = DistributedModel(m, model_class=GLM,\n",
" init_kwds={\"family\": Binomial()})\n",
" init_kwds={\"family\": Gaussian()})\n",
"debiased_GLM_fit = debiased_GLM_mod.fit(zip(_endog_gen(y, m), _exog_gen(X, m)),\n",
" fit_kwds={\"alpha\": 0.2})"
]
Expand All @@ -118,10 +113,8 @@
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"collapsed": true
},
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from statsmodels.base.distributed_estimation import _est_regularized_naive, _join_naive\n",
Expand All @@ -142,10 +135,8 @@
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {
"collapsed": true
},
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from statsmodels.base.distributed_estimation import _est_unregularized_naive, DistributedResults\n",
Expand Down Expand Up @@ -175,7 +166,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.10"
"version": "2.7.14"
}
},
"nbformat": 4,
Expand Down
4 changes: 2 additions & 2 deletions examples/notebooks/regression_diagnostics.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"url = 'http://vincentarelbundock.github.io/Rdatasets/csv/HistData/Guerry.csv'\n",
"dat = pd.read_csv(url)\n",
"\n",
"# Fit regression model (using the natural log of one of the regressaors)\n",
"# Fit regression model (using the natural log of one of the regressors)\n",
"results = smf.ols('Lottery ~ Literacy + np.log(Pop1831)', data=dat).fit()\n",
"\n",
"# Inspect the results\n",
Expand Down Expand Up @@ -258,4 +258,4 @@
},
"nbformat": 4,
"nbformat_minor": 0
}
}
Loading