Skip to main content

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 versionPyPI downloads

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, method=SFA.TE_teJ)
res.optimize()
# print estimates
print(res.get_beta())
print(res.get_residuals())

# print estimated parameters
print(res.get_lambda())
print(res.get_sigma2())
print(res.get_sigmau2())
print(res.get_sigmav2())

# print statistics
print(res.get_pvalue())
print(res.get_tvalue())
print(res.get_std_err())

# OR print summary
print(res.summary())

# print TE
print(res.get_technical_efficiency())

Metadata

Release files for pysfa 0.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pysfa 0.8
File Size Uploaded Provenance Actions
pysfa-0.8.tar.gz 9.9 kB Without provenance Details for pysfa-0.8.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pysfa 0.8
File Interpreter ABI Platform Actions
pysfa-0.8-py3-none-any.whl Python 3 none any Details for pysfa-0.8-py3-none-any.whl

Total release size: 19.7 kB

Release files / pysfa-0.8.tar.gz

Download URL pysfa-0.8.tar.gz
Size 9.9 kB
Tags Source
SHA-256 checksum
How to use checksums
2bef85a409513695463e95c83a7477b77ee8ed95bddcc123e1332c4966d914c4
BLAKE2b-256 checksum
How to use checksums
77a30bae4b30b7b5b216bc3c3e1088146f69b8efab261e452480674bf1417c51
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.16

Release files / pysfa-0.8-py3-none-any.whl

Download URL pysfa-0.8-py3-none-any.whl
Size 9.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c1465042bb6cdee06d1dbd77789239f4f929cf86917dae1cdf7a47979e8460e5
BLAKE2b-256 checksum
How to use checksums
3f8f0b200061d4502344efb9a058935045b3af87a2ec95189618ebf514a59ebc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.16

Security for pysfa 0.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page