I am interested in understanding the algorithm/methodology of the WGI (the most cited and popular corruption/governance) World Bank Methodology. They try to publish as detailed as possible to the public but I struggle to figure out how they manage to solve the maximisation at page 97-99 here Governance Matters VII: Aggregate and Individual Governance Indicators, 1996-2007

Basically, they end up with a maximum-likehood estimation with three unknown parameters and state that it is a standard estimation. I am not an expert in Stata/Mata/Mathlab but honestly I can't see the trivial point.

Can anyone help and refer me to some statistical packages?


1 Answer 1


This isn't a matter of statistical packages as much as it is a matter of how to write a program to maximize/minimize a function. You can do this readily in Stata, Matlab, R, Python, etc. No matter what language you use, though, the process is basically the same. You write a function that specifies the functional form your trying to, say, minimize, set the parameters you're optimizing over as the function arguments, then call some built-in minimization routine on that function. Here is a primer for doing this in Stata and here is an introduction for R. Matlab and Python will both be very similar to R, with the primary exception being that you will have to declare the function in a different .m file for Matlab.

  • $\begingroup$ Hi, thanks very much. I spent awhile reading and found your materials are greatly helpful. I just have two more questions. (1) Can I apply the materials to MLE of matrices/vectors? (I've leaned that Mata can handle matrices)? The maximisation of the WGI is with respect to three unknown parameter. (2) can the programmes deal with determinants of matrices, or I have to evaluate them before specify the function? (2) can you please indicate some readings on data manipulation? Thank you for your time!! $\endgroup$
    – Khan
    Commented Jun 25, 2015 at 9:11
  • $\begingroup$ (1) Yes. Use the function argument just like a vector. This is more complicated to do in Stata than the other languages (2) Yes. Call the determinant within the function definition. Once again, more complicated in Stata. (3) That's a whole other question! :) $\endgroup$
    – philE
    Commented Jun 25, 2015 at 16:05

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.