Skip to content

Commit

Permalink
linking done and full unit testing in place
Browse files Browse the repository at this point in the history
  • Loading branch information
harmsm committed Dec 26, 2024
1 parent 8523e66 commit f750d3b
Show file tree
Hide file tree
Showing 12 changed files with 2,138 additions and 1,555 deletions.
1 change: 1 addition & 0 deletions build-docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sphinx-build -M html docs/source/ docs/build/
2 changes: 1 addition & 1 deletion docs/badges/tests-badge.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
54 changes: 30 additions & 24 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,13 @@ The plots will be:

The ``f.fit_df`` dataframe will look something like:

+-------+-------+----------+-------+--------+---------+-------+-----------+
| index | name | estimate | std | low_95 | high_95 | ... | prior_std |
+=======+=======+==========+=======+========+=========+=======+===========+
| ``m`` | ``m`` | 5.009 | 0.045 | 4.817 | 5.202 | ... | ``NaN`` |
+-------+-------+----------+-------+--------+---------+-------+-----------+
| ``b`` | ``b`` | 5.644 | 0.274 | 4.465 | 6.822 | ... | ``NaN`` |
+-------+-------+----------+-------+--------+---------+-------+-----------+
+-------+-------+----------+-------+--------+---------+-------+-----------+--------+
| index | name | estimate | std | low_95 | high_95 | ... | prior_std | parent |
+=======+=======+==========+=======+========+=========+=======+===========+========+
| ``m`` | ``m`` | 5.009 | 0.045 | 4.817 | 5.202 | ... | ``NaN`` | ``NA`` |
+-------+-------+----------+-------+--------+---------+-------+-----------+--------+
| ``b`` | ``b`` | 5.644 | 0.274 | 4.465 | 6.822 | ... | ``NaN`` | ``NA`` |
+-------+-------+----------+-------+--------+---------+-------+-----------+--------+

The ``f.fit_quality`` dataframe will look something like:

Expand Down Expand Up @@ -292,15 +292,15 @@ can control seven attributes of each fittable parameter. These are stored in
f.param_df
+-------+-------+-----------+-------------+-------------+------------+-----------+
| name | guess | fixed | lower_bound | upper_bound | prior_mean | prior_std |
+=======+=======+===========+=============+=============+============+===========+
| ``a`` | 0.0 | ``False`` | ``-inf`` | ``inf`` | ``NaN`` | ``NaN`` |
+-------+-------+-----------+-------------+-------------+------------+-----------+
| ``b`` | 2.0 | ``False`` | ``-inf`` | ``inf`` | ``NaN`` | ``NaN`` |
+-------+-------+-----------+-------------+-------------+------------+-----------+
| ``c`` | 3.0 | ``False`` | ``-inf`` | ``inf`` | ``NaN`` | ``NaN`` |
+-------+-------+-----------+-------------+-------------+------------+-----------+
+-------+-------+-----------+-------------+-------------+------------+-----------+--------+
| name | guess | fixed | lower_bound | upper_bound | prior_mean | prior_std | parent |
+=======+=======+===========+=============+=============+============+===========+========+
| ``a`` | 0.0 | ``False`` | ``-inf`` | ``inf`` | ``NaN`` | ``NaN`` | ``NA`` |
+-------+-------+-----------+-------------+-------------+------------+-----------+--------+
| ``b`` | 2.0 | ``False`` | ``-inf`` | ``inf`` | ``NaN`` | ``NaN`` | ``NA`` |
+-------+-------+-----------+-------------+-------------+------------+-----------+--------+
| ``c`` | 3.0 | ``False`` | ``-inf`` | ``inf`` | ``NaN`` | ``NaN`` | ``NA`` |
+-------+-------+-----------+-------------+-------------+------------+-----------+--------+

The ``f.param_df`` dataframe can be accessed and edited using standard
`pandas DataFrame <pandas-dataframe_>`_ commands. The ``name`` column is set
Expand Down Expand Up @@ -363,6 +363,12 @@ The full rules for the parameter dataframe are:
+-----------------+---------------------------------------------------------+
| ``prior_std`` | single float value; ``np.nan`` allowed (see note) |
+-----------------+---------------------------------------------------------+
| ``parent`` | string name of a parameter. If this is specified, it |
| | tells the fitter to forces the parameter and its parent |
| | to have the same value during the analysis. This lowers |
| | the number of floating parameters by one. To remove a |
| | link, set this value to ``pd.NA`` or ``None``. |
+-----------------+---------------------------------------------------------+

.. note::

Expand All @@ -378,7 +384,7 @@ The full rules for the parameter dataframe are:
``prior_mean`` and ``prior_std`` to ``np.nan``.

-----------------------------
4. Set non-fittable arguments
1. Set non-fittable arguments
-----------------------------

One can specify arguments to the function that should not be used as fit
Expand Down Expand Up @@ -594,13 +600,13 @@ Parameter values (fit_df)
One accesses the parameter estimates via the ``f.fit_df`` pandas dataframe. The
``fit_df`` output from the `Simple example`_ above is:

+-------+-------+----------+-------+--------+---------+-------+-----------+
| index | name | estimate | std | low_95 | high_95 | ... | prior_std |
+=======+=======+==========+=======+========+=========+=======+===========+
| ``m`` | ``m`` | 5.009 | 0.045 | 4.817 | 5.202 | ... | ``NaN`` |
+-------+-------+----------+-------+--------+---------+-------+-----------+
| ``b`` | ``b`` | 5.644 | 0.274 | 4.465 | 6.822 | ... | ``NaN`` |
+-------+-------+----------+-------+--------+---------+-------+-----------+
+-------+-------+----------+-------+--------+---------+-------+----------+
| index | name | estimate | std | low_95 | high_95 | ... | parent |
+=======+=======+==========+=======+========+=========+=======+==========+
| ``m`` | ``m`` | 5.009 | 0.045 | 4.817 | 5.202 | ... | ``NA`` |
+-------+-------+----------+-------+--------+---------+-------+----------+
| ``b`` | ``b`` | 5.644 | 0.274 | 4.465 | 6.822 | ... | ``NA`` |
+-------+-------+----------+-------+--------+---------+-------+----------+

All three methods (ml, bootstrap, and mcmc) will have identical columns. These
columns report similar, but not identical, features of each parameter for each
Expand Down
Loading

0 comments on commit f750d3b

Please sign in to comment.