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
0dd7b3b2
Commit
0dd7b3b2
authored
Mar 24, 2020
by
Gordian Edenhofer
Browse files
correlated_fields.py: Minor numerical improvements
parent
47cbdda4
Changes
1
Hide whitespace changes
Inline
Side-by-side
nifty6/library/correlated_fields.py
View file @
0dd7b3b2
...
...
@@ -61,7 +61,7 @@ def _lognormal_moments(mean, sig, N=0):
if
not
np
.
all
(
sig
>
0
):
raise
ValueError
(
"sig must be greater 0; got {!r}"
.
format
(
sig
))
logsig
=
np
.
sqrt
(
np
.
log
((
sig
/
mean
)
**
2
+
1
))
logsig
=
np
.
sqrt
(
np
.
log
1p
((
sig
/
mean
)
**
2
))
logmean
=
np
.
log
(
mean
)
-
logsig
**
2
/
2
return
logmean
,
logsig
...
...
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