def dlogpdf_dlink_dvar(self, link_f, y, Y_metadata=None):
c = np.zeros_like(y)<EOL>if Y_metadata is not None and '<STR_LIT>' in Y_metadata.keys():<EOL><INDENT>c = Y_metadata['<STR_LIT>']<EOL><DEDENT>val = np.log(y) - link_f<EOL>val_scaled = val/np.sqrt(self.variance)<EOL>val_scaled2 = val/self.variance<EOL>a = (<NUM_LIT:1> - stats.norm.cdf(val_scaled))<EOL>uncensored = (<NUM_LIT:1>-c)*(-val/(self.variance**<NUM_LIT:2>))<EOL>censored = c * (-val*np.exp(-val**<NUM_LIT:2>/self.variance)/( <NUM_LIT:4>*np.pi*(self.variance**<NUM_LIT:2>)*(a**<NUM_LIT:2>)) +<EOL>(-<NUM_LIT:1> + (val**<NUM_LIT:2>)/self.variance)*np.exp(-val**<NUM_LIT:2>/(<NUM_LIT:2>*self.variance) ) /<EOL>( a*(np.sqrt(<NUM_LIT>*np.pi)*<NUM_LIT:2>*self.variance**<NUM_LIT>)) )<EOL>dlik_grad_dsigma = uncensored + censored<EOL>return dlik_grad_dsigma<EOL>
:param link_f: latent variables link(f)
:type link_f: Nx1 array
:param y: data
:type y: Nx1 array
:param Y_metadata: Y_metadata not used in gaussian
:returns: derivative of log likelihood evaluated at points link(f) w.r.t variance parameter
:rtype: Nx1 array