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
Commits
53b11855
Commit
53b11855
authored
6 years ago
by
Matthew David Pitkin
Browse files
Options
Downloads
Patches
Plain Diff
likelihood.py: rename function to func in Poission likelihood
- refs Monash/tupak!132
parent
f09abae9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!132
Add Poisson likelihood to core likelihood functions
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tupak/core/likelihood.py
+4
-4
4 additions, 4 deletions
tupak/core/likelihood.py
with
4 additions
and
4 deletions
tupak/core/likelihood.py
+
4
−
4
View file @
53b11855
...
@@ -112,7 +112,7 @@ class GaussianLikelihood(Likelihood):
...
@@ -112,7 +112,7 @@ class GaussianLikelihood(Likelihood):
class
PoissonLikelihood
(
Likelihood
):
class
PoissonLikelihood
(
Likelihood
):
def
__init__
(
self
,
x
,
func
tion
):
def
__init__
(
self
,
x
,
func
):
"""
"""
A general Poisson likelihood for a rate - the model parameters are
A general Poisson likelihood for a rate - the model parameters are
inferred from the arguments of function, which provides a rate.
inferred from the arguments of function, which provides a rate.
...
@@ -125,13 +125,13 @@ class PoissonLikelihood(Likelihood):
...
@@ -125,13 +125,13 @@ class PoissonLikelihood(Likelihood):
x: array_like
x: array_like
The data to analyse - this must be a set of non-negative integers,
The data to analyse - this must be a set of non-negative integers,
each being the number of events within some interval.
each being the number of events within some interval.
func
tion
:
func:
The python function providing the rate of events per interval to
The python function providing the rate of events per interval to
fit to the data. The arguments will require priors and will be
fit to the data. The arguments will require priors and will be
sampled over (unless a fixed value is given).
sampled over (unless a fixed value is given).
"""
"""
parameters
=
self
.
_infer_parameters_from_function
(
func
tion
)
parameters
=
self
.
_infer_parameters_from_function
(
func
)
Likelihood
.
__init__
(
self
,
dict
.
fromkeys
(
parameters
))
Likelihood
.
__init__
(
self
,
dict
.
fromkeys
(
parameters
))
self
.
x
=
x
self
.
x
=
x
...
@@ -150,7 +150,7 @@ class PoissonLikelihood(Likelihood):
...
@@ -150,7 +150,7 @@ class PoissonLikelihood(Likelihood):
# save sum of log factorial of counts
# save sum of log factorial of counts
self
.
sumlogfactorial
=
np
.
sum
(
gammaln
(
self
.
x
+
1
))
self
.
sumlogfactorial
=
np
.
sum
(
gammaln
(
self
.
x
+
1
))
self
.
function
=
func
tion
self
.
function
=
func
# Check if sigma was provided, if not it is a parameter
# Check if sigma was provided, if not it is a parameter
self
.
function_keys
=
list
(
self
.
parameters
.
keys
())
self
.
function_keys
=
list
(
self
.
parameters
.
keys
())
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment