Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bilby
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
lscsoft
bilby
Merge requests
!876
Fixed CDF and PDF for SymmertricLogUniform
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Fixed CDF and PDF for SymmertricLogUniform
fix_sym_log_unif_cdf
into
master
Overview
0
Commits
2
Pipelines
2
Changes
1
Merged
Moritz Huebner
requested to merge
fix_sym_log_unif_cdf
into
master
4 years ago
Overview
0
Commits
2
Pipelines
2
Changes
1
Expand
This came up when I wrote tests for the Slab-and-spike priors I'm working on.
Old:
New:
Edited
4 years ago
by
Moritz Huebner
0
0
Merge request reports
Compare
master
version 1
a2842b56
4 years ago
master (base)
and
latest version
latest version
1d28be3a
2 commits,
4 years ago
version 1
a2842b56
1 commit,
4 years ago
1 file
+
14
−
1
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
bilby/core/prior/analytical.py
+
14
−
1
Options
@@ -337,7 +337,8 @@ class SymmetricLogUniform(Prior):
-------
float: Prior probability of val
"""
return
(
np
.
nan_to_num
(
0.5
/
np
.
abs
(
val
)
/
np
.
log
(
self
.
maximum
/
self
.
minimum
))
*
val
=
np
.
abs
(
val
)
return
(
np
.
nan_to_num
(
0.5
/
val
/
np
.
log
(
self
.
maximum
/
self
.
minimum
))
*
self
.
is_in_prior_range
(
val
))
def
ln_prob
(
self
,
val
):
@@ -354,6 +355,18 @@ class SymmetricLogUniform(Prior):
"""
return
np
.
nan_to_num
(
-
np
.
log
(
2
*
np
.
abs
(
val
))
-
np
.
log
(
np
.
log
(
self
.
maximum
/
self
.
minimum
)))
def
cdf
(
self
,
val
):
val
=
np
.
atleast_1d
(
val
)
norm
=
0.5
/
np
.
log
(
self
.
maximum
/
self
.
minimum
)
cdf
=
np
.
zeros
((
len
(
val
)))
lower_indices
=
np
.
where
(
np
.
logical_and
(
-
self
.
maximum
<=
val
,
val
<=
-
self
.
minimum
))[
0
]
upper_indices
=
np
.
where
(
np
.
logical_and
(
self
.
minimum
<=
val
,
val
<=
self
.
maximum
))[
0
]
cdf
[
lower_indices
]
=
-
norm
*
np
.
log
(
-
val
[
lower_indices
]
/
self
.
maximum
)
cdf
[
np
.
where
(
np
.
logical_and
(
-
self
.
minimum
<
val
,
val
<
self
.
minimum
))]
=
0.5
cdf
[
upper_indices
]
=
0.5
+
norm
*
np
.
log
(
val
[
upper_indices
]
/
self
.
minimum
)
cdf
[
np
.
where
(
self
.
maximum
<
val
)]
=
1
return
cdf
class
Cosine
(
Prior
):
Loading