# Sandwich estimator in terms of score and hessian

Suppose that though it's assumed $$Y|X$$ is distributed $$p(Y|X)$$ it's actually distributed $$q(Y|X)$$ where p and q are two different distributions with the same support. Let $$\mu$$ be the conditional mean for either p or q, i.e. $$E(Y|X)=\mu$$. Use $$\mu=g^{-1}(X^T\beta)$$ where g() is the link function, and assume that even though p is wrong, that is the correct specification for the conditional mean.

Given that $$p \ne q$$, will your MLE estimates of $$\beta$$ be consistent? My answer: no (the likelihood function is wrong).

Write out the sandwich estimator as a function of the score and/or hessian. Does it simplify in this case to the variance estimate we used when we assumed the MLE assumptions were correct? Why or why not?

I've written the sandwich estimator as, where n is the sample size, in matrix notation: $$A^{-1}BA^{-1}=\displaystyle \left(-\sum_{k=1}^nh_k\right)^{-1}\left(\sum_{k=1}^n s_k s_k^T\right)\left(-\sum_{k=1}^nh_k\right)^{-1}$$

or in component wise notation

$$A^{-1}BA^{-1}=\displaystyle \left(-\sum_{k=1}^nh_{ijk}\right)^{-1}\left(\sum_{k=1}^n s_{ik} s_{jk}\right)\left(-\sum_{k=1}^nh_{ijk}\right)^{-1},i,j=1,...,P$$

Apparently these are supposed to turn out to $$A^{-1}BA^{-1}=A^{-1}$$ but I'm not sure how? The lecture notes say under correct specification, $$A=B$$