0

I am not familiar with linear programming. My expertise is in statistics, econometrics. So I might have written the code with some errors.

But I have searched the sources as much as I can. In the article I reviewed, it was suggested to use mixed-integer linear programming for variable selection in DEA.

I attached the Equation and I wrote the code as below, but the R gives errors in the last 5 codes (in constraints). What I may have written wrong?

I would be very happy if anyone who knows about the subject helps.

Thank you

Image of Equation

model <- MIPModel() %>% 
+ add_variable(pi[i],i=1:45,type="binary") %>%
+ add_variable(p[i],i=1:45,type="binary") %>%
+ add_variable(y1[i],i=1:45,type="C") %>%
+ add_variable(x1[i],i=1:45,type="C") %>%
+ add_variable(z1[i],i=1:45,type="C") %>%
+ set_objective(sum_expr(u[i]*y1[i]-w[i]*z1[i]+c[i],i=1:45)) %>%
+ add_constraint((v[i]*x1[i],i=1:45)=1))
+ add_constraint((y1*u[i]-x1*v[i]-z1*w[i]+c[i],i:1=45)<=0)
+ add_constraint((sum_expr(pi^[i],i=1:5)+(sum_expr(p^[i],i=2:10))<=3)
+ add_constraint(u[i],ub=pi)
+ add_constraint(w[i],ub=p) ```


2
  • I see some strange things like (v[i]*x1[i],i=1:45)=1. That does not make sense to me. My version of OMPR is already complaining about type="C". I would suggest developing the model more slowly, i.e. one constraint at the time. It also would help to post more complete code that we can run. Also, if you are more familiar with matrix notation, you may want to look at cvxr. Commented Mar 24, 2020 at 18:07
  • Hello, Thank you for your comment. I will try it. Commented Mar 25, 2020 at 19:06

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.