Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Rhiannon Udall
bilby
Commits
4df9ac25
Commit
4df9ac25
authored
Jun 12, 2019
by
Gregory Ashton
Browse files
Name change and minor fixes
parent
72fce93b
Changes
1
Hide whitespace changes
Inline
Side-by-side
bilby/core/prior.py
View file @
4df9ac25
...
...
@@ -817,9 +817,33 @@ class PowerLaw(Prior):
1.
*
self
.
is_in_prior_range
(
val
))
class
Summed
PowerLaw
(
Prior
):
class
Double
PowerLaw
(
Prior
):
def
__init__
(
self
,
alpha0
,
alpha1
,
xi
,
minimum
,
maximum
,
name
=
None
,
latex_label
=
None
,
unit
=
None
,
ngrid_points
=
10000
):
"""Mixture model of two power laws
Parameters
----------
alpha0, alpha1: float
Power law exponent parameter for the 0th and 1st components
xi: float
Mixture parameter [0, 1].
ngrid_points:
Number of grid points to evaluate the inverse CDF on
minimum: float
See superclass
maximum: float
See superclass
name: str
See superclass
latex_label: str
See superclass
unit: str
See superclass
boundary: str
See superclass
"""
Prior
.
__init__
(
self
,
name
=
name
,
latex_label
=
latex_label
,
unit
=
unit
,
maximum
=
maximum
,
minimum
=
minimum
)
self
.
alpha0
=
alpha0
...
...
@@ -828,9 +852,6 @@ class SummedPowerLaw(Prior):
self
.
ngrid_points
=
ngrid_points
self
.
icdf_array
=
np
.
linspace
(
minimum
,
maximum
,
ngrid_points
)
def
__repr__
(
self
):
return
""
@
property
def
a0
(
self
):
if
self
.
alpha0
!=
-
1
:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment