Writing the likelihood and conditional variance in a ARMAX model or regression with GARCH (R rugarch with external covariates) 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
 A: From sources:
source 0 MARSS State Space Models pag. 3 and 22 for the likelihood of a generic MARSS model in State Space form without and with external covariates (the latter is referred to expectation maximization algorithm but provides the likelihood for a generic model represented in State Space form that involves external covariances, in addition to endogenous variables).
source 1 likelihood for kalman Filter with exogenous regressors
source 2 ARMAX pag.5
source 3 Dynamic Regression likelihood
In case some exogenous regressors are added to a time-series, then the likelihood must be computed conditionally on t-1 and covariates (that are indeed assumed to be exogenous!).
So given the generic dynamic regression (here with GARCH error term described by $\sigma_{t}^{2}$ which is not described any further for brevity!)
$$y_{t}=\beta x_{t} + e_{t}$$
with $e_{t}=\sigma_{t} Z_{t}$ and $Z_{t} \sim N(0,1)$.
Let’s compute the conditional moments: 
$$E(y_{t}|t-1, x_{t})= \beta x_{t}$$
$$Var(y_{t}|t-1, x_{t})=Var(\beta x_{t}+e_{t}|t-1, x_{t})=Var(e_{t}|t-1, x_{t})=Var(e_{t}|t-1)=\sigma_{t}^{2}$$
Then the time-t likelihood expression, given both the info set at time t-1 and the external regressors becomes
$$L(y_{t}|t-1, x_{t})=(2 \pi)^{-k/2} det(Var(y_{t}|t-1, x_{t}))^{-1/2} e^{-1/2   E(y_{t}|t-1, x_{t})^{T}  Var(y_{t}|t-1, x_{t})^{-1} E(y_{t}|t-1, x_{t})} \rightarrow$$
$$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})}$$
P.S. however if you disagree, please notify me and inprove the answer
A: I do not know more about rugarch than can be found in its documentation, so I will not be of help clarifying the finer details of its model specifications. 
Regarding conditioning in general, I would condition on the information I have. E.g. if I have $x_t$ when modelling $\sigma_t^2$, I would condition on it; if not, then not. I would start from deciding on what model I want to use and what information I have and then define the likelihood accordingly. An example of my thinking: if you have $x_t$ in your equation for $\sigma_t^2$ or some other place as a regressor, include it in the likelihood. If you do not want it included in the likelihood, re-express the model so as to exclude $x_t$ from it. 
