https://github.com/javierbarbero/DataEnvelopmentAnalysis.jl
Tip revision: 2204253eb0ae1b86b64c4f13644b2dae591a62af authored by Javier Barbero on 18 March 2021, 19:57:27 UTC
Version 0.3.0
Version 0.3.0
Tip revision: 2204253
technical.jl
# This file contains types and structures for technical DEA model
"""
AbstractTechnicaDEAlModel
An abstract type representing a technical DEA model.
"""
abstract type AbstractTechnicalDEAModel <: AbstractDEAModel end
"""
efficiency(model::AbstractTechnicalDEAModel)
Return efficiency scores of a technical DEA model.
# Examples
```jldoctest
julia> X = [5 13; 16 12; 16 26; 17 15; 18 14; 23 6; 25 10; 27 22; 37 14; 42 25; 5 17];
julia> Y = [12; 14; 25; 26; 8; 9; 27; 30; 31; 26; 12];
julia> deaio = dea(X, Y);
julia> efficiency(deaio)
11-element Array{Float64,1}:
1.0
0.6222896790980051
0.8198562443845464
1.0
0.3103709311127934
0.5555555555555556
1.0
0.7576690895651103
0.8201058201058201
0.49056603773584917
1.0
```
"""
efficiency(model::AbstractTechnicalDEAModel) = model.eff
"""
slacks(model::AbstractTechnicalDEAModel, slack::Symbol)
Return slacks of a technical DEA model.
# Examples
```jldoctest
julia> X = [5 13; 16 12; 16 26; 17 15; 18 14; 23 6; 25 10; 27 22; 37 14; 42 25; 5 17];
julia> Y = [12; 14; 25; 26; 8; 9; 27; 30; 31; 26; 12];
julia> deaio = dea(X, Y);
julia> slacks(deaio, :X)
11×2 Array{Float64,2}:
0.0 0.0
-4.41868e-15 0.0
0.0 8.17926e-15
-8.03397e-16 0.0
1.80764e-15 0.0
4.44444 0.0
0.0 0.0
1.60679e-15 0.0
1.64021 0.0
9.68683e-15 0.0
0.0 4.0
julia> slacks(deaio, :Y)
11×1 Array{Float64,2}:
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
```
"""
function slacks(model::AbstractTechnicalDEAModel, slack::Symbol)::Matrix
if slack == :X
return model.slackX
elseif slack == :Y
return model.slackY
end
end
"""
targets(model::AbstractTechnicalDEAModel, target::Symbol)
Return targets of a technical DEA model.
# Examples
```jldoctest
julia> X = [5 13; 16 12; 16 26; 17 15; 18 14; 23 6; 25 10; 27 22; 37 14; 42 25; 5 17];
julia> Y = [12; 14; 25; 26; 8; 9; 27; 30; 31; 26; 12];
julia> deaio = dea(X, Y);
julia> targets(deaio, :X)
11×2 Array{Float64,2}:
5.0 13.0
9.95663 7.46748
13.1177 21.3163
17.0 15.0
5.58668 4.34519
8.33333 3.33333
25.0 10.0
20.4571 16.6687
28.7037 11.4815
20.6038 12.2642
5.0 13.0
julia> targets(deaio, :Y)
11×1 Array{Float64,2}:
12.0
14.0
25.0
26.0
8.0
9.0
27.0
30.0
31.0
26.0
12.0
```
"""
function targets(model::AbstractTechnicalDEAModel, target::Symbol)::Matrix
if target == :X
return model.Xtarget
elseif target == :Y
return model.Ytarget
end
end