I want to estimate a beta-pricing CAPM model using a portfolio of 12 assets. I want to use the GMM approach proposed by Cochrane (2005, page 241-243):

Array

Here is my command (I simplify it now to three assets):

gmm (ex1 - {alpha1} - {beta1}*mktrf1) /// 1st moment
(ex2 - {alpha2} - {beta2}*mktrf2 ) ///
(ex3 - {alpha3} - {beta3}*mktrf3) ///
((ex1 - {alpha1} - {beta1}*mktrf1)*mktrf1) /// 2st moment
((ex2 - {alpha2} - {beta2}*mktrf2)*mktrf2) ///
((ex3 - {alpha3} - {beta3}*mktrf3)*mktrf3) ///
(ex1 - {beta1}*{lambda}) /// 3st moment
(ex2 - {beta2}*{lambda}) ///
(ex3 - {beta3}*{lambda}) , instruments(mktrf1) winit(identity) igmm nocommonesample

And I always get the error message "could not calculate numerical derivatives -- flat or discontinuous region encountered".

I searched already for a solution, in the stata forum you get the answer to simplify the model. I tried this. Immediately, when I throw out the third moments, it works! But I need of course the third moment. Can anybody help me out here? Is something wrong with my code?