Skip to content

Commit

Permalink
DOC: Fix doc build errors
Browse files Browse the repository at this point in the history
Fix errors related to versions strings
Revert travis package install locations
  • Loading branch information
bashtage committed Nov 18, 2017
1 parent a2742be commit 69dac72
Show file tree
Hide file tree
Showing 5 changed files with 204 additions and 185 deletions.
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ before_install:
- conda create -n linearmodels-test python=${PYTHON} numpy=${NUMPY} scipy=${SCIPY} pandas=${PANDAS} statsmodels matplotlib seaborn
- source activate linearmodels-test
- if [[ ${XARRAY} = true ]]; then conda install xarray; fi
- conda install --yes --quiet sphinx ipython jupyter nbconvert nbformat pytest pytest-xdist coverage pytest-cov
- pip install codecov doctr nbsphinx guzzle_sphinx_theme -q
# - pip install --upgrade --no-deps sphinx
# - pip install sphinx
- conda install --yes --quiet sphinx ipython jupyter nbconvert nbformat
- pip install pytest pytest-xdist coverage pytest-cov codecov sphinx doctr nbsphinx guzzle_sphinx_theme -q
- pip install --upgrade --no-deps sphinx
- pip install sphinx
- export PYTHONHASHSEED=0
- export MKL_NUM_THREADS=1

Expand Down
6 changes: 3 additions & 3 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
global-include *.csv *.py *.dta *.ipynb
global-include *.csv *.py *.dta *.ipynb *.png

include versioneer.py
include linearmodels/_version.py
include README.rst
include README.md
include requirements.txt
include requirements-test-doc.txt
include requirements-dev.txt
include examples/*.ipynb
recursive-include doc/source *
recursive-include linearmodels/iv/tests *
recursive-include linearmodels/tests *
recursive-include linearmodels/datasets *
recursive-include examples *
328 changes: 164 additions & 164 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,164 +1,164 @@
Linear Models
=============
|Build Status| |codecov|
Linear (regression) models for Python. Extends
`statsmodels <http://www.statsmodels.org>`__ with Panel regression,
instrumental variable estimators, system estimators and models for
estimating asset prices:
- **Panel models**:
- Fixed effects (maximum two-way)
- First difference regression
- Between estimator for panel data
- Pooled regression for panel data
- Fama-MacBeth estimation of panel models
- **Instrumental Variable estimators**
- Two-stage Least Squares
- Limited Information Maximum Likelihood
- k-class Estimators
- Generalized Method of Moments, also with continuously updating
- **Factor Asset Pricing Models**:
- 2- and 3-step estimation
- Time-series estimation
- GMM estimation
- **System Regression**:
- Seemingly Unrelated Regression (SUR/SURE)
- Three-Stage Least Squares (3SLS)
Designed to work equally well with NumPy, Pandas or xarray data.
Panel models
~~~~~~~~~~~~
Like `statsmodels <http://www.statsmodels.org>`__ to include, supports
`patsy <https://patsy.readthedocs.io/en/latest/>`__ formulas for
specifying models. For example, the classic Grunfeld regression can be
specified
.. code:: python
import numpy as np
from statsmodels.datasets import grunfeld
data = grunfeld.load_pandas().data
data.year = data.year.astype(np.int64)
# MultiIndex, entity - time
data = data.set_index(['firm','year'])
from linearmodels import PanelOLS
mod = PanelOLS(data.invest, data[['value','capital']], entity_effect=True)
res = mod.fit(cov_type='clustered', cluster_entity=True)
Models can also be specified using the formula interface.
.. code:: python
from linearmodels import PanelOLS
mod = PanelOLS.from_formula('invest ~ value + capital + EntityEffect', data)
res = mod.fit(cov_type='clustered', cluster_entity=True)
The formula interface for ``PanelOLS`` supports the special values
``EntityEffects`` and ``TimeEffects`` which add entity (fixed) and time
effects, respectively.
Instrumental Variable Models
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
IV regression models can be similarly specified.
.. code:: python
import numpy as np
from linearmodels.iv import IV2SLS
from linearmodels.datasets import mroz
data = mroz.load()
mod = IV2SLS.from_formula('np.log(wage) ~ 1 + exper + exper ** 2 + [educ ~ motheduc + fatheduc]', data)
The expressions in the ``[ ]`` indicate endogenous regressors (before
``~``) and the instruments.
Installing
----------
The latest release can be installed using pip
.. code:: bash
pip install linearmodels
The master branch can be installed by cloning the repo and running setup
.. code:: bash
git clone https://github.com/bashtage/linearmodels
cd linearmodels
python setup.py install
Documentation
-------------
`Stable Documentation <https://bashtage.github.io/linearmodels/doc>`__
is built on every tagged version using
`doctr <https://github.com/drdoctr/doctr>`__. `Development
Documentation <https://bashtage.github.io/linearmodels/devel>`__ is
automatically built on every successful build of master.
Plan and status
---------------
Should eventually add some useful linear model estimators such as panel
regression. Currently only the single variable IV estimators are
polished.
- Linear Instrumental variable estimation - **complete**
- Linear Panel model estimation - **complete**
- Fama-MacBeth regression - **complete**
- Linear Factor Asset Pricing - **complete**
- System regression - **complete**
- Linear IV Panel model estimation - *not started*
- Dynamic Panel model estimation - *not started*
Requirements
------------
Running
~~~~~~~
With the exception of Python 3.5+, which is a hard requirement, the
others are the version that are being used in the test environment. It
is possible that older versions work.
- **Python 3.5+**: extensive use of ``@`` operator
- NumPy (1.11+)
- SciPy (0.18+)
- pandas (0.19+)
- statsmodels (0.8+)
- xarray (0.9+, optional)
Testing
~~~~~~~
- py.test
Documentation
~~~~~~~~~~~~~
- sphinx
- guzzle\_sphinx\_theme
- nbsphinx
- nbconvert
- nbformat
- ipython
- jupyter
.. |Build Status| image:: https://travis-ci.org/bashtage/linearmodels.svg?branch=master
:target: https://travis-ci.org/bashtage/linearmodels
.. |codecov| image:: https://codecov.io/gh/bashtage/linearmodels/branch/master/graph/badge.svg
:target: https://codecov.io/gh/bashtage/linearmodels
Linear Models
=============

|Build Status| |codecov|

Linear (regression) models for Python. Extends
`statsmodels <http://www.statsmodels.org>`__ with Panel regression,
instrumental variable estimators, system estimators and models for
estimating asset prices:

- **Panel models**:

- Fixed effects (maximum two-way)
- First difference regression
- Between estimator for panel data
- Pooled regression for panel data
- Fama-MacBeth estimation of panel models

- **Instrumental Variable estimators**

- Two-stage Least Squares
- Limited Information Maximum Likelihood
- k-class Estimators
- Generalized Method of Moments, also with continuously updating

- **Factor Asset Pricing Models**:

- 2- and 3-step estimation
- Time-series estimation
- GMM estimation

- **System Regression**:

- Seemingly Unrelated Regression (SUR/SURE)
- Three-Stage Least Squares (3SLS)

Designed to work equally well with NumPy, Pandas or xarray data.

Panel models
~~~~~~~~~~~~

Like `statsmodels <http://www.statsmodels.org>`__ to include, supports
`patsy <https://patsy.readthedocs.io/en/latest/>`__ formulas for
specifying models. For example, the classic Grunfeld regression can be
specified

.. code:: python
import numpy as np
from statsmodels.datasets import grunfeld
data = grunfeld.load_pandas().data
data.year = data.year.astype(np.int64)
# MultiIndex, entity - time
data = data.set_index(['firm','year'])
from linearmodels import PanelOLS
mod = PanelOLS(data.invest, data[['value','capital']], entity_effect=True)
res = mod.fit(cov_type='clustered', cluster_entity=True)
Models can also be specified using the formula interface.

.. code:: python
from linearmodels import PanelOLS
mod = PanelOLS.from_formula('invest ~ value + capital + EntityEffect', data)
res = mod.fit(cov_type='clustered', cluster_entity=True)
The formula interface for ``PanelOLS`` supports the special values
``EntityEffects`` and ``TimeEffects`` which add entity (fixed) and time
effects, respectively.

Instrumental Variable Models
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

IV regression models can be similarly specified.

.. code:: python
import numpy as np
from linearmodels.iv import IV2SLS
from linearmodels.datasets import mroz
data = mroz.load()
mod = IV2SLS.from_formula('np.log(wage) ~ 1 + exper + exper ** 2 + [educ ~ motheduc + fatheduc]', data)
The expressions in the ``[ ]`` indicate endogenous regressors (before
``~``) and the instruments.

Installing
----------

The latest release can be installed using pip

.. code:: bash
pip install linearmodels
The master branch can be installed by cloning the repo and running setup

.. code:: bash
git clone https://github.com/bashtage/linearmodels
cd linearmodels
python setup.py install
Documentation
-------------

`Stable Documentation <https://bashtage.github.io/linearmodels/doc>`__
is built on every tagged version using
`doctr <https://github.com/drdoctr/doctr>`__. `Development
Documentation <https://bashtage.github.io/linearmodels/devel>`__ is
automatically built on every successful build of master.

Plan and status
---------------

Should eventually add some useful linear model estimators such as panel
regression. Currently only the single variable IV estimators are
polished.

- Linear Instrumental variable estimation - **complete**
- Linear Panel model estimation - **complete**
- Fama-MacBeth regression - **complete**
- Linear Factor Asset Pricing - **complete**
- System regression - **complete**
- Linear IV Panel model estimation - *not started*
- Dynamic Panel model estimation - *not started*

Requirements
------------

Running
~~~~~~~

With the exception of Python 3.5+, which is a hard requirement, the
others are the version that are being used in the test environment. It
is possible that older versions work.

- **Python 3.5+**: extensive use of ``@`` operator
- NumPy (1.11+)
- SciPy (0.18+)
- pandas (0.19+)
- statsmodels (0.8+)
- xarray (0.9+, optional)

Testing
~~~~~~~

- py.test

Documentation
~~~~~~~~~~~~~

- sphinx
- guzzle\_sphinx\_theme
- nbsphinx
- nbconvert
- nbformat
- ipython
- jupyter

.. |Build Status| image:: https://travis-ci.org/bashtage/linearmodels.svg?branch=master
:target: https://travis-ci.org/bashtage/linearmodels
.. |codecov| image:: https://codecov.io/gh/bashtage/linearmodels/branch/master/graph/badge.svg
:target: https://codecov.io/gh/bashtage/linearmodels
13 changes: 7 additions & 6 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,15 @@
# The short X.Y version.
# The short X.Y version.
version = LooseVersion(linearmodels.__version__)
if len(version.version) > 2:
version = linearmodels.__version__.split('.')[:3]
version = '.'.join(version).split('+')
tag = ' (+' + version[1] + ')'
tag = ', '.join(tag.split('.'))
version = version[0] + tag
if '+' in version.version:
version = linearmodels.__version__.split('+')
commits, tag = version[1].split('.')
version = version[0]
tag = ' (+' + commits + ', ' + tag + ')'
version = version + tag
else:
version = linearmodels.__version__

# The full version, including alpha/beta/rc tags.
release = linearmodels.__version__

Expand Down
Loading

0 comments on commit 69dac72

Please sign in to comment.