di as result ///
"This code was written by Anson Soderbery to accompany the paper " _newline ///
"Estimating Import Supply and Demand Elasticities: Analysis and Implications." _newline ///
"Code was last updated on 4/4/13."
mata
mata clear
// LIML SEARCH OVER SIGMA AND RHO
real LIML2( todo, real vector d , real vector Y ,real matrix X ,real matrix Z ,Q, g ,H) {
ZZ = invsym( cross( Z , Z ) ) * Z'
P = Z * ZZ
theta0= d[1]
theta1 = d[3] / ( (1 - d[3])*(d[2] - 1)^2 )
theta2 = (2*d[3] - 1) / ( (1 - d[3])*(d[2] - 1) )
// CONSTRAIN SIGMA>1 AND 0