In the Portilla Simoncelli paper (page 18):
<http://www.cns.nyu.edu/pub/lcv/portilla99-reprint.pdf>


They go about calculating the derivative of the skewness $\eta(x)$ of a distribution (2D matrix in the case of an image: $x$) through the following expression:


$\eta(x) = \frac{\mu\_3(x)}{\mu\_2(x)^{1.5}}$


where $\mu\_2(x)$ is the variance and $\mu\_1(x)$ is the mean, which they set to zero for their calculations.


The problem I am having is that when they calculate:


$\frac{d\eta\_3(x)}{dx(i,j)} = \frac{3(x^2(i,j)-\mu(x)^{0.5}\eta(x) x(i,j) -\mu\_2(x))}{|L|\mu\_2^{3/2}}$,


where $x(i,j)$ is an individual element of the matrix $x$, is that I don't get the $-\mu\_2(x)$ term.


So far I have this:


$\frac{\partial \mu\_3(x)}{\partial x(i,j)} = \frac{3x^2(i,j)-6x(i,j) + 3\mu\_1^2}{|L|}$


$\frac{\partial \mu\_2(x)}{\partial x(i,j)} = \frac{2(x(i,j)-\mu\_1(x))}{|L|}$


Then:
$\frac{d\eta\_3(x)}{dx(i,j)} = \frac{\frac{\partial \mu\_3(x)}{\partial x(i,j)} \mu\_2(x) - \mu\_3(x)\frac{\partial \mu\_2(x)^{1.5}}{\partial x(i,j)}}{\mu\_2^3(x)}$


Replacing with the previsouly calculated expressions I get:
$\frac{d\eta\_3(x)}{dx(i,j)} = \frac{3x(i,j)^2 \mu\_2^{1.5} - \mu\_2^{0.5}(x)\mu\_3(x)3 x(i,j)}{|L|\mu\_2^3(x)}$


Then I replace with the definition of $\eta(x) = \frac{\mu\_3(x)}{\mu\_2(x)^{1.5}}$, and with $\mu\_1(x)=0$ to get back where I started from. Where's my missing $\mu\_2(x)$ Did I oversimplify somewhere?



Computing skewness derivative in terms of variance
I just read the same paper. Initially I made the same mistake as you, which is how I came across your question. It's been more than a year since your post but, in case you are still curious, here is how to work out the derivation. The key is to properly compute $\frac{\partial \mu\_n}{\partial x\_{ij}}$ for n=2,3, which requires pulling $x\_{ij}$ out from the sum:


$$
\begin{align}
\frac{\partial \mu\_n}{\partial x\_{ij}} &= \frac{1}{L} \frac{\partial}{\partial x\_{ij}}\Big(\sum\_{p,q \neq i,j}(x\_{pq} - \mu\_1)^n + (x\_{ij}-\mu\_1)^n\Big)\\
&= \frac{1}{L} \Big(\sum\_{p,q \neq i,j}-n(x\_{pq} - \mu\_1)^{n-1} \frac{\partial}{\partial x\_{ij}} \mu\_1 + n(x\_{ij}-\mu\_1)^{n-1}(1-\frac{\partial}{\partial x\_{ij}} \mu\_1)\Big)\\
&= \frac{1}{L} \Big(\frac{-n}{L}\sum\_{p,q\neq i,j} (x\_{pq} - \mu\_1)^{n-1} + n(x\_{ij}-\mu\_1)^{n-1}\frac{(L-1)}{L}\Big)\\
&= \frac{1}{L} \Big(\frac{-n}{L} \sum\_{p,q} x\_{pq}^{n-1} + n x^{n-1}\_{ij}\Big) \quad \textrm{[use fact that }\mu\_1=0]\\
&= \frac{n}{L}(x^{n-1}\_{ij} - \mu\_{n-1})
\end{align}
$$


Subbing the above into:


$$\frac{\partial \eta(x)}{\partial x\_{ij}} = \mu^{-3/2}\_2\frac{\partial \mu\_3}{\partial x\_{ij}} - \frac{3}{2}\mu\_3\mu^{-5/2}\_2\frac{\partial \mu\_2}{\partial x\_{ij}}$$


Gives:


$$\frac{\partial \eta(x)}{\partial x\_{ij}} = \mu^{-3/2}\_2\frac{3}{L}(x^2\_{ij} - \mu\_2) - \frac{3}{2}\mu\_3\mu^{-5/2}\_2\frac{2}{L}x\_{ij}$$


Factoring out $\mu^{-3/2}\_2\frac{3}{L}$ gives:


$$\frac{\partial \eta(x)}{\partial x\_{ij}} = \mu^{-3/2}\_2\frac{3}{L}(x^2\_{ij} - \eta(x)\mu^{1/2}\_2 x\_{ij} - \mu\_2)$$


which is the what is reported in the paper.


