Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
joezuntz committed Dec 10, 2024
1 parent 7a04914 commit de6e077
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
2 changes: 0 additions & 2 deletions cosmosis/samplers/fisher/fisher_sampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@ def config(self):
global fisherPipeline
fisherPipeline = self.pipeline
self.step_size = self.read_ini("step_size", float, 0.01)
self.tolerance = self.read_ini("tolerance", float, 0.01)
self.maxiter = self.read_ini("maxiter", int, 10)
self.method = self.read_ini("method", str, "stencil")
self.use_numdifftools = self.read_ini("use_numdifftools", bool, False)
if self.use_numdifftools:
Expand Down
21 changes: 14 additions & 7 deletions cosmosis/samplers/fisher/sampler.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ explanation: >
There is an additional term that arises when the covariance matrix C depends on
the parameters p, which we do not currently calculate here, as it is usually fixed in
cosmology. We plan to implement this shortly, however.
cosmology.
The CosmoSIS fisher sampler is calculated around the central value provided in the
values file; no optimization is done before running.
Expand All @@ -45,15 +45,22 @@ explanation: >
or you can manually save name+"_theory" and name+"_inverse_covariance" for any data that
you add.
Three methods are exposed for calculating the numerical derivatives.
1. 'stencil' - Uses a simple finite difference stencil to calculate the derivative.
2. 'numdifftools' - Uses the numdifftools package to calculate the derivative.
3. 'smooth' - Uses the derivative package to calculate the derivative - this can be slower but more robust.
installation: >
No special installation required; everything is packaged with CosmoSIS
You can pip install numdifftools and derivative to use the 'numdifftools' and 'smooth' methods respectively.
# List of configuration options for this sampler
params:
step_size: "(float; default=0.01) The size, as a fraction of the total parameter range, of steps to use in the derivative calculation. You should investigate stability wrt this."
use_numdifftools: "(bool; default=False) Use the library numdifftools instead of the default code (should be little difference)"
# Not currently working:
# tolerance: "(float; default=0.01) tolerance of the iterative process to find the right step size"
# maxiter: "(integer; default=10) Max number of iterations to use"
method: "(string; default='stencil') The method to use for numerical differentiation. Options are 'stencil', 'numdifftools', 'smooth'. The latter two require the numdifftools and derivative packages respectively"
step_size: "(float; default=0.01) The size, as a fraction of the total parameter range, of steps to use in the stencil and numdifftools methods."
step_size_min: "(float; default=1e-5) The minimum step size to use in the numerical differentiation using the 'smooth' method"
step_size_max: "(float; default=1e-2) The maximum step size to use in the numerical differentiation using the 'smooth' method"
step_size_max: "(float; default=1e-2) The maximum step size to use in the numerical differentiation using the 'smooth' method"
step_size_count: "(int; default=10) The numer of steps to use in the numerical differentiation using the 'smooth' method"

0 comments on commit de6e077

Please sign in to comment.