Originally I posted this on Quantitative Finance SE here but got no response. Months later, I am posting it here hoping for better luck.
Suppose we are given a dataset with $T$ time periods and $N$ assets or portfolios. We are interested in estimating and testing an augmented CAPM or a multifactor model with an additional factor: the asset's idiosyncratic volatility. In the case of the augmented Capital Asset Pricing Model (CAPM), the model is $$ \mu^*_{i}=\beta_i \mu^*_{m}+\gamma\sigma_i^2 \tag{4} $$ where $\mu^*_i:=(\mu_{i,t}-r_{f,t})$ is firm's $i$ expected excess return, $\mu^*_{m}:=(\mu_{m,t}-r_{f,t})$ is the market's expected excess return and $\sigma_i^2$ is the idiosyncratic risk of asset $i$ w.r.t. to the CAPM.$\color{red}{^*}$ That is, $\sigma_i^2$ is the error variance of a time series regression $$ r^*_{i,t}=\alpha_i+\beta_i r^*_{m,t}+\varepsilon_{i,t}. \tag{2} $$ We could estimate the model Fama-MacBeth style as discussed in this thread. However, I want to do that using the GMM. How would I set that up?
$\color{red}{^*}$For simplicity, $\mu^*_i$, $\mu^*_{m}$ and $\sigma_i^2$ are assumed to be constant over time.