SF4wD
four-component stochastic frontier model with determinants
Motivation
This package was developed to complement four-component stochastic frontier that consider
determinants in mean and variance parameters of inefficiency distributions
by Ruei-Chi Lee.
Installation
Install via $ pip install 4SFwD
Features
-
SF4wD: main.py - set method and model to run simulation or real data
-
HMC: Hamilton Monte Carlo designed for determinants parameters.
-
DA: Data augmentation for the model
-
TK: Two-parametrization method originally proposed by Tsiona and Kunmbhaker (2014) for four-component model without determinants.
-
PMCMC: Particle MCMC for the model (perferred approach) - speed up by GPU parallel computation
Example
Here is how you run a simulation estimation for a four-component stochastic frontier model via PMCMC:
-
Parameter setting guideline in the SF4wD.py
-
Simulation data only offers stochastic frontier model that consider determinants in both mean and variance parameter of inefficiencies.
import SF4wD
#model:str - different way to consider determinants
#method:str - different Bayesian method to estimate the model
#data_name : str - simulation data or data in data/.
#S : int - MCMC length
#H : int - number of particles in PMCMC
#gpu: boolean - use parallel computation to run PMCMC
#save: boolean - save MCMC data
my_model = SF4wD(model = 'D', method = 'PMCMC', data_name ='',S=10, H=100, gpu=False, save=False)
my_model.run()
output:
mean sd hpd_3% hpd_97% mcse_mean mcse_sd ess_mean ess_sd ess_bulk ess_tail r_hat
beta0 2.412 0.093 2.318 2.555 0.046 0.035 4.0 4.0 7.0 10.0 NaN
beta1 1.078 0.074 0.977 1.242 0.023 0.017 10.0 10.0 10.0 10.0 NaN
xi0 0.580 0.043 0.531 0.652 0.014 0.011 9.0 9.0 8.0 10.0 NaN
xi1 0.694 0.127 0.479 0.867 0.073 0.058 3.0 3.0 3.0 10.0 NaN
delta0 0.141 0.072 0.013 0.273 0.023 0.019 10.0 8.0 10.0 10.0 NaN
delta1 0.774 0.137 0.620 0.984 0.079 0.063 3.0 3.0 3.0 10.0 NaN
z0 -0.461 0.716 -1.844 0.609 0.376 0.291 4.0 4.0 4.0 10.0 NaN
z1 2.728 0.889 1.268 3.941 0.459 0.354 4.0 4.0 4.0 10.0 NaN
gamma0 0.662 0.092 0.500 0.773 0.052 0.041 3.0 3.0 3.0 10.0 NaN
gamma1 0.412 0.061 0.349 0.519 0.021 0.015 9.0 9.0 9.0 10.0 NaN
sigma_alpha_sqr 1.377 0.178 1.095 1.693 0.075 0.057 6.0 6.0 6.0 10.0 NaN
sigma_v_sqr 2.575 2.523 1.290 9.515 1.062 0.793 6.0 6.0 3.0 10.0 NaN
License
Ruei-Chi Lee is the main author and contributor.
Bug reports, feature requests, questions, rants, etc are welcome, preferably on the github page.
Metadata
Release files for 4SFwD 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| 4SFwD-0.0.2.tar.gz | 3.0 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 4SFwD-0.0.2-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details |
Total release size: 6.3 kB
Release files / 4SFwD-0.0.2.tar.gz
| Download URL | 4SFwD-0.0.2.tar.gz |
|---|---|
| Size | 3.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
aab1f86812eb69105731bb8b119936d6e1c474ae1487f525d502318c49655772
|
|
BLAKE2b-256 checksum How to use checksums |
fde7a95c4dee4bd283dd5c0e851bec437f3ff88f6eaaa8168c5c3fda5f5c1108
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.5.0.1 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.40.2 CPython/3.7.3
|
Release files / 4SFwD-0.0.2-py2.py3-none-any.whl
| Download URL | 4SFwD-0.0.2-py2.py3-none-any.whl |
|---|---|
| Size | 3.2 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
f7c65c24308fbc80b3861ef03743e1d1d0b5972c80152d85c241f1d00683a69b
|
|
BLAKE2b-256 checksum How to use checksums |
78ae5726e55f42f483ea57eb5a70ce2201cd7646c4ff3ac8bf69a7b25ca39d19
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.5.0.1 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.40.2 CPython/3.7.3
|
Security for 4SFwD 0.0.2
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.