当前位置:网站首页>Detailed explanation of data envelopment analysis (DEA) (taking the 8th Ningxia provincial competition as an example)
Detailed explanation of data envelopment analysis (DEA) (taking the 8th Ningxia provincial competition as an example)
2022-06-12 05:11:00 【Breeding apes】
Catalog
One 、 Basic introduction
1.1 principle
There are many models for data envelopment analysis , Mainly for :CCR Model ,BBC Model 、 Cross model 、A&P Model . Look at the various models of this method , The specific mathematical reasoning process of each model is basically the same , The standard linear programming formulas are also similar , The difference between them is mainly reflected in the different conditions applicable to each model . Beyond seas , This method was used in banks and hospitals earlier 、 Evaluation of the efficiency of cities and other aspects . In recent years , This method has also achieved a lot of application results in many fields of social economy in China . Because the method has relatively loose requirements for the evaluation object , Apply it to evaluate the same type DMU The relative effectiveness of the dominant position , It is difficult to be replaced by other methods .
1.2CCR Model
CCR A model is a reference to DMU adopt “ Input a certain amount of production factors , And produce a certain number of products ” To judge the relative rationality and effectiveness of each unit . From the point of view of investing resources , At the current level of output , Compare the use of invested resources , Take this as the basis for benefit evaluation , This pattern is called “ Input oriented mode ”.
Define the decision making unit j The efficiency evaluation index of is :
![]()
For the above formula, the weight coefficient can be appropriately taken v and u, bring
, Right.
Three decision-making units are used for efficiency evaluation , Generally speaking
The larger it is, the greater it is
Be able to get relatively more output with relatively less input . Therefore, only the maximum value of demand , You can explore
Here n individual DUM Is it relatively optimal .

1.3BCC Model
BCC The model discusses efficiency from the perspective of output , That is, under the same input level , Compare the achievement of output resources , This pattern is called “ Input oriented mode ”. What you get is “ Technical benefits ”,DEA=1 be called “ Technology works ”, Optimal solution
It is a decision-making unit j Of “ Technical benefits ”.

Two 、 Code
2.1MATLAB Code
clear
clc
format long
data=[14.40 0.65 31.30 3621.00 0.00
16.90 0.72 32.20 3943.00 0.09
15.53 0.72 31.87 4086.67 0.07
15.40 0.76 32.23 4904.67 0.13
14.17 0.76 32.40 6311.67 0.37
13.33 0.69 30.77 8173.33 0.59
12.83 0.61 29.23 10236.00 0.51
13.00 0.63 28.20 12094.33 0.44
13.40 0.75 28.80 13603.33 0.58
14.00 0.84 29.10 14841.00 1.00]';
X=data([1:3],:);%X For input variables
Y=data([4:5],:);%Y Is the output variable
[m,n]=size(X);
s=size(Y,1);
A=[-X' Y'];% Because the objective function is minimized , there -X It turns into seeking the maximum
b=zeros(n,1);
LB=zeros(m+s,1);UB=[];
for i=1:n
f=[zeros(1,m) -Y(:,i)'];
Aeq=[X(:,i)',zeros(1,s)];
beq=1;
w(:,i)=linprog(f,A,b,Aeq,beq,LB,UB);% front 3 Listed as input coefficient , after 2 Listed as output coefficient
E(i,i)=Y(:,i)'*w(m+1:m+s,i);% Output value * Output coefficient
end
theta=diag(E)';
fprintf(' use DEA The relative evaluation result of this method is :\n');
disp(theta);2.2Python Code
import gurobipy
import pandas as pd
# Display data in pages , Set to False Paging is not allowed
pd.set_option('display.expand_frame_repr', False)
# Maximum number of columns to display , Set to None Show all columns
pd.set_option('display.max_columns', None)
# Maximum number of rows to display , Set to None Show all rows
pd.set_option('display.max_rows', None)
class DEA(object):
def __init__(self, DMUs_Name, X, Y, AP=False):
self.m1, self.m1_name, self.m2, self.m2_name, self.AP = X.shape[1], X.columns.tolist(), Y.shape[1], Y.columns.tolist(), AP
self.DMUs, self.X, self.Y = gurobipy.multidict({DMU: [X.loc[DMU].tolist(), Y.loc[DMU].tolist()] for DMU in DMUs_Name})
print(f'DEA(AP={AP}) MODEL RUNING...')
def __CCR(self):
for k in self.DMUs:
MODEL = gurobipy.Model()
OE, lambdas, s_negitive, s_positive = MODEL.addVar(), MODEL.addVars(self.DMUs), MODEL.addVars(self.m1), MODEL.addVars(self.m2)
MODEL.update()
MODEL.setObjectiveN(OE, index=0, priority=1)
MODEL.setObjectiveN(-(sum(s_negitive) + sum(s_positive)), index=1, priority=0)
MODEL.addConstrs(gurobipy.quicksum(lambdas[i] * self.X[i][j] for i in self.DMUs if i != k or not self.AP) + s_negitive[j] == OE * self.X[k][j] for j in range(self.m1))
MODEL.addConstrs(gurobipy.quicksum(lambdas[i] * self.Y[i][j] for i in self.DMUs if i != k or not self.AP) - s_positive[j] == self.Y[k][j] for j in range(self.m2))
MODEL.setParam('OutputFlag', 0)
MODEL.optimize()
self.Result.at[k, (' Benefit analysis ', ' Comprehensive technical benefits (CCR)')] = MODEL.objVal
self.Result.at[k, (' Return to scale analysis ', ' effectiveness ')] = ' Not DEA It works ' if MODEL.objVal < 1 else 'DEA Weak effective ' if s_negitive.sum().getValue() + s_positive.sum().getValue() else 'DEA Strongly effective '
self.Result.at[k, (' Return to scale analysis ', ' type ')] = ' The return to scale is fixed ' if lambdas.sum().getValue() == 1 else ' Increasing returns to scale ' if lambdas.sum().getValue() < 1 else ' Diminishing returns to scale '
for m in range(self.m1):
self.Result.at[k, (' Variance analysis ', f'{self.m1_name[m]}')] = s_negitive[m].X
self.Result.at[k, (' Input redundancy rate ', f'{self.m1_name[m]}')] = 'N/A' if self.X[k][m] == 0 else s_negitive[m].X / self.X[k][m]
for m in range(self.m2):
self.Result.at[k, (' Variance analysis ', f'{self.m2_name[m]}')] = s_positive[m].X
self.Result.at[k, (' Under output rate ', f'{self.m2_name[m]}')] = 'N/A' if self.Y[k][m] == 0 else s_positive[m].X / self.Y[k][m]
return self.Result
def __BCC(self):
for k in self.DMUs:
MODEL = gurobipy.Model()
TE, lambdas = MODEL.addVar(), MODEL.addVars(self.DMUs)
MODEL.update()
MODEL.setObjective(TE, sense=gurobipy.GRB.MINIMIZE)
MODEL.addConstrs(gurobipy.quicksum(lambdas[i] * self.X[i][j] for i in self.DMUs if i != k or not self.AP) <= TE * self.X[k][j] for j in range(self.m1))
MODEL.addConstrs(gurobipy.quicksum(lambdas[i] * self.Y[i][j] for i in self.DMUs if i != k or not self.AP) >= self.Y[k][j] for j in range(self.m2))
MODEL.addConstr(gurobipy.quicksum(lambdas[i] for i in self.DMUs if i != k or not self.AP) == 1)
MODEL.setParam('OutputFlag', 0)
MODEL.optimize()
self.Result.at[k, (' Benefit analysis ', ' Technical benefits (BCC)')] = MODEL.objVal if MODEL.status == gurobipy.GRB.Status.OPTIMAL else 'N/A'
return self.Result
def dea(self):
columns_Page = [' Benefit analysis '] * 3 + [' Return to scale analysis '] * 2 + [' Variance analysis '] * (self.m1 + self.m2) + [' Input redundancy rate '] * self.m1 + [' Under output rate '] * self.m2
columns_Group = [' Technical benefits (BCC)', ' Scale benefits (CCR/BCC)', ' Comprehensive technical benefits (CCR)',' effectiveness ', ' type '] + (self.m1_name + self.m2_name) * 2
self.Result = pd.DataFrame(index=self.DMUs, columns=[columns_Page, columns_Group])
self.__CCR()
self.__BCC()
self.Result.loc[:, (' Benefit analysis ', ' Scale benefits (CCR/BCC)')] = self.Result.loc[:, (' Benefit analysis ', ' Comprehensive technical benefits (CCR)')] / self.Result.loc[:,(' Benefit analysis ', ' Technical benefits (BCC)')]
return self.Result
def analysis(self, file_name=None):
Result = self.dea()
file_name = 'DEA Data envelopment analysis report .xlsx' if file_name is None else f'\\{file_name}.xlsx'
Result.to_excel(file_name, 'DEA Data envelopment analysis report ')
3、 ... and 、 case analysis
3.1 Case introduction


3.2 case analysis
The first problem requires us to analyze and preprocess the original data , In a wide variety of indicators , Find the right input and output indicators , Build an evaluation system , Mathematical modeling , Find the key internal indicators that have a great impact on the operational efficiency of the organization , Calculate the score of each sub index and overall operation efficiency of each maternal and child health care institution . Obviously , This is a multi index input and multi index output for the same type of unit ( department ) Systematic analysis of relative effectiveness or benefit evaluation , After consulting a large number of literatures, we choose to use data envelopment analysis (DEA) Method to solve the problem .
On the data DEA Before analysis, we need to preprocess the data , First, classify the indicators given by the original data , Find their secondary or even primary indicators , So as to divide input indicators and output indicators , Then use Excel and Python Clean up the wrong data in the data set , On the basis of consulting a large number of literatures , Eliminate relatively unimportant indicators , Create new data sets , Import MPai Data science platform , First, the data sets of each year are analyzed separately DEA analysis , Finally, calculate the technical benefit 、 Scale benefits 、 Arithmetic mean value of comprehensive technical benefits , To solve the problem .
Relative to question one , Question 2 is more in line with the actual situation , Research is more valuable , After all, the study of hospital management is inseparable from the health economy , The study of health economy is inseparable from the national macro-economy , The economic development level of the region where the maternal and child health care institutions are located 、 Population and other objective factors have a great impact on its development and operation efficiency . At present , China's macroeconomic situation has entered a new normal , The downward pressure is very high . meanwhile , The aging of the population is getting worse , Due to lack of labor , It is disadvantageous to the development of the whole economy , Economic problems are essentially population problems , The whole economy is down , It is difficult to increase investment in health care , It is difficult for hospitals to increase their income , Only strict medical cost control can be implemented . therefore , It is urgent to explore the impact of different input structure changes on the final operation efficiency .
On the basis of question one , We first visit the statistical yearbooks of the provinces , The medical and health expenses of the corresponding provinces account for GDP The proportion of maternal and child health care institutions and the degree of provincial support for maternal and child health care institutions , Look up a lot of literature , Determine impact factors , Using the good and bad solution distance method (TOPSIS) Eliminate dimensional effects , Comprehensive score evaluation shall be conducted for all maternal and child health care institutions , So as to find out the impact of different input structure changes on the final operation efficiency .
Through the analysis of problem one and problem two , We have learned that some maternal and child health care institutions are inefficient , There is an obvious waste of medical and health resources , For this , Based on our own research results , Send a letter to the corresponding manager of maternal and child health care institutions , Use the form of report to intuitively show the problems exposed to them , And give targeted opinions , Help them get faster 、 Better solve their own resource use , Improve operational efficiency , Make full use of medical and health resources .
3.3 Case solving


Variance analysis is based on relaxation variables ( Variance variable 、 Excess variables ) Analysis of , Reduce the input redundancy according to the redundancy situation 、 The above table shows the analysis of input and output of variance variables / Total increase and decrease ,2020 The results of variance analysis of maternal and child health care institutions in are shown in the following table 3 Shown . Variance variable : It refers to the amount of investment that can be reduced to achieve the target efficiency , It's not DEA The difference between the actual value and the target value of the effective unit , Excess variables : It refers to the output that can be increased to achieve the target efficiency , It's not DEA The difference between the target value and the actual value of the effective area .
Succeed in learning 、 Progress in learning ! We study together and don't give up ~
Remember Sanlian ~ Your support is my biggest motivation !! Welcome to read previous articles ~
Xiao Bian's contact information is as follows , Welcome to communicate with you .
int[] arr=new int[]{4,8,3,2,6,5,1};
int[] index= new int[]{6,4,5,0,3,0,2,6,3,1};
String QQ = "";
for (int i : index){
QQ +=arr[i];
}
System.out.println(" Small make up the QQ:" + QQ);
边栏推荐
- Radiometric calibration and atmospheric correction of sentry 2 L1C multispectral data using sen2cor
- Realease package appears – missing type parameter
- Some problems of Qinglong panel
- Enhanced vegetation index evi, NDVI data, NPP data, GPP data, land use data, vegetation type data, rainfall data
- A complete set of installation procedures (for learning and communication only)
- Memory protection
- [backtracking method] queen n problem
- PostgreSQL age XID maintenance prevents the database from being read-only
- National land use data of 30m precision secondary classification
- InnoDB data storage structure – MySQL
猜你喜欢

Redis learning notes (continuously updating)

Main business objects of pupanvr record (5)

Development of video preview for main interface of pupanvr-ui

Introduction to MMS memory optimization of Hisilicon MPP service

A complete set of installation procedures (for learning and communication only)

Some problems of silly girl solved

2022-02-28 WPF upper computer 126 understand mqtt

File contains (regardless of suffix) Apache log remote file contains PHP encapsulated pseudo protocol:

Big manufacturers compete to join rust, performance and safety are the key, and the 2021 rust developer survey report is announced

22-2-28 there are many things to do at work today, ETH analysis
随机推荐
Transpiration and evapotranspiration (ET) data, potential evapotranspiration, actual evapotranspiration data, temperature data, rainfall data
Parallelization of accelerated training tf data. Dataset generator
2022 examination questions and simulation examination for crane driver (limited to bridge crane)
Acquisition of Lai data, NPP data, GPP data and vegetation coverage data
When the build When gradle does not load the dependencies, and you need to add a download path in libraries, the path in gradle is not a direct downloadable path
Radiometric calibration and atmospheric correction of sentry 2 L1C multispectral data using sen2cor
【cjson】根节点注意事项
How to deploy dolphin scheduler Apache dolphin scheduler 1.2.0 in cdh5.16.2
Accumulated temperature spatial distribution data, temperature distribution data, sunshine data, rainfall distribution, solar radiation data, surface runoff data, land use data, NPP data, NDVI data
Day18 creation and restoration of sparse array
kali_ Nat mode, bridging Internet / host only_ detailed
How to deploy PostgreSQL as a docker container
What is thinking
Map coordinate conversion of Baidu map API
New knowledge today
Pytorch was reported by a large number of netizens that torchrec, a new library, was "born" and has a large scale
Overview of common classes
Detailed usage of vim editor
How to count the total length of roads in the region and draw data histogram
Variables and data types