What are the assumptions of MLE and how to test them using residuals? When using ordinary least square (OLS) method, there are certain residual diagnostics that need to be performed.
In a similar manner, what diagnostics should be performed when using Maximum Likelihood Estimation (MLE) when fitting a model?
 A: A typical testable assumption would be that the errors of the model are i.i.d. Then the likelihood of the vector (corresponding to a sample) of the dependent variable is the product of the individual likelihoods of each element in the vector, or equivalently, the log-likelihood of the vector of the dependent variable is the sum of the individual log-likelihoods of each element in the vector. This feature is typically used in formulating the likelihood function.
You can test the assumption using residuals. People usually look for violations of independence (though it is also possible to inspect the "identically distributed" part of the i.i.d. assumption, too). Thus they seek patterns in the residuals revealing some sort of dependence. E.g. in a time series setting, these could be nonzero autocorrelation, autoregressive conditional heteroskedasticity, level shifts and changes of the unconditional variance, among other. Tests such as Ljung-Box, Breusch-Godfrey, ARCH-LM and various structural breaks tests are used for detecting these types of dependence.
Then there are some regularity conditions (see Wikipedia) to ensure nice behavior such as consistency and asymptotic normality of the MLE, but I do not know if any of them are tested using residuals.
A: When performing MLE, model parameters $\Theta$ are optimised according to the likelihood $p(D|\Theta)$, where $p(D|\Theta)$ is calculated according to the assumed likelihood structure -> data-generating process. There is a large large number of such processes (and consequently likelihoods -> models) available, including likelihoods for which residuals are expected to be heteroskedastic and / or correlated (see e.g. R package nlme).
If you want to test if your observed data / residuals fit to your model assumptions for a given likelihood, the general idea is that they should behave as you would expect, given your likelihood. For example, if you have a likelihood that assumes residual autocorrelation, you would expect your naive model residuals to have the same property.
How to best check this in practice depends a lot on which model we are talking about. For GLMMs in R, the R package DHARMa (disclaimer: I am the developer) may be a good starting point.
