depp_sfa documentation

Add your content using reStructuredText syntax. See the reStructuredText documentation for details.

API Reference

class depp_sfa.depp_sfa.SFA(y, x, z=None, id_var=None, time_var=None, fun='prod', intercept=True, lamda0=1, method='teJ', form='linear', dummy_indices=None, inference_method='mle', panel_model='bc92', draws=3000, tune=3000, standardize=True)[source]

Bases: object

Stochastic Frontier Analysis (SFA) estimator.

This class supports Cross-sectional models (ALS77, BC95), Panel Data models (BC92), and True Effects models (Greene 2005). It provides dual inference backends: Frequentist (MLE) and Bayesian (MCMC via PyMC).

Variables:
  • FUN_PROD – Constant indicating a production frontier.

  • FUN_COST – Constant indicating a cost frontier.

  • TE_teJ – Constant for Jondrow et al. (1982) efficiency decomposition.

  • TE_te – Constant for Battese & Coelli (1988) efficiency decomposition.

  • TE_teMod – Constant for a modified efficiency decomposition.

FUN_COST = 'cost'
FUN_PROD = 'prod'
TE_te = 'te'
TE_teJ = 'teJ'
TE_teMod = 'teMod'
get_beta()[source]

Get the estimated coefficients for the frontier equation.

Returns:

Array of estimated beta coefficients.

Return type:

numpy.ndarray

get_lambda()[source]

Get the ratio of standard deviations (lambda = sigma_u / sigma_v).

Returns:

Lambda value.

Return type:

float

get_residuals()[source]

Get the model residuals (epsilon = y - X*beta).

Returns:

Array of residuals.

Return type:

numpy.ndarray

get_sigma2()[source]

Get the total variance of the composite error (sigma^2).

Returns:

Sigma squared value.

Return type:

float

get_technical_efficiency()[source]

Get the technical efficiency scores for all observations.

If Bayesian (PyMC) was used, returns the mean of the posterior TE distribution. Otherwise, applies the user-selected frequentist decomposition.

Returns:

Array of efficiency scores bounded between 0 and 1.

Return type:

numpy.ndarray

optimize()[source]

Main estimation router.

Checks if the model is already fitted. If not, it routes the estimation to the appropriate MLE or PyMC private method based on user configuration.

summary()[source]

Print a formatted summary table of the estimation results.

Outputs coefficients, standard errors, z-values, p-values, and diagnostic information (ESS checks for Bayesian models).