How to estimate maximum liklihood of a custom log likelihood function? I am not very familiar with maximum likelihood estimation. 
But I would like to test the null hypothesis $\mu = 0, \sigma = 1, \rho  = 0$ by estimating the following model: $$z_t - \mu = \rho(z_{t-1} - \mu) + \epsilon_t $$
The log-likelihood function is 
$$ -\frac{1}{2} log(2\pi) -\frac{1}{2} log(\frac{\sigma^2}{(1-\rho^2)}) - \frac{(z_1 - \mu/(1-\rho))^2}{2\sigma^2/(1-\rho^2)} \\
- \frac{T-1}{2}
log(2\pi) - \frac{T-1}{2} log(\sigma^2) - \sum^T_{i=2} \frac{(z_t - \mu - \rho z_{t-1} )^2}{2\sigma^2}$$
, where $\sigma^2$ is the variance of $\epsilon_t$
The likelihood ratio statistic is 
$$LR = -2(L(0,1,0) - L(\hat\mu, \hat\sigma, \hat\rho))$$
Under the null hypothesis, the test statistic is distributed $\chi^2(3)$.
Where do I begin and how do I best estimate it in Matlab? Thanks in advance!
 A: The Maximum-Likelihood-Mathod assumes that you have a random variable $X$ and a probability density function $f(x;\theta)$ which is parametrized by $\theta$ (in general there is more than one parameter, e.g. $\theta = (\mu, \sigma)$ for the univariate gaussian distribution).
If you have $N$ samples from your random variable $X$, you can assume they are i.i.d (independent & identically distributed). Now you can calculate the likelihood of your observation as function of $\theta$
$\mathcal{L}(\theta) = \prod_i^N f_{\theta}(x_i)$ or as log-likelihood $l(\theta) = \sum_i^N\text{log}\ f_{\theta}(x_i)$.
Now the maximum likelihood methods tries to find the parameter(s) $\theta$ that maximize the likelihood function $\mathcal{L}$ resp. the log-likelihood function $l$,
$\hat{\theta} = \underset{\theta}{\text{arg max}}\ \mathcal{L}(\theta)$ or $\hat{\theta} = \underset{\theta}{\text{arg max}}\ \mathcal{l}(\theta)$.
This is usually done b setting the derivative of the likelihood function with respect to $\theta$ to zero, $\frac{\partial \mathcal{L}}{\partial \theta} = 0$, and solving for $\theta$. Since you already have a log-likelihood function, you can pick up from there to find $\hat{\theta}$.
Edit: To make sure you have a maximum and not a minimum, also check that the second derivative satisfies $\frac{\partial^2\mathcal{L}}{\partial \theta^2} < 0$.
