Skip to content

Commit

Permalink
Merge branch 'main' into add-bayes-glm-model
Browse files Browse the repository at this point in the history
  • Loading branch information
iamchrisearle committed Apr 27, 2024
2 parents a8b71db + c22837f commit 40f2b72
Show file tree
Hide file tree
Showing 611 changed files with 4,973 additions and 2,197 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -45,7 +45,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@v3

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
Expand All @@ -58,6 +58,6 @@ jobs:
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
2 changes: 1 addition & 1 deletion .github/workflows/generate-documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
- name: Install pandoc
uses: r-lib/actions/setup-pandoc@v2
- name: Install graphviz
uses: ts-graphviz/setup-graphviz@v1
uses: ts-graphviz/setup-graphviz@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ coverage_html_report/

# VS Code
.vscode/
.vs/

# Project specific
statsmodels/version.py
Expand Down
10 changes: 5 additions & 5 deletions INSTALL.txt
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
Dependencies
------------

python >= 3.8
python >= 3.9

www.python.org

numpy >= 1.18
numpy >= 1.22

www.numpy.org

scipy >= 1.4
scipy >= 1.7

www.scipy.org

pandas >= 1.0
pandas >= 1.3

pandas.pydata.org

patsy >= 0.5.2
patsy >= 0.5.5

patsy.readthedocs.org

Expand Down
2 changes: 1 addition & 1 deletion archive/docs/fix_longtable.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
read_file_path = os.path.join(BUILDDIR,'latex','statsmodels.tex')
write_file_path = os.path.join(BUILDDIR, 'latex','statsmodels_tmp.tex')

read_file = open(read_file_path, 'r', encoding="utf-8")
read_file = open(read_file_path, encoding="utf-8")
write_file = open(write_file_path, 'w', encoding="utf-8")

for line in read_file:
Expand Down
12 changes: 6 additions & 6 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@ variables:

jobs:

- template: tools/ci/azure/azure_template_windows.yml
- template: tools/ci/azure/azure_template_posix.yml
parameters:
name: Windows
vmImage: windows-latest
name: Linux
vmImage: ubuntu-latest

- template: tools/ci/azure/azure_template_posix.yml
parameters:
name: macOS
vmImage: macOS-latest

- template: tools/ci/azure/azure_template_posix.yml
- template: tools/ci/azure/azure_template_windows.yml
parameters:
name: Linux
vmImage: ubuntu-latest
name: Windows
vmImage: windows-latest
19 changes: 9 additions & 10 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
#
# statsmodels documentation build configuration file, created by
# sphinx-quickstart on Sat Jan 22 11:17:58 2011.
Expand Down Expand Up @@ -296,8 +295,8 @@
# (source start file, target name, title, author,
# documentclass [howto/manual]).
latex_documents = [
('index', 'statsmodels.tex', u'statsmodels Documentation',
u'Josef Perktold, Skipper Seabold', 'manual'),
('index', 'statsmodels.tex', 'statsmodels Documentation',
'Josef Perktold, Skipper Seabold', 'manual'),
]

# The name of an image file (relative to this directory) to place at the top of
Expand Down Expand Up @@ -333,18 +332,18 @@
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'statsmodels', u'statsmodels Documentation',
[u'Josef Perktold, Skipper Seabold, Jonathan Taylor'], 1)
('index', 'statsmodels', 'statsmodels Documentation',
['Josef Perktold, Skipper Seabold, Jonathan Taylor'], 1)
]

# Options for Epub output

# Bibliographic Dublin Core info.
epub_title = u'statsmodels'
epub_author = u'Josef Perktold, Skipper Seabold'
epub_publisher = u'Josef Perktold, Skipper Seabold'
epub_copyright = u'2009-2023, Josef Perktold, Skipper Seabold, ' \
u'Jonathan Taylor, statsmodels-developers'
epub_title = 'statsmodels'
epub_author = 'Josef Perktold, Skipper Seabold'
epub_publisher = 'Josef Perktold, Skipper Seabold'
epub_copyright = '2009-2023, Josef Perktold, Skipper Seabold, ' \
'Jonathan Taylor, statsmodels-developers'

# The language of the text. It defaults to the language option
# or en if the language is not set.
Expand Down
10 changes: 5 additions & 5 deletions docs/source/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,11 @@ Dependencies

The current minimum dependencies are:

* `Python <https://www.python.org>`__ >= 3.8
* `NumPy <https://www.scipy.org/>`__ >= 1.18
* `SciPy <https://www.scipy.org/>`__ >= 1.4
* `Pandas <https://pandas.pydata.org/>`__ >= 1.0
* `Patsy <https://patsy.readthedocs.io/en/latest/>`__ >= 0.5.2
* `Python <https://www.python.org>`__ >= 3.9
* `NumPy <https://www.scipy.org/>`__ >= 1.22
* `SciPy <https://www.scipy.org/>`__ >= 1.7
* `Pandas <https://pandas.pydata.org/>`__ >= 1.3
* `Patsy <https://patsy.readthedocs.io/en/latest/>`__ >= 0.5.5

Cython is required to build from a git checkout but not to run or install from PyPI:

Expand Down
4 changes: 2 additions & 2 deletions docs/source/optimization.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ associated with that specific optimizer:
gtol : float
Stop when norm of gradient is less than gtol.
norm : float
Order of norm (np.Inf is max, -np.Inf is min)
Order of norm (np.inf is max, -np.inf is min)
epsilon
If fprime is approximated, use this value for the step
size. Only relevant if LikelihoodModel.score is None.
Expand Down Expand Up @@ -87,7 +87,7 @@ associated with that specific optimizer:
gtol : float
Stop when norm of gradient is less than gtol.
norm : float
Order of norm (np.Inf is max, -np.Inf is min)
Order of norm (np.inf is max, -np.inf is min)
epsilon : float
If fprime is approximated, use this value for the step
size. Can be scalar or vector. Only relevant if
Expand Down
1 change: 0 additions & 1 deletion docs/source/plots/graphics-mean_diff_plot.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Test Bland-Altman
"""
Expand Down
1 change: 0 additions & 1 deletion docs/source/plots/graphics_boxplot_beanplot.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
Created on Fri May 04 00:22:40 2012
Expand Down
1 change: 0 additions & 1 deletion docs/source/plots/graphics_boxplot_violinplot.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
Created on Fri May 04 00:11:32 2012
Expand Down
1 change: 0 additions & 1 deletion docs/source/plots/graphics_correlation_plot_corr.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
Create a plot of correlation among many variables in a grid
Expand Down
1 change: 0 additions & 1 deletion docs/source/plots/graphics_correlation_plot_corr_grid.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
'''
In this example we just reuse the same correlation matrix several times.
Of course in reality one would show a different correlation (measuring a
Expand Down
1 change: 0 additions & 1 deletion docs/source/plots/graphics_functional_fboxplot.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
Created on Fri May 04 11:10:51 2012
Expand Down
2 changes: 0 additions & 2 deletions docs/source/plots/graphics_functional_hdrboxplot.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# coding: utf-8

#Load the El Nino dataset. Consists of 60 years worth of Pacific Ocean sea
#surface temperature data.

Expand Down
1 change: 0 additions & 1 deletion docs/source/plots/graphics_functional_rainbowplot.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
Created on Fri May 04 11:08:56 2012
Expand Down
1 change: 0 additions & 1 deletion docs/source/plots/graphics_gofplots_qqplot.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
Created on Sun May 06 05:32:15 2012
Expand Down
1 change: 0 additions & 1 deletion docs/source/plots/graphics_mosaicplot_mosaic.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
from itertools import product

import matplotlib.pyplot as plt
Expand Down
1 change: 0 additions & 1 deletion docs/source/plots/graphics_plot_fit_ex.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
Created on Monday April 1st 2013
Expand Down
1 change: 0 additions & 1 deletion docs/source/plots/graphics_plot_grids_scatter_ellipse.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
Create of grid of scatter plots with confidence ellipses from the statecrime
dataset
Expand Down
1 change: 0 additions & 1 deletion docs/source/plots/graphics_regression_abline.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
'''
Using the state crime dataset separately plot the effect of the each
variable on the on the outcome, murder rate while accounting for the effect
Expand Down
1 change: 0 additions & 1 deletion docs/source/plots/graphics_regression_ccpr.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
'''
Using the state crime dataset plot the effect of the rate of single
households ('single') on the murder rate while accounting for high school
Expand Down
1 change: 0 additions & 1 deletion docs/source/plots/graphics_regression_ccpr_grid.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
'''
Using the state crime dataset separately plot the effect of the each
variable on the on the outcome, murder rate while accounting for the effect
Expand Down
1 change: 0 additions & 1 deletion docs/source/plots/graphics_regression_ceres_residuals.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
'''
Using a model built from the the state crime dataset, make a CERES plot
with the rate of Poverty as the focus variable.
Expand Down
1 change: 0 additions & 1 deletion docs/source/plots/graphics_regression_influence.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
'''
Using a model built from the the state crime dataset, plot the influence in
regression. Observations with high leverage, or large residuals will be
Expand Down
1 change: 0 additions & 1 deletion docs/source/plots/graphics_regression_leverage_resid2.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
'''
Using a model built from the the state crime dataset, plot the leverage
statistics vs. normalized residuals squared. Observations with
Expand Down
1 change: 0 additions & 1 deletion docs/source/plots/graphics_regression_partregress.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
'''
Load the statewide dataset and plot partial regression of high school
graduation on murder rate after removing the effects of rate of urbanization,
Expand Down
1 change: 0 additions & 1 deletion docs/source/plots/graphics_regression_partregress_grid.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
'''
Using the state crime dataset separately plot the effect of the each
variable on the on the outcome, murder rate while accounting for the effect
Expand Down
1 change: 0 additions & 1 deletion docs/source/plots/graphics_regression_regress_exog.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
'''
Load the Statewide Crime data set and build a model with regressors
including the rate of high school graduation (hs_grad), population in urban
Expand Down
1 change: 0 additions & 1 deletion docs/source/plots/graphics_tsa_plot_acf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
'''
Load Sunspots Data and plot the autocorrelation of the number of sunspots
per year.
Expand Down
1 change: 0 additions & 1 deletion docs/source/plots/graphics_tsa_plot_pacf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
'''
Load Sunspots Data and plot the partial autocorrelation of the number of
sunspots per year.
Expand Down
2 changes: 1 addition & 1 deletion examples/notebooks/ets.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
" 549.8338,\n",
" 542.3405,\n",
"]\n",
"oil = pd.Series(oildata, index=pd.date_range(\"1965\", \"2013\", freq=\"AS\"))\n",
"oil = pd.Series(oildata, index=pd.date_range(\"1965\", \"2013\", freq=\"YS\"))\n",
"oil.plot()\n",
"plt.ylabel(\"Annual oil production in Saudi Arabia (Mt)\")"
]
Expand Down
8 changes: 4 additions & 4 deletions examples/notebooks/exponential_smoothing.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
" 514.2689,\n",
" 494.211,\n",
"]\n",
"index = pd.date_range(start=\"1996\", end=\"2008\", freq=\"A\")\n",
"index = pd.date_range(start=\"1996\", end=\"2008\", freq=\"Y\")\n",
"oildata = pd.Series(data, index)\n",
"\n",
"data = [\n",
Expand All @@ -74,7 +74,7 @@
" 41.3864,\n",
" 41.5966,\n",
"]\n",
"index = pd.date_range(start=\"1990\", end=\"2005\", freq=\"A\")\n",
"index = pd.date_range(start=\"1990\", end=\"2005\", freq=\"Y\")\n",
"air = pd.Series(data, index)\n",
"\n",
"data = [\n",
Expand Down Expand Up @@ -110,11 +110,11 @@
" 408.2705,\n",
" 414.2428,\n",
"]\n",
"index = pd.date_range(start=\"1970\", end=\"2001\", freq=\"A\")\n",
"index = pd.date_range(start=\"1970\", end=\"2001\", freq=\"Y\")\n",
"livestock2 = pd.Series(data, index)\n",
"\n",
"data = [407.9979, 403.4608, 413.8249, 428.105, 445.3387, 452.9942, 455.7402]\n",
"index = pd.date_range(start=\"2001\", end=\"2008\", freq=\"A\")\n",
"index = pd.date_range(start=\"2001\", end=\"2008\", freq=\"Y\")\n",
"livestock3 = pd.Series(data, index)\n",
"\n",
"data = [\n",
Expand Down
6 changes: 2 additions & 4 deletions examples/notebooks/glm.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@
"means75.iloc[0] = lowinc_75per = stats.scoreatpercentile(data.exog.iloc[:,0], 75)\n",
"resp_25 = res.predict(means25)\n",
"resp_75 = res.predict(means75)\n",
"diff = resp_75 - resp_25"
"diff = resp_75 - resp_25\n"
]
},
{
Expand All @@ -174,9 +174,7 @@
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"print(\"%2.4f%%\" % (diff*100))"
]
"source": "print(\"%2.4f%%\" % (diff.iloc[0]*100))"
},
{
"cell_type": "markdown",
Expand Down

0 comments on commit 40f2b72

Please sign in to comment.