def df_obs(x, *args):
 (sslm, word_counts, totals, mean_deriv_mtx, word, deriv) = args
 sslm.obs[word] = x
 (sslm.mean[word], sslm.fwd_mean[word]) = sslm.compute_post_mean(word, sslm.chain_variance)
 model = 'DTM'
 if (model == 'DTM'):
  deriv = sslm.compute_obs_deriv(word, word_counts, totals, mean_deriv_mtx, deriv)
 elif (model == 'DIM'):
  deriv = sslm.compute_obs_deriv_fixed(p.word, p.word_counts, p.totals, p.sslm, p.mean_deriv_mtx, deriv)
 return np.negative(deriv)

def df_obs ( x , * args ) : ( sslm , word_counts , totals , mean_deriv_mtx , word , deriv ) = args sslm . obs [ word ] = x ( sslm . mean [ word ] , sslm . fwd_mean [ word ] ) = sslm . compute_post_mean ( word , sslm . chain_variance ) model = 'DTM' if ( model == 'DTM' ) : deriv = sslm . compute_obs_deriv ( word , word_counts , totals , mean_deriv_mtx , deriv ) elif ( model == 'DIM' ) : deriv = sslm . compute_obs_deriv_fixed ( p . word , p . word_counts , p . totals , p . sslm , p . mean_deriv_mtx , deriv ) return np . negative ( deriv )
derivative of function which optimises obs .