def var(self): try: return self._var except AttributeError: return square(self.std)
def _pdf(self, x): return (1 / (np.pi * self.scale * (1 + square( (x - self.loc) / self.scale))))
def tau(self): try: return self._tau except AttributeError: return 1 / square(self.std)
def _pdf(self, x): return ( exp(-0.5 * square((x - self.mu) / self.std)) / sqrt(2 * np.pi) / self.std )
def forward(self): eps = normal(0, 1, (self.ndim, ) + self.std.shape) return sqrt(square(self.std * eps).sum(axis=0))
def _log_pdf(self, x): return ((self.ndim - 1) * log(x) - 0.5 * square(x / self.std) - self.ndim * log(self.std) - np.log(sp.gamma(0.5 * self.ndim)))
def _pdf(self, x): gauss = (exp(-0.5 * square( (x - self.mu) / self.std)) / sqrt(2 * np.pi) / self.std) return (self.coef * gauss).sum(axis=self.axis)
def _log_pdf(self, x): return ( -np.log(np.pi) - log(self.scale) - log(1 + square((x - self.loc) / self.scale)) )
def _pdf(self, x): return (exp(-0.5 * square( (x - self.mu) / self.std)) / sqrt(2 * np.pi) / self.std)
def var(self): return square(self.parameter["std"])
def _pdf(self, x): gauss = ( exp(-0.5 * square((x - self.mu) / self.std)) / sqrt(2 * np.pi) / self.std ) return (self.coef * gauss).sum(axis=self.axis)
def _log_pdf(self, x): return (-np.log(np.pi) - log(self.scale) - log(1 + square((x - self.loc) / self.scale)))
def kl_gaussian(q, p): qvar = square(q.std) pvar = square(p.std) return log(p.std) - log(q.std) + 0.5 * (qvar + square(p.mean - q.mean)) / pvar - 0.5
def _pdf(self, x): return ( 1 / (np.pi * self.scale * (1 + square((x - self.loc) / self.scale))) )