def __call__(self, *args): """Returns Pr(mu, var), i.e., the prior density.""" if len(args) == 2: mu, var = args elif len(args) == 1: mu = args[0]['mu'] var = args[0]['var'] return (normal_density(self.mu_0, var/self.kappa_0, mu) * scaled_IX_density(self.nu_0, self.sigsqr_0, var))
def marginal_var(self, var): """Return Pr(var)""" # Don't have an independent source for this, so convert params to NIX and use that result. nu_0 = 2*self.a_0 sigsqr_0 = 2*self.b_0/nu_0 return scaled_IX_density(nu_0, sigsqr_0, var)
def marginal_var(self, var): """Return Pr(var)""" return scaled_IX_density(self.nu_0, self.sigsqr_0, var)