diff --git a/notebooks/Model Comparison/MC_2_1.ipynb b/notebooks/Model Comparison/MC_2_1.ipynb index a774090d77a961ee60c53dddbeb87a69b4536f01..d66ef907f60eeb5c57e2e2172cc83c8eda0f1089 100644 --- a/notebooks/Model Comparison/MC_2_1.ipynb +++ b/notebooks/Model Comparison/MC_2_1.ipynb @@ -2,7 +2,9 @@ "cells": [ { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "tags": [] + }, "source": [ "# Bayes-Faktor für Münzwurf" ] @@ -20,20 +22,11 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 13, "metadata": { "tags": [] }, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "Matplotlib is building the font cache; this may take a moment.\n", - "WARNING (pytensor.tensor.blas): Using NumPy C-API based implementation for BLAS functions.\n" - ] - } - ], + "outputs": [], "source": [ "%matplotlib inline\n", "import pymc as pm\n", @@ -49,7 +42,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 14, "metadata": { "tags": [] }, @@ -126,7 +119,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 12, "metadata": { "tags": [] }, @@ -135,13 +128,13 @@ "name": "stdout", "output_type": "stream", "text": [ - "<xarray.DataArray 'log_marginal_likelihood' ()> Size: 8B\n", - "array(11.16)\n" + "11.16\n" ] } ], "source": [ - "print(np.round(np.exp(trace_smc_0.sample_stats[\"log_marginal_likelihood\"].mean() - trace_smc_1.sample_stats[\"log_marginal_likelihood\"].mean()),2))" + "BF_smc = np.exp(trace_smc_0.sample_stats[\"log_marginal_likelihood\"].mean() - trace_smc_1.sample_stats[\"log_marginal_likelihood\"].mean())\n", + "print(np.round(BF_smc.item(),2))" ] }, { @@ -158,7 +151,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 15, "metadata": { "tags": [] }, @@ -229,7 +222,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 16, "metadata": { "tags": [] }, @@ -238,13 +231,13 @@ "name": "stdout", "output_type": "stream", "text": [ - "<xarray.DataArray 'log_marginal_likelihood' ()> Size: 8B\n", - "array(0.68)\n" + "11.21\n" ] } ], "source": [ - "print(np.round(np.exp(trace_BF_0.sample_stats[\"log_marginal_likelihood\"].mean() - trace_BF_1.sample_stats[\"log_marginal_likelihood\"].mean()),2))" + "BF_smc = np.exp(trace_smc_0.sample_stats[\"log_marginal_likelihood\"].mean() - trace_smc_1.sample_stats[\"log_marginal_likelihood\"].mean())\n", + "print(np.round(BF_smc.item(),2))" ] } ],