<p>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. <a href="http://www.steenbergen.ch/uploads/3/1/9/5/3195968/statamle.pdf" rel="nofollow">Here</a> is a primer for doing this in Stata and <a href="http://polisci2.ucsd.edu/dhughes/teaching/MLE_in_R.pdf" rel="nofollow">here</a> 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.</p>

CC BY-SA 3.0
2015-06-25T09:11:31.327Z
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!!
Khan
CC BY-SA 3.0
2015-06-25T16:05:32.427Z
(1) Yes. Use the function argument just like a vector. This is more complicated to do in [Stata](http://www.stata.com/manuals13/rml.pdf) than the other languages (2) Yes. Call the determinant within the function definition. Once again, more complicated in [Stata](http://www.philender.com/courses/multivariate/notes/matmata.html). (3) That's a whole other question! :)
philE
CC BY-SA 3.0
2015-06-25T01:34:01.987Z
2015-06-25T01:34:01.987Z
philE
<p>I am interested in understanding the algorithm/methodology of the WGI  (the most cited and popular corruption/governance) <a href="http://info.worldbank.org/governance/wgi/index.aspx#doc" rel="nofollow">World Bank Methodology</a>. 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 <a href="http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1148386" rel="nofollow" title="Governance Matters VII: Aggregate and Individual Governance Indicators, 1996-2007">Governance Matters VII: Aggregate and Individual Governance Indicators, 1996-2007</a></p>

<p>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. </p>

<p>Can anyone help and refer me to some statistical packages?</p>

<econometrics><software><stata>
What is the statistical program used in the Worldwide Governance Indicators?
Khan
# What is the statistical program used in the Worldwide Governance Indicators?

(Asked by: username_0 on 2015-06-24)

I am interested in understanding the algorithm/methodology of the WGI (the most cited and popular corruption/governance) [World Bank Methodology](http://info.worldbank.org/governance/wgi/index.aspx#doc). 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](http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1148386 "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?

**Tags:** econometrics, software, stata

---

## 1 answers

### Answer by username_1 on 2015-06-25. Score: 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](http://www.steenbergen.ch/uploads/3/1/9/5/3195968/statamle.pdf) is a primer for doing this in Stata and [here](http://polisci2.ucsd.edu/dhughes/teaching/MLE_in_R.pdf) 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.

> **Comments:**
> **username_0**: 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!!  
> **username_1**: (1) Yes. Use the function argument just like a vector. This is more complicated to do in [Stata](http://www.stata.com/manuals13/rml.pdf) than the other languages (2) Yes. Call the determinant within the function definition. Once again, more complicated in [Stata](http://www.philender.com/courses/multivariate/notes/matmata.html). (3) That's a whole other question! :)  

---

