Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: re: Linear regression using Mata optimize


From   Christopher Baum <baum@bc.edu>
To   statalist@hsphsun2.harvard.edu
Subject   st: re: Linear regression using Mata optimize
Date   Tue, 10 Feb 2009 09:29:10 -0500

<>
Nicola said

My question is why I'm not getting the correct variance-covariance matrix in the example below (simple linear regression) when using optimize_result_V(S).
(snip)

From help mata optimize():

optimize_result_V_oim(), optimize_result_V_opg(), optimize_result_V_robust()

        real matrix optimize_result_V_oim(S)

        real matrix optimize_result_V_opg(S)

        real matrix optimize_result_V_robust(S)

These functions return the variance matrix of p evaluated at p equal to optimize_result_param(). These functions are relevant only for maximization of log-likelihood functions but may be called in any context, including minimization.



Your Mata code does not maximize a log-likelihood function; it maximizes the negative of the error sum of squares. If you wrote the objective function as the log-likelihood function for a linear regression, the variance matrix returned by these functions would correspond to that of OLS regression.

Kit Baum, Boston College Economics and DIW Berlin
http://ideas.repec.org/e/pba1.html
An Introduction to Modern Econometrics Using Stata:
http://www.stata-press.com/books/imeus.html

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index