Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
javierbarbero committed Jul 30, 2020
1 parent 38414b2 commit 0ef67b1
Show file tree
Hide file tree
Showing 9 changed files with 76 additions and 87 deletions.
15 changes: 7 additions & 8 deletions docs/src/economic/cost.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,13 @@ end
Let us denote by $C\left(\mathbf{y},\mathbf{w}\right)$ the minimum cost of producing the output level $\mathbf{y}$ given the input price vector $\mathbf{w}$: $C\left(\mathbf{y},\mathbf{w}\right)=\min \left\{ \sum\limits_{i=1}^{m}{{{w}_{i}}{{x}_{i}}} | {\mathbf{x}} \geqslant X\mathbf{\lambda} {\mathbf{y}_{o}} \leqslant Y{\mathbf{\lambda },\;{\mathbf{\lambda }} \geqslant {\mathbf{0}}} \right\}$, which considers the input possibility set capable of producing $\mathbf{y}_{o}$. For the observed outputs levels we can calculate minimum cost and the associated optimal quantities of inputs $\mathbf{x^{*}}$ consistent with the production technology by solving the following program:

```math
\begin{align}
\label{eq:mincost}
& \underset{\mathbf{x} ,\mathbf{\lambda }}{\mathop{\min }}\,\quad \quad \quad \;\ C\left(\mathbf{y}_{},\mathbf{w}\right)=\mathbf{wx^{*}} \\
& \text{subject}\ \text{to} \nonumber \\
& \quad \quad \quad \quad \quad \ {{\mathbf{x}}}\ge X\mathbf{\lambda } \nonumber \\
& \quad \quad \quad \quad \quad \;Y\mathbf{\lambda }\ \ge {{\mathbf{y}}_{o}} \nonumber\\
& \quad \quad \quad \quad \quad \ \mathbf{\lambda }\ge \mathbf{0}. \nonumber
\end{align}
\begin{aligned}
& \underset{\mathbf{x} ,\mathbf{\lambda }}{\mathop{\min }}\,\quad \quad \quad \;\ C\left(\mathbf{y}_{},\mathbf{w}\right)=\mathbf{wx^{*}} \\
& \text{subject}\ \text{to} \\
& \quad \quad \quad \quad \quad \ {{\mathbf{x}}}\ge X\mathbf{\lambda } \\
& \quad \quad \quad \quad \quad \;Y\mathbf{\lambda }\ \ge {{\mathbf{y}}_{o}} \\
& \quad \quad \quad \quad \quad \ \mathbf{\lambda }\ge \mathbf{0}.
\end{aligned}
```

The measurement of cost efficiency assuming variable returns to scale, **VRS**, adds the following condition:
Expand Down
18 changes: 8 additions & 10 deletions docs/src/economic/profit.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,14 @@ end
$ {\mathbf{x}} \geqslant X\mathbf{\lambda},\;{\mathbf{y}} \leqslant Y{\mathbf{\lambda },\;{\mathbf{\mathbf{e\lambda=1}, \lambda }} \geqslant {\mathbf{0}}} \Big\}$. Calculating maximum profit along with the optimal output and input quantities $\mathbf{y^{*}}$and $\mathbf{x^{*}}$ requires solving:

```math
\begin{align}
\label{eq:maxprofit}
& \underset{\mathbf{x,y,\lambda} }{\mathop{\max }}\,\quad \quad \quad \;\ \Pi\left(\mathbf{w},\mathbf{p}\right)=\mathbf{py^{*}-wx^{*}} \\
& \text{subject}\ \text{to} \nonumber \\
& \quad \quad \quad \quad \quad \ {{\mathbf{x}}}\ge X\mathbf{\lambda=x } \nonumber \\
& \quad \quad \quad \quad \quad \; {{\mathbf{y}}} \le Y\mathbf{\lambda =y} \nonumber\\
& \quad \quad \quad \quad \quad \; \mathbf{e\lambda=1}
\nonumber \\
& \quad \quad \quad \quad \quad \ \mathbf{\lambda }\ge \mathbf{0}. \nonumber
\end{align}
\begin{aligned}
& \underset{\mathbf{x,y,\lambda} }{\mathop{\max }}\,\quad \quad \quad \;\ \Pi\left(\mathbf{w},\mathbf{p}\right)=\mathbf{py^{*}-wx^{*}} \\
& \text{subject}\ \text{to} \\
& \quad \quad \quad \quad \quad \ {{\mathbf{x}}}\ge X\mathbf{\lambda=x } \\
& \quad \quad \quad \quad \quad \; {{\mathbf{y}}} \le Y\mathbf{\lambda =y} \\
& \quad \quad \quad \quad \quad \; \mathbf{e\lambda=1} \\
& \quad \quad \quad \quad \quad \ \mathbf{\lambda }\ge \mathbf{0}.
\end{aligned}
```

*Profit efficiency* defines as the difference between maximum profit and observed profit. Following the duality results introduced by *Chambers, Chung and Färe (1998)* it is possible to decompose it into technical and allocative efficiencies under variable returns to scale. Profit efficiency can be then decomposed into the directional distance fucntion and the residual difference corresponding to the *allocative profit efficiency*. Allocative efficiency defines then as the difference between maximum profit and profit at the technically efficient projection on the frontier. The approach relies on the directional vector to normalize these components, thereby ensuring that their values can be compared across DMUs.
Expand Down
17 changes: 7 additions & 10 deletions docs/src/economic/profitability.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,13 @@ end

The profitabilty function defines as $\mathrm{P}\left(\mathbf{w},\mathbf{p}\right)=\max \Big\{ \sum\limits_{i=1}^{s}{{p}_{i}}{{y}_{i}}/\sum\limits_{i=1}^{m}{{w}_{i}}{{x}_{i}} \,| {\mathbf{x}} \geqslant X\mathbf{\lambda},\;{\mathbf{y}} \leqslant Y{\mathbf{\lambda },\; \lambda } \geqslant {\mathbf{0}} \Big\}$. *Zofío and Prieto (2006)* introduced the following program that allows calculating profitability efficiency.
```math
\begin{align}
\label{eq:maxprofit}
& \underset{\mathbf{x,y,\lambda_{j},\omega} }{\mathop{\min }}\,\quad \quad \quad \;\ \omega \\
& \text{subject}\ \text{to} \nonumber \\
& \quad \quad \quad \quad \quad \ {\sum_{j=1}^{j} \lambda^{j} \frac{w^{j} x^{j}}{p^{j} y^{j}} = \omega \frac{w^{j} x^{j}_{o}}{p^{j} y^{j}_{o}} } \nonumber \\
& \quad \quad \quad \quad \quad \; \sum\nolimits_{j=1}^{n}\lambda^{j}=1 \nonumber\\
\nonumber \\
& \quad \quad \quad \quad \quad \ \mathbf{\lambda }\ge \mathbf{0}. \nonumber
\end{align}
\begin{aligned}
& \underset{\mathbf{x,y,\lambda_{j},\omega} }{\mathop{\min }}\,\quad \quad \quad \;\ \omega \\
& \text{subject}\ \text{to} \\
& \quad \quad \quad \quad \quad \ {\sum_{j=1}^{j} \lambda^{j} \frac{w^{j} x^{j}}{p^{j} y^{j}} = \omega \frac{w^{j} x^{j}_{o}}{p^{j} y^{j}_{o}} } \\
& \quad \quad \quad \quad \quad \; \sum\nolimits_{j=1}^{n}\lambda^{j}=1 \\
& \quad \quad \quad \quad \quad \ \mathbf{\lambda }\ge \mathbf{0}.
\end{aligned}
```
*Profitabilty efficiency* defines as the ratio between maximum profitabilty and observed profitabilty. Following the duality results introduced by *Zofío and Prieto (2006)* it is possible to decompose it into technical and allocative efficiencies under constant returns to scale. Profitabilty efficiency can be then decomposed into the generalizaed distance fucntion and the residual ratio corresponding to the *allocative profit efficiency*. Allocative efficiency defines then as the ratio of profitability at the technically efficient projection on the frontier to maximum profitability.

Expand Down
15 changes: 7 additions & 8 deletions docs/src/economic/revenue.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,13 @@ end
Let us denote by $R\left(\mathbf{x},\mathbf{p}\right)$ the maximum feasible revenue using inputs' levels $\mathbf{x}$ and given the outputs' prices $\mathbf{p}$: $R\left(\mathbf{x},\mathbf{p}\right)=\max \left\{ \sum\limits_{i=1}^{s}{{{p}_{i}}{{y}_{i}}} | {\mathbf{x}_{o}} \geqslant X\mathbf{\lambda},\;{\mathbf{y}} \leqslant Y{\mathbf{\lambda },\;{\mathbf{\lambda }} \geqslant {\mathbf{0}}} \right\}$; i.e., considering the output possibility set producible with $\mathbf{x}_{o}$. In this case, we calculate maximum revenue along with the optimal output quantities $\mathbf{y^{*}}$ by solving the following program:

```math
\begin{align}
\label{eq:maxrev}
& \underset{\mathbf{y} ,\mathbf{\lambda }}{\mathop{\max }}\,\quad \quad \quad \;\ R\left(\mathbf{x}_{o},\mathbf{p}\right)=\mathbf{py^{*}} \\
& \text{subject}\ \text{to} \nonumber \\
& \quad \quad \quad \quad \quad \ {{\mathbf{x}_o}}\ge X\mathbf{\lambda } \nonumber \\
& \quad \quad \quad \quad \quad \;Y\mathbf{\lambda }\ \ge {{\mathbf{y}}} \nonumber\\
& \quad \quad \quad \quad \quad \ \mathbf{\lambda }\ge \mathbf{0}. \nonumber
\end{align}
\begin{aligned}
& \underset{\mathbf{y} ,\mathbf{\lambda }}{\mathop{\max }}\,\quad \quad \quad \;\ R\left(\mathbf{x}_{o},\mathbf{p}\right)=\mathbf{py^{*}} \\
& \text{subject}\ \text{to} \\
& \quad \quad \quad \quad \quad \ {{\mathbf{x}_o}}\ge X\mathbf{\lambda } \\
& \quad \quad \quad \quad \quad \;Y\mathbf{\lambda }\ \ge {{\mathbf{y}}} \\
& \quad \quad \quad \quad \quad \ \mathbf{\lambda }\ge \mathbf{0}.
\end{aligned}
```

The measurement of revenue efficiency assuming variable returns to scale, **VRS**, adds the following condition:
Expand Down
2 changes: 1 addition & 1 deletion docs/src/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# DataEnvelopmentAnalysis Documentation
# DataEnvelopmentAnalysis.jl

DataEnvelopmentAnalysis.jl is a Julia package that provides functions for efficiency and productivity measurement using Data Envelopment Analysis (DEA). Particularly, it implements a variety of technical efficiency models, economic efficiency models and productivity change models.

Expand Down
15 changes: 7 additions & 8 deletions docs/src/technical/additive.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,14 @@ end
The additive model measures technical efficiency based solely on input excesses and output shortfalls, and characterizes efficiency in terms of the input and output slacks: ``\mathbf{s}^-\mathbb{\in R}^m`` and ``\mathbf{s}^+$$\mathbb{\in R}^s``, respectively.
. The package implements the weighted additive formulation of *Cooper and Pastor (1995)* and *Pastor, Lovell and Aparicio (2011)*, whose associated linear program is:
```math
\begin{align}
\label{eq:add}
\begin{aligned}
& \underset{\mathbf{\lambda },\,{{\mathbf{s}}^{-}},\,{{\mathbf{s}}^{+}}}{\mathop{\max }}\,\quad \quad \quad \quad \omega =\mathbf{\rho_{x}^{-}}{{\mathbf{s}}^{\mathbf{-}}}+\mathbf{\rho_{y}^{+}}{{\mathbf{s}}^{+}} \\
& \text{subject}\ \text{to} \nonumber\\
& \quad \quad \quad \quad \quad \quad X\mathbf{\lambda }+{{\mathbf{s}}^{\mathbf{-}}}= \ {{\mathbf{x}}_{o}} \nonumber\\
& \quad \quad \quad \quad \quad \quad Y\mathbf{\lambda }-{{\mathbf{s}}^{+}}=\ {{\mathbf{y}}_{o}} \nonumber\\
& \quad \quad \quad \quad \quad \quad \mathbf{e\lambda=1} \nonumber\\
& \quad \quad \quad \quad \quad \quad \mathbf{\lambda }\ge \mathbf{0},\ {{\mathbf{s}}^{\mathbf{-}}}\ge 0,{{\mathbf{s}}^{+}}\ge 0, \nonumber
\end{align}
& \text{subject}\ \text{to} \\
& \quad \quad \quad \quad \quad \quad X\mathbf{\lambda }+{{\mathbf{s}}^{\mathbf{-}}}= \ {{\mathbf{x}}_{o}} \\
& \quad \quad \quad \quad \quad \quad Y\mathbf{\lambda }-{{\mathbf{s}}^{+}}=\ {{\mathbf{y}}_{o}} \\
& \quad \quad \quad \quad \quad \quad \mathbf{e\lambda=1} \\
& \quad \quad \quad \quad \quad \quad \mathbf{\lambda }\ge \mathbf{0},\ {{\mathbf{s}}^{\mathbf{-}}}\ge 0,{{\mathbf{s}}^{+}}\ge 0,
\end{aligned}
```

where ``(\mathbf{\rho_{x}^{-}, \mathbf{\rho_{y}^{+}}}) \mathbb{\in R}^m_{+}\times \mathbb{R}_+^{s}`` are the inputs and outputs weight vectors whose elements can vary across DMUs.
Expand Down
15 changes: 7 additions & 8 deletions docs/src/technical/directional.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,13 @@ end
in a pre-assigned direction $\mathbf{g}= {\left({-{\mathbf{g_{x}^-},\mathbf{g^{+}_y}}} \right)\neq\mathbf{0}_{m+s}}$, $\mathbf{g^{-}_{x}}\mathbb{\in R}^m$ and $\mathbf{g^{+}_{y}}\mathbb{\in R}^s$, in a proportion $\beta$. The associated linear program is:

```math
\begin{align}
\label{eq:ddf}
& \underset{\beta ,\mathbf{\lambda }}{\mathop{\max }}\,\quad \quad \quad \quad \beta \\
& \text{subject}\ \text{to} \nonumber\\
& \quad \quad \quad \quad \quad \ X\lambda\le {{\mathbf{x}}_{o}} -\beta{{\mathbf{g^-_x}}} \nonumber\\
& \quad \quad \quad \quad \quad \ Y\mathbf{\lambda }\ge\ {{\mathbf{y}}_{o}}+\beta {{\mathbf{g^+_y}}} \nonumber\\
& \quad \quad \quad \quad \quad \ \mathbf{\lambda }\ge \mathbf{0}.\nonumber\\ & \quad \nonumber
\end{align}
\begin{aligned}
& \underset{\beta ,\mathbf{\lambda }}{\mathop{\max }}\,\quad \quad \quad \quad \beta \\
& \text{subject}\ \text{to} \\
& \quad \quad \quad \quad \quad \ X\lambda\le {{\mathbf{x}}_{o}} -\beta{{\mathbf{g^-_x}}} \\
& \quad \quad \quad \quad \quad \ Y\mathbf{\lambda }\ge\ {{\mathbf{y}}_{o}}+\beta {{\mathbf{g^+_y}}} \\
& \quad \quad \quad \quad \quad \ \mathbf{\lambda }\ge \mathbf{0}.\\ & \quad
\end{aligned}
```

The measurement of technical efficiency assuming variable returns to scale, **VRS**, adds the following condition:
Expand Down
37 changes: 18 additions & 19 deletions docs/src/technical/generalizeddf.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,13 @@ end
*Chavas and Cox (1999)* introduced a generalized distance function efficiency measure that reescales both inputs and outputs toward the frontier technology.

```math
\begin{align}
\label{eq:rim}
& \underset{\delta ,\mathbf{\lambda }}{\mathop{\min }}\,\quad \quad \quad \;\ \delta \\
& \text{subject}\ \text{to} \nonumber \\
& \quad \quad \quad \quad \quad \ X\mathbf{\lambda } \le \delta^{1 - \alpha} {{\mathbf{x}}_{o}} \nonumber \\
& \quad \quad \quad \quad \quad \;Y\mathbf{\lambda }\ \ge {{\mathbf{y}}_{o}} / \delta^{\alpha} \nonumber\\
& \quad \quad \quad \quad \quad \ \mathbf{\lambda }\ge \mathbf{0}. \nonumber
\end{align}
\begin{aligned}
& \underset{\delta ,\mathbf{\lambda }}{\mathop{\min }}\,\quad \quad \quad \;\ \delta \\
& \text{subject}\ \text{to} \\
& \quad \quad \quad \quad \quad \ X\mathbf{\lambda } \le \delta^{1 - \alpha} {{\mathbf{x}}_{o}} \\
& \quad \quad \quad \quad \quad \;Y\mathbf{\lambda }\ \ge {{\mathbf{y}}_{o}} / \delta^{\alpha} \\
& \quad \quad \quad \quad \quad \ \mathbf{\lambda }\ge \mathbf{0}.
\end{aligned}
```

The measurement of technical efficiency assuming variable returns to scale, **VRS**, adds the following condition:
Expand All @@ -37,19 +36,19 @@ julia> X = [5 3; 2 4; 4 2; 4 8; 7 9];
julia> Y = [7 4; 10 8; 8 10; 5 4; 3 6];
julia> deagdf(X, Y, alpha = 0.5, rts = :VRS)
Generalized DF DEA Model
julia> deagdf(X, Y, alpha = 0.5, rts = :VRS, slack = false)
Generalized DF DEA Model
DMUs = 5; Inputs = 2; Outputs = 2
alpha = 0.5; Returns to Scale = VRS
─────────────────────────────────────────────────────────────
efficiency slackX1 slackX2 slackY1 slackY2
─────────────────────────────────────────────────────────────
1 0.68185 0.605935 4.26672e-8 3.91163e-8 4.67865
2 1.0 5.19411e-8 6.85405e-8 2.54977e-8 4.97494e-8
3 1.0 4.5869e-8 7.51401e-8 5.75966e-8 1.92107e-8
4 0.25 4.71611e-8 9.87945e-8 5.46022e-8 9.69031e-8
5 0.36 0.2 3.4 3.0 8.07052e-8
─────────────────────────────────────────────────────────────
─────────────
efficiency
─────────────
1 0.68185
2 1.0
3 1.0
4 0.25
5 0.36
─────────────
```

### deagdf Function Documentation
Expand Down
29 changes: 14 additions & 15 deletions docs/src/technical/radial.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ end

Based on the data matrix $(X,Y)$, we calculate the input oriented efficiency of each observation *o* by solving $n$ times the following linear programming problem -- known as the Charnes, Cooper, and Rhodes (1978), **CCR**, model:
```math
\begin{align}
\label{eq:rim}
\begin{aligned}
& \underset{\theta ,\mathbf{\lambda }}{\mathop{\min }}\,\quad \quad \quad \;\ \theta \\
& \text{subject}\ \text{to} \nonumber \\
& \quad \quad \quad \quad \quad \ X\mathbf{\lambda } \le \theta {{\mathbf{x}}_{o}} \nonumber \\
& \quad \quad \quad \quad \quad \;Y\mathbf{\lambda }\ \ge {{\mathbf{y}}_{o}} \nonumber\\
& \quad \quad \quad \quad \quad \ \mathbf{\lambda }\ge \mathbf{0}. \nonumber
\end{align}
& \text{subject}\ \text{to} \\
& \quad \quad \quad \quad \quad \ X\mathbf{\lambda } \le \theta {{\mathbf{x}}_{o}} \\
& \quad \quad \quad \quad \quad \;Y\mathbf{\lambda }\ \ge {{\mathbf{y}}_{o}} \\
& \quad \quad \quad \quad \quad \ \mathbf{\lambda }\ge \mathbf{0}.
\end{aligned}
```

The measurement of technical efficiency assuming variable returns to scale, **VRS**, as introduced by *Banker, Charnes and Cooper (1984)* -- known as the Banker, Charnes and Cooper, **BCC**, model -- adds the following condition:
```math
\sum\nolimits_{j=1}^{n}\lambda_j=1
Expand Down Expand Up @@ -106,14 +106,13 @@ peers(deaiovrs)

It is possible to calculate the output oriented technical efficiency of each observation by solving the following linear program:
```math
\begin{align}
\label{eq:rom}
& \underset{\phi ,\mathbf{\lambda }}{\mathop{\max }}\,\quad \quad \quad \quad \phi \\
& \text{subject}\ \text{to} \nonumber\\
& \quad \quad \quad \quad \quad \ X\lambda\le {{\mathbf{x}}_{o}} \nonumber\\
& \quad \quad \quad \quad \quad \ Y\mathbf{\lambda }\ \ge \phi {{\mathbf{y}}_{o}} \nonumber\\
& \quad \quad \quad \quad \quad \ \mathbf{\lambda }\ge \mathbf{0}.\nonumber\\ & \quad \nonumber
\end{align}
\begin{aligned}
& \underset{\phi ,\mathbf{\lambda }}{\mathop{\max }}\,\quad \quad \quad \quad \phi \\
& \text{subject}\ \text{to} \\
& \quad \quad \quad \quad \quad \ X\lambda\le {{\mathbf{x}}_{o}} \\
& \quad \quad \quad \quad \quad \ Y\mathbf{\lambda }\ \ge \phi {{\mathbf{y}}_{o}} \\
& \quad \quad \quad \quad \quad \ \mathbf{\lambda }\ge \mathbf{0}.\ & \quad
\end{aligned}
```

with the following condition when assuming variable returns to scale:
Expand Down

0 comments on commit 0ef67b1

Please sign in to comment.