Skip to content
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

added ability to link two parameters #17

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
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
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
Loading