Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
On Thursday, 7th July from 1 to 3 pm there will be a maintenance with a short downtime of GitLab.
Open sidebar
ift
IMAGINE
Commits
80d66566
Commit
80d66566
authored
Feb 21, 2017
by
Theo Steininger
Browse files
Added simple_likelihood.py
parent
205c9675
Changes
2
Hide whitespace changes
Inline
Side-by-side
imagine/likelihoods/simple_likelihood/__init__.py
0 → 100644
View file @
80d66566
# -*- coding: utf-8 -*-
imagine/likelihoods/simple_likelihood/simple_likelihood.py
0 → 100644
View file @
80d66566
# -*- coding: utf-8 -*-
import
numpy
as
np
from
imagine.likelihoods.likelihood
import
Likelihood
class
SimpleLikelihood
(
Likelihood
):
def
__init__
(
self
,
measured_data
):
self
.
measured_data
=
measured_data
def
__call__
(
self
,
observable
):
shape
=
observable
.
shape
data
=
self
.
measured_data
.
val
.
get_full_data
()
obs
=
observable
.
val
.
get_full_data
()
quadratic_diff
=
((
data
-
obs
).
conjugate
()
*
(
data
-
obs
)).
sum
()
quadratic_diff
/=
np
.
prod
(
shape
)
return
-
quadratic_diff
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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