# Derivatives of Cauchy Distribution

1. Jun 23, 2010

### riemann01

Hi guys,

I would like to ask you where you spot the mistake in the derivatives of the loglikelihood function of the cauchy distribution, as I am breaking my head :( I apply this to a newton optimization procedure and got correct m, but wrong scale parameter s. Thanks!

$$LLF = -n\ln(pi)+n\ln(s)-\sum(\ln(s^2+(x-m)^2)),$$

First Derivatives:
$$\frac {dL} {dm} = 2\sum(x-m) / \sum(s^2+(x-m)^2)$$
$$\frac {dL} {ds} = n/s - 2\sum(s) / \sum(s^2+(x-m)^2)$$

Second Derivatives:
$$\frac {d^2L} {dm^2} = (-2n(\sum(s^2+(x-m)^2)))+4\sum(x-m)^2)/(\sum(s^2+(x-m)^2))^2$$
$$\frac {d^2L} {ds^2} =-n/s^2-2\sum(-s^2+(x-m)^2)/(\sum(s^2+(x-m)^2))^2$$
$$\frac {d^2L} {dmds} =-4\sum(s(x-m))/(\sum(s^2+(x-m)^2))^2$$

2. Jun 23, 2010

I would point out that if you have a term like this:

$$\sum_{i=1}^n {\left(\ln (10 + x_i^2)\right)}$$

then the first derivative is

$$\sum_{i=1}^n {\frac{2x_i}{10+x_i^2}$$

and not

$$\frac{\sum_{i=1}^n {2x_i}}{\sum_{i=1}^n (10+x_i^2)}$$

3. Jun 23, 2010

### riemann01

Thanks for the reply statdad, you are correct but x is known and is a data set, what we are looking is m and s, for instance:

$$\sum \frac{1}{10+(x-m)^2}, -\sum \frac{-2(x-m)}{(10+(x-m)^2)^2}$$

The first - comes from the formula of fraction differentiation and the second minus from differentiating the (x-m).

Last edited: Jun 23, 2010
4. Jun 23, 2010

$$\frac{dL}{dm} = \frac{2\sum{(x-m)}}{\sum{(10+(x-m)^2)^2}}$$
I made a poor choice in using $x_i$ in my example - I was merely trying to hint that you can't distribute the sum to numerator and denominator. My point was this: if you are starting with the first derivatives as written, the fact that they (seem to be, in the typing of your first post) incorrect could be the cause of your subsequent problem.