pycbc.inference.jump package¶
Submodules¶
pycbc.inference.jump.normal module¶
Jump proposals that use a normal distribution.
-
class
pycbc.inference.jump.normal.
EpsieAdaptiveNormal
(parameters, prior_widths, adaptation_duration, adaptation_decay=None, start_iteration=1, target_rate=0.234, initial_std=None)[source]¶ Bases:
epsie.proposals.normal.AdaptiveNormal
Adds
from_config
method to epsie’s adaptive normal proposal.-
classmethod
from_config
(cp, section, tag)[source]¶ Loads a proposal from a config file.
The section that is read should have the format
[{section}-{tag}]
, where{tag}
is apycbc.VARARGS_DELIM
separated list of the parameters to create the jump proposal for.Options that are read:
- name : str
- Required. Must match the name of the proposal.
- adaptation-duration : int
- Required. Sets the
adaptation_duration
.
- min-{param} : float
- max-{param} : float
- Required. Bounds must be provided for every parameter. These are used to determine the prior widths.
- adaptation-decay : int
- Optional. Sets the
adaptation_decay
. If not provided, will use the class’s default.
- start-iteration : int
- Optional. Sets the
start_iteration
.If not provided, will use the class’s default.
- target-rate : float
- Optional. Sets the
target_rate
. If not provided, will use the class’s default.
Note
The min and max parameter bounds are only used for setting the width of the covariance of the proposal; they are not used as bounds on the proposal itself. In other words, it is possible to get proposals outside of the given min and max values.
Example:
[jump_proposal-mchirp+q] name = adaptive_normal adaptation-duration = 1000 min-q = 1 max-q = 8 min-mchirp = 20 max-mchirp = 80
Parameters: Returns: An adaptive normal proposal for use with
epsie
samplers.Return type: epsie.proposals.AdaptiveNormal
-
classmethod
-
class
pycbc.inference.jump.normal.
EpsieNormal
(parameters, cov=None)[source]¶ Bases:
epsie.proposals.normal.Normal
Adds
from_config
method to epsie’s normal proposal.-
classmethod
from_config
(cp, section, tag)[source]¶ Loads a proposal from a config file.
The section that is read should have the format
[{section}-{tag}]
, where{tag}
is apycbc.VARARGS_DELIM
separated list of the parameters to create the jump proposal for.Variances for each parameter may also be specified, by giving options
var-{param} = val
. Any parameter not specified will use a default variance of 1.Example:
[jump_proposal-mchrip+q] name = normal var-q = 0.1
Parameters: Returns: A normal proposal for use with
epsie
samplers.Return type: epsie.proposals.Normal
-
classmethod
Module contents¶
Provides custom jump proposals for samplers.
-
pycbc.inference.jump.
epsie_proposals_from_config
(cp, section='jump_proposal')[source]¶ Loads epsie jump proposals from the given config file.
This loads jump proposals from sub-sections starting with
section
(default is ‘jump_proposal’). The tag part of the sub-sections’ headers should list the parameters the proposal is to be used for.Example:
[jump_proposal-mtotal+q] name = adaptive_normal adaptation-duration = 1000 min-q = 1 max-q = 8 min-mtotal = 20 max-mtotal = 160 [jump_proposal-spin1_a] name = normal
Parameters: - cp (WorkflowConfigParser instance) – The config file to read.
- section (str, optional) – The section name to read jump proposals from. Default is
'jump_proposal'
.
Returns: Dictionary mapping parameter names to proposal instances.
Return type: