A Python Package for Stochastic Frontier Analysis
Project description
Stochastic Frontier Analysis (SFA)
Installation
The pySFA
package is now avaiable on PyPI and the latest development version can be installed from the Github repository pySFA
. Please feel free to download and test it. We welcome any bug reports and feedback.
PyPI ![PyPI version](https://pypi-camo.freetls.fastly.net/494e3eff38ff44c8e74e33fe507ca6c08b750cad/68747470733a2f2f696d672e736869656c64732e696f2f707970692f762f70797366612e7376673f6d61784167653d33363030)
![PyPI downloads](https://pypi-camo.freetls.fastly.net/259a6bf0950fa98992b8e4496a00c4a571e8cf2a/68747470733a2f2f696d672e736869656c64732e696f2f707970692f646d2f70797366612e7376673f6d61784167653d3231363030)
pip install pysfa
GitHub
pip install -U git+https://github.com/gEAPA/pySFA
Authors
- Sheng Dai, PhD, Turku School of Economics, University of Turku, Finland.
- Zhiqiang Liao, Doctoral Researcher, Aalto University School of Business, Finland.
Demo: Estimating a production function by pySFA
import numpy as np
import pandas as pd
from pysfa import SFA
from pysfa.dataset import load_Tim_Coelli_frontier
# import the data from Tim Coelli Frontier 4.1
df = load_Tim_Coelli_frontier(x_select=['labour', 'capital'],
y_select=['output'])
y = np.log(df.y)
x = np.log(df.x)
# Estimate SFA model
res = SFA.SFA(y, x, fun=SFA.FUN_PROD, lamda0=1, method=SFA.TE_teJ)
# print estimates
print(res.get_beta())
print(res.get_lambda())
print(res.get_sigma2())
print(res.get_sigmau2())
print(res.get_sigmav2())
# print TE
print(res.get_technical_efficiency())
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pysfa-0.3.tar.gz
(9.4 kB
view hashes)
Built Distribution
pysfa-0.3-py3-none-any.whl
(9.3 kB
view hashes)