# Maximum Likelihood Estimation with Laplace Distribution

I want to estimate the parameters $a$ and $b$ of the model $y_i = ax_i + b + \varepsilon_i, i=1,...,n$ via Maximum Likelihood. The $\varepsilon_i$ are assumed to be Laplace-distributed with density $f(x) = \frac{2}{\beta}\exp\left(\frac{\vert x\vert}{\beta}\right)$, and therefore $y_i \sim \text{Laplace}(\beta, \mu=ax_i + b)$.

Maximizing the log-likelihood over a and b is then equivalent to minimizing $\sum_{i=1}^n \vert y_i - ax_i -b \vert$ I've come up with the following partial derivatives of the log-Likelihood l:

$$\frac{\partial l}{\partial a} = c*\sum_{i=1}^n -\text{sgn}(y_i-ax_i-b)x_i \\ \frac{\partial l}{\partial b} = c*\sum_{i=1}^n -\text{sgn}(y_i-ax_i-b) \\$$

Edited: It seems to me, that $$\hat{b} = min \{b \in \mathbb{R}: \sum_{i=1}^{n}\frac{\mathbb{1}\{y_i-ax_i\leq b \}}{n}\geq \frac{1}{2}\}$$ Whereas $a$ has to be a solution of: $$\sum_{i=1}^{n} \mathbb{1}\{y_i- \hat{b} \geq ax_i\}x_i = \sum_{i=1}^{n}\mathbb{1}\{y_i- \hat{b} < ax_i\}x_i$$

Any ideas?