# Gradient calculation for proportional odds (logistic) model

I am trying to calculate a gradient for a proportional odds model. http://fa.bianp.net/blog/2013/logistic-ordinal-regression/

What steps are required to take the derivative with respect to w?

$$\mathcal{L}(w, \theta) = - \sum_{i=1}^n \log(\phi(\theta_{y_i} - w^T X_i) - \phi(\theta_{y_i -1} - w^T X_i))$$

Give that the derivative of a sigmoid function is the following: $$\log(\phi(t))^\prime = (1 - \phi(t))$$

I should get this, right?

$$\nabla_w \mathcal{L}(w, \theta) = \sum_{i=1}^n X_i (1 - \phi(\theta_{y_i} - w^T X_i) - \phi(\theta_{y_i-1} - w^T X_i))$$