Skip to content
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
12 changes: 8 additions & 4 deletions notebooks/guides/results/aggregator/galaxies_fits.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,8 @@
"Using the API introduced in the first tutorial, we can also refit the data locally. \n",
"\n",
"This allows us to inspect how the tracer changes for models with similar log likelihoods. We create and plot\n",
"the tracer of the tenth-last accepted model by Nautilus."
"the tracer of the tenth-last accepted model by Nautilus (clamped to the oldest stored sample when fewer are\n",
"available)."
]
},
{
Expand All @@ -280,7 +281,8 @@
"source": [
"samples = result.samples\n",
"\n",
"instance = samples.from_sample_index(sample_index=-10)\n",
"sample_index = max(-10, -len(samples.parameter_lists))\n",
"instance = samples.from_sample_index(sample_index=sample_index)\n",
"\n",
"# Input to FitImaging to solve for linear light profile intensities, see `start_here.py` for details.\n",
"tracer = al.Tracer(galaxies=instance.galaxies)\n",
Expand Down Expand Up @@ -376,7 +378,8 @@
"Using the API introduced in the first tutorial, we can also refit the data locally. \n",
"\n",
"This allows us to inspect how the fit changes for models with similar log likelihoods. Below, we refit and plot\n",
"the fit of the tenth-last accepted model by Nautilus."
"the fit of the tenth-last accepted model by Nautilus (clamped to the oldest stored sample when fewer are\n",
"available)."
]
},
{
Expand All @@ -385,7 +388,8 @@
"source": [
"samples = result.samples\n",
"\n",
"instance = samples.from_sample_index(sample_index=-10)\n",
"sample_index = max(-10, -len(samples.parameter_lists))\n",
"instance = samples.from_sample_index(sample_index=sample_index)\n",
"\n",
"tracer = al.Tracer(galaxies=instance.galaxies)\n",
"\n",
Expand Down
16 changes: 8 additions & 8 deletions notebooks/guides/results/aggregator/samples.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,8 @@
"source": [
"print(\"All parameters of the very first sample\")\n",
"print(samples.parameter_lists[0])\n",
"print(\"The fourth parameter of the tenth sample\")\n",
"print(samples.parameter_lists[9][3])"
"print(\"The fourth parameter of the final sample\")\n",
"print(samples.parameter_lists[-1][3])"
],
"outputs": [],
"execution_count": null
Expand All @@ -344,18 +344,18 @@
"- The `weight` gives information on how samples are combined to estimate the posterior, which depends on type of search\n",
" used (for `Nautilus` they are all non-zero values which sum to 1).\n",
"\n",
"Lets inspect these values for the tenth sample."
"Lets inspect these values for the final sample."
]
},
{
"cell_type": "code",
"metadata": {},
"source": [
"print(\"log(likelihood), log(prior), log(posterior) and weight of the tenth sample.\")\n",
"print(samples.log_likelihood_list[9])\n",
"print(samples.log_prior_list[9])\n",
"print(samples.log_posterior_list[9])\n",
"print(samples.weight_list[9])"
"print(\"log(likelihood), log(prior), log(posterior) and weight of the final sample.\")\n",
"print(samples.log_likelihood_list[-1])\n",
"print(samples.log_prior_list[-1])\n",
"print(samples.log_posterior_list[-1])\n",
"print(samples.weight_list[-1])"
],
"outputs": [],
"execution_count": null
Expand Down
16 changes: 8 additions & 8 deletions notebooks/guides/results/aggregator/samples_via_aggregator.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,8 @@
"for samples in agg.values(\"samples\"):\n",
" print(\"All parameters of the very first sample\")\n",
" print(samples.parameter_lists[0])\n",
" print(\"The third parameter of the tenth sample\")\n",
" print(samples.parameter_lists[9][2])\n",
" print(\"The third parameter of the final sample\")\n",
" print(samples.parameter_lists[-1][2])\n",
" print()"
],
"outputs": [],
Expand Down Expand Up @@ -280,19 +280,19 @@
"- The `weight` gives information on how samples are combined to estimate the posterior, which depends on type of search\n",
" used (for `Nautilus` they are all non-zero values which sum to 1).\n",
"\n",
"Lets inspect these values for the tenth sample of each of the 3 model-fits."
"Lets inspect these values for the final sample of each of the 3 model-fits."
]
},
{
"cell_type": "code",
"metadata": {},
"source": [
"for samples in agg.values(\"samples\"):\n",
" print(\"log(likelihood), log(prior), log(posterior) and weight of the tenth sample.\")\n",
" print(samples.log_likelihood_list[9])\n",
" print(samples.log_prior_list[9])\n",
" print(samples.log_posterior_list[9])\n",
" print(samples.weight_list[9])"
" print(\"log(likelihood), log(prior), log(posterior) and weight of the final sample.\")\n",
" print(samples.log_likelihood_list[-1])\n",
" print(samples.log_prior_list[-1])\n",
" print(samples.log_posterior_list[-1])\n",
" print(samples.weight_list[-1])"
],
"outputs": [],
"execution_count": null
Expand Down
4 changes: 2 additions & 2 deletions notebooks/guides/results/database/start_here.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -537,8 +537,8 @@
"metadata": {},
"source": [
"for samples in agg.values(\"samples\"):\n",
" print(\"The tenth sample`s third parameter\")\n",
" print(samples.parameter_lists[9][2], \"\\n\")"
" print(\"The final sample`s third parameter\")\n",
" print(samples.parameter_lists[-1][2], \"\\n\")"
],
"outputs": [],
"execution_count": null
Expand Down
Loading