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
Open sidebar
ift
NIFTy
Commits
d61dd5f4
Commit
d61dd5f4
authored
Sep 18, 2018
by
Martin Reinecke
Browse files
Merge remote-tracking branch 'origin/NIFTy_5' into outer_product
parents
0fd750df
c0bc65a3
Changes
2
Hide whitespace changes
Inline
Side-by-side
nifty5/library/correlated_fields.py
View file @
d61dd5f4
...
...
@@ -25,7 +25,6 @@ from ..operators.contraction_operator import ContractionOperator
from
..operators.distributors
import
PowerDistributor
from
..operators.harmonic_operators
import
HarmonicTransformOperator
from
..operators.simple_linear_operators
import
FieldAdapter
from
..sugar
import
exp
def
CorrelatedField
(
s_space
,
amplitude_model
):
...
...
@@ -72,4 +71,4 @@ def MfCorrelatedField(s_space_spatial, s_space_energy, amplitude_model_spatial,
a_energy
=
dom_distr_energy
(
amplitude_model_energy
)
a
=
a_spatial
*
a_energy
A
=
pd
(
a
)
return
exp
(
ht
(
A
*
FieldAdapter
(
MultiDomain
.
make
({
"xi"
:
h_space
}),
"xi"
))
)
return
ht
(
A
*
FieldAdapter
(
MultiDomain
.
make
({
"xi"
:
h_space
}),
"xi"
))
nifty5/library/inverse_gamma_model.py
View file @
d61dd5f4
...
...
@@ -31,6 +31,27 @@ from ..sugar import makeOp
class
InverseGammaModel
(
Operator
):
def
__init__
(
self
,
domain
,
alpha
,
q
):
"""Model which transforms a Gaussian into an inverse gamma distribution.
The pdf of the inverse gamma distribution is defined as follows:
.. math::
\f
rac {
\b
eta ^{
\a
lpha }}{\Gamma (
\a
lpha )}}x^{-
\a
lpha -1}\exp \left(-{
\f
rac {
\b
eta }{x}}
\r
ight)
That means that for large x the pdf falls off like x^(-alpha -1).
The mean of the pdf is at q / (alpha - 1) if alpha > 1.
The mode is q / (alpha + 1).
Parameters
----------
domain : Domain, tuple of Domain or DomainTuple
The domain on which the field shall be defined. This is at the same
time the domain and the target of the operator.
alpha : float
The alpha-parameter of the inverse-gamma distribution.
q : float
The q-parameter of the inverse-gamma distribution.
"""
self
.
_domain
=
self
.
_target
=
DomainTuple
.
make
(
domain
)
self
.
_alpha
=
alpha
self
.
_q
=
q
...
...
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