I was looking at the r package called rugarch (docs) also mentioned in this question and in the Matlab Guide but I cannot see any example of how the likelihood or log-likelihood is computed when external covariates are included (as for a regression with GARCH error term or even an ARMAX model). In particular, when we have external covariates, I don't know whether we have to write the likelihood conditionally on $t-1$ or conditionally on $t-1$ and covariates $x_{t}$ ?
More details are provided as follows. Since, I am interested in the case where you have external covariates, consider a regression model model with GARCH error term (but I could have used an ARMAX) of the kind $$y_{t}=\beta x_{t} + e_{t}$$ with $e_{t}=\sigma_{t} Z_{t}$ and $Z_{t} \sim N(0,1)$ where $\sigma_{t}$ is a matrix of appropriate size resulting from the Cholesky decomposition of the conditional covariance matrix $\sigma_{t}^{2}$, $\sigma_{t}^{2}$ follows a GARCH process. Here I have written a regression with GARCH error term, but the same problem happens when I try to use a ARMAX model, so it is a more general problem that relates to the presence of external covariates $x_{t}$ more than to the shape of the error term.
Indeed, my question is: which is the correct likelihood function and, in particular, the correct conditional variance to be used in the likelihood function? Is it $Var(y_{t}|t-1, x_{t-1})$ because we calculate the time-t conditional pdf as $L(y_{t} |t-1,x_{t})$ so that we condition on both $t-1$ info set and external covariates? Or instead we have to condition on time t-1 only and write the likelihood as $L(y_{t} |t-1)$? So that the conditional variance to be used becomes the conditional variance of residuals $Var(e_{t}|t-1)=Var(y_{t}-\beta x_{t}|t-1)$?.
More precisely, if we have to condition on $t-1$ only, then, applying conditional expectations, we have $E(y_{t}|t-1)=E(x_{t}+\beta x_{t}|t-1)=0$ which in my case is 0 because I do not have any conditional mean structure on any variable. Then the conditional variance is $Var(y_{t}|t-1)=Var(e_{t}+\beta x_{t}|t-1)$ and the time-t pdf conditionally on $t-1$ becomes:
$$L(y_{t}|t-1)=(2 \pi)^{-k/2} Var(y_{t}|t-1))^{-1/2} e^{-1/2 (y_{t}^{T} Var(y_{t}|t-1)^{-1} (y_{t})}$$
BUT, if we have to condition on both $t-1$ and external covariates $x_{t}$, then the conditional variance term would change from $Var(y_{t}|t-1)$ into $Var(y_{t}|t-1, x_{t})$ as, if we condition on $t-1$ then $x_{t}$ becomes non-stochastic. The time-t pdf used in the likelihood would be:
$$L(y_{t}|t-1, x_{t})=(2 \pi)^{-k/2} det(Var(y_{t}|t-1))^{-1/2} e^{-1/2 (y_{t}-\beta x_{t})^{t} Var(y_{t}|t-1)^{-1} (y_{t}-\beta x_{t})}$$
which, substituting $Var(y_{t}|t-1, x_{t})=Var(e_{t}|t-1, x_{t})=Var(e_{t}|t-1)=\sigma_{t}^{2}$, becomes
$$L(y_{t}|t-1, x_{t})=(2 \pi)^{-k/2} det(\sigma_{t}^{2})^{-1/2} e^{-1/2 (y_{t}-\beta x_{t})^{t} \sigma_{t}^{2 -1} (y_{t}-\beta x_{t})}$$
Which is the correct one for the rugarch package? I am trying to check the docs of the library but I haven't found anything precise on this point.
Thank you