Computes the log-likelihood function. Only two groups are considered, since as presented in Ebbes et al (2005) this gives good, unbiased results.
logL(theta, y, P)
- a vector of initial values for the parameters of the model to be supplied to the optimization algorithm.
- a vector or matrix containing the dependent variable.
- a vector with the endogeneous variable or a matrix of dimention n X 2, where each column contains an endogeneous variable
returns the value of the negative log-likelihood.
Ebbes, P., Wedel,M., Boeckenholt, U., and Steerneman, A. G. M. (2005). 'Solving and testing for regressor-error (in)dependence when no instruments