Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def expected_x(self):
return self.mu + \
np.sqrt(self.sigmasq) * (normal_pdf(self.zlb) - normal_pdf(self.zub))/self.Z
def variance_x(self):
trm1 = (np.nan_to_num(self.zlb) * normal_pdf(self.zlb) -
np.nan_to_num(self.zub) * normal_pdf(self.zub)) / self.Z
trm2 = ((normal_pdf(self.zlb) - normal_pdf(self.zub)) / self.Z)**2
return self.sigmasq * (1 + trm1 - trm2)
def variance_x(self):
trm1 = (np.nan_to_num(self.zlb) * normal_pdf(self.zlb) -
np.nan_to_num(self.zub) * normal_pdf(self.zub)) / self.Z
trm2 = ((normal_pdf(self.zlb) - normal_pdf(self.zub)) / self.Z)**2
return self.sigmasq * (1 + trm1 - trm2)