Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
NIFTy
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
15
Issues
15
List
Boards
Labels
Service Desk
Milestones
Merge Requests
15
Merge Requests
15
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ift
NIFTy
Commits
ab3fc143
Commit
ab3fc143
authored
Nov 13, 2019
by
Philipp Arras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplifyications
parent
af6cbb60
Pipeline
#63607
failed with stages
in 5 minutes and 35 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
12 deletions
+6
-12
nifty5/library/correlated_fields.py
nifty5/library/correlated_fields.py
+6
-12
No files found.
nifty5/library/correlated_fields.py
View file @
ab3fc143
...
...
@@ -409,15 +409,11 @@ class CorrelatedFieldMaker:
assert
space
<
ldom
if
ldom
==
1
:
return
self
.
total_fluctuation_realized
(
samples
)
res1
=
0.
res2
=
0.
res1
,
res2
=
0.
,
0.
for
s
in
samples
:
res1
=
res1
+
s
**
2
res2
=
res2
+
s
.
mean
(
space
)
**
2
res1
=
res1
/
len
(
samples
)
res2
=
res2
/
len
(
samples
)
res
=
res1
.
mean
()
-
res2
.
mean
()
return
np
.
sqrt
(
res
)
res1
+=
s
**
2
res2
+=
s
.
mean
(
space
)
**
2
return
np
.
sqrt
((
res1
-
res2
).
mean
()
/
len
(
samples
))
def
moment_slice_to_average
(
self
,
fluctuations_slice_mean
,
nsamples
=
1000
):
fluctuations_slice_mean
=
float
(
fluctuations_slice_mean
)
...
...
@@ -428,8 +424,7 @@ class CorrelatedFieldMaker:
mu
,
sig
=
_lognormal_moments
(
m
,
std
)
flm
=
np
.
exp
(
mu
+
sig
*
np
.
random
.
normal
(
size
=
nsamples
))
scm
*=
flm
**
2
+
1.
scm
=
np
.
mean
(
np
.
sqrt
(
scm
))
return
fluctuations_slice_mean
/
scm
return
fluctuations_slice_mean
/
np
.
mean
(
np
.
sqrt
(
scm
))
@
staticmethod
def
offset_amplitude_realized
(
samples
):
...
...
@@ -443,8 +438,7 @@ class CorrelatedFieldMaker:
res
=
0.
for
s
in
samples
:
res
=
res
+
(
s
-
s
.
mean
())
**
2
res
=
res
/
len
(
samples
)
return
np
.
sqrt
(
res
.
mean
())
return
np
.
sqrt
((
res
/
len
(
samples
)).
mean
())
@
staticmethod
def
stats
(
op
,
samples
):
...
...
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