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
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@
"plt.plot(xvalues, normalized_residual_map, color=\"k\")\n",
"plt.title(f\"Normalized Residuals (log likelihood = {result.log_likelihood})\")\n",
"plt.xlabel(\"x values of profile\")\n",
"plt.ylabel(\"Normalized Residuals ($\\sigma$)\")\n",
"plt.ylabel(r\"Normalized Residuals ($\\sigma$)\")\n",
"plt.show()\n",
"plt.clf()\n",
"plt.close()"
Expand Down Expand Up @@ -834,7 +834,7 @@
"plt.plot(xvalues, normalized_residual_map, color=\"k\")\n",
"plt.title(f\"Normalized Residuals (log likelihood = {result.log_likelihood})\")\n",
"plt.xlabel(\"x values of profile\")\n",
"plt.ylabel(\"Normalized Residuals ($\\sigma$)\")\n",
"plt.ylabel(r\"Normalized Residuals ($\\sigma$)\")\n",
"plt.show()\n",
"plt.clf()\n",
"plt.close()"
Expand Down Expand Up @@ -986,7 +986,7 @@
"plt.plot(xvalues, normalized_residual_map, color=\"k\")\n",
"plt.title(f\"Normalized Residuals (log likelihood = {result.log_likelihood})\")\n",
"plt.xlabel(\"x values of profile\")\n",
"plt.ylabel(\"Normalized Residuals ($\\sigma$)\")\n",
"plt.ylabel(r\"Normalized Residuals ($\\sigma$)\")\n",
"plt.show()\n",
"plt.clf()\n",
"plt.close()"
Expand Down Expand Up @@ -1148,7 +1148,7 @@
"plt.plot(xvalues, normalized_residual_map, color=\"k\")\n",
"plt.title(f\"Normalized Residuals (log likelihood = {result.log_likelihood})\")\n",
"plt.xlabel(\"x values of profile\")\n",
"plt.ylabel(\"Normalized Residuals ($\\sigma$)\")\n",
"plt.ylabel(r\"Normalized Residuals ($\\sigma$)\")\n",
"plt.show()\n",
"plt.clf()\n",
"plt.close()"
Expand Down
4 changes: 2 additions & 2 deletions scripts/chapter_1_introduction/tutorial_1_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@

import autofit as af

"""
r"""
__Paths__

PyAutoFit assumes the current working directory is /path/to/HowToFit/ on your hard-disk (or in Colab).
Expand Down Expand Up @@ -288,7 +288,7 @@ def model_data_from(self, xvalues: np.ndarray) -> np.ndarray:
plt.show()
plt.clf()

"""
r"""
__Complex Models__

The code above may seem like a lot of steps just to create an instance of the `Gaussian` class. Couldn't we have
Expand Down
10 changes: 5 additions & 5 deletions scripts/chapter_1_introduction/tutorial_2_fitting_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ def model_data_from(self, xvalues: np.ndarray) -> np.ndarray:
plt.show()
plt.clf()

"""
r"""
__Normalized Residuals__

Another method to quantify and visualize the quality of the fit is using the normalized residual map, also known as
Expand All @@ -312,7 +312,7 @@ def model_data_from(self, xvalues: np.ndarray) -> np.ndarray:
plt.show()
plt.clf()

"""
r"""
__Chi Squared__

Next, we define the `chi_squared_map`, which is obtained by squaring the `normalized_residual_map` and serves as a
Expand All @@ -335,7 +335,7 @@ def model_data_from(self, xvalues: np.ndarray) -> np.ndarray:
plt.show()
plt.clf()

"""
r"""
Now, we consolidate all the information in our `chi_squared_map` into a single measure of goodness-of-fit
called `chi_squared`.

Expand All @@ -350,7 +350,7 @@ def model_data_from(self, xvalues: np.ndarray) -> np.ndarray:
chi_squared = np.sum(chi_squared_map)
print("Chi-squared = ", chi_squared)

"""
r"""

The lower the `chi_squared`, the fewer residuals exist between the model's fit and the data, indicating a better
overall fit!
Expand All @@ -375,7 +375,7 @@ def model_data_from(self, xvalues: np.ndarray) -> np.ndarray:
"""
noise_normalization = np.sum(np.log(2 * np.pi * noise_map**2.0))

"""
r"""
__Likelihood__

From the `chi_squared` and `noise_normalization`, we can define a final goodness-of-fit measure known as
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""
r"""
Tutorial 3: Non Linear Search
=============================

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ def model_data_from_instance(self, instance):
plt.plot(xvalues, normalized_residual_map, color="k")
plt.title(f"Normalized Residuals (log likelihood = {result.log_likelihood})")
plt.xlabel("x values of profile")
plt.ylabel("Normalized Residuals ($\sigma$)")
plt.ylabel(r"Normalized Residuals ($\sigma$)")
plt.show()
plt.clf()
plt.close()
Expand Down Expand Up @@ -601,7 +601,7 @@ def model_data_from_instance(self, instance):
plt.plot(xvalues, normalized_residual_map, color="k")
plt.title(f"Normalized Residuals (log likelihood = {result.log_likelihood})")
plt.xlabel("x values of profile")
plt.ylabel("Normalized Residuals ($\sigma$)")
plt.ylabel(r"Normalized Residuals ($\sigma$)")
plt.show()
plt.clf()
plt.close()
Expand Down Expand Up @@ -709,7 +709,7 @@ def model_data_from_instance(self, instance):
plt.plot(xvalues, normalized_residual_map, color="k")
plt.title(f"Normalized Residuals (log likelihood = {result.log_likelihood})")
plt.xlabel("x values of profile")
plt.ylabel("Normalized Residuals ($\sigma$)")
plt.ylabel(r"Normalized Residuals ($\sigma$)")
plt.show()
plt.clf()
plt.close()
Expand Down Expand Up @@ -817,12 +817,12 @@ def model_data_from_instance(self, instance):
plt.plot(xvalues, normalized_residual_map, color="k")
plt.title(f"Normalized Residuals (log likelihood = {result.log_likelihood})")
plt.xlabel("x values of profile")
plt.ylabel("Normalized Residuals ($\sigma$)")
plt.ylabel(r"Normalized Residuals ($\sigma$)")
plt.show()
plt.clf()
plt.close()

"""
r"""
If you repeat the fit multiple times, you will find that the model-fit is more likely to produce a good fit than
previously.

Expand Down
Loading