def objGrad_v(v, sumLogPi, nDoc, gamma, alpha0):
  K = v.size
  beta = v2beta(v)
  dv_logpV = (1 - alpha0) / (1-v)

  dv_logpPi_const = np.zeros(K)
  psibeta = digamma(gamma*beta) * beta
  for k in xrange(K):
    Sk = -1.0*psibeta[k]/v[k] + np.sum( psibeta[k+1:]/(1-v[k]) )
    dv_logpPi_const[k] = nDoc * gamma * Sk

  dv_logpPi = np.zeros(K)
  sbeta = sumLogPi * beta
  for k in xrange(K):
    Sk = sbeta[k]/v[k] - np.sum( sbeta[k+1:]/(1-v[k]) )
    dv_logpPi[k] = gamma * Sk

  return -1.0* ( dv_logpV + dv_logpPi_const + dv_logpPi )
Returns K-vector gradient of the constrained objective
dataset/ETHPy150Open daeilkim/refinery/refinery/bnpy/bnpy-dev/bnpy/allocmodel/admix/OptimizerForHDPPE.py/objGrad_v