Skip to content

Add MTMCMC #84

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Mar 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion bayesml/linearregression/_linearregression.py
Original file line number Diff line number Diff line change
Expand Up @@ -801,4 +801,18 @@ def calc_log_marginal_likelihood(self):
- np.linalg.slogdet(self.hn_lambda_mat)[1]
- self._n * np.log(2*np.pi)
)
)
)

def calc_pred_var(self):
"""Calculate the variance of the predictive distribution.

Returns
-------
var : float
The variance of the predictive distribution.
"""
if self.p_nu > 2:
return self.p_nu / self.p_lambda / (self.p_nu-2)
else:
warnings.warn("Variance of the predictive distribution cannot defined for the current p_nu.",ResultWarning)
return None
Loading