fix(growth): alias z-score and use if
Some checks failed
continuous-integration/drone/pr Build is failing
Some checks failed
continuous-integration/drone/pr Build is failing
This commit is contained in:
parent
500d0e89bb
commit
bb79aa2f3a
@ -9,17 +9,17 @@ defmodule Growth.Calc.Centile do
|
||||
Enum.map(measures, &apply(Growth.Calc.Centile, :compute, &1))
|
||||
"""
|
||||
|
||||
alias Growth.Calc.ZScore
|
||||
|
||||
# TODO: (jpd) add documentation and typespecs
|
||||
|
||||
def compute(y, l, m, s) do
|
||||
zscore = Growth.Calc.ZScore.raw(y, l, m, s)
|
||||
zscore = ZScore.raw(y, l, m, s)
|
||||
|
||||
cond do
|
||||
-3 <= zscore and zscore <= 3 ->
|
||||
m * :math.pow(1 + l * s * zscore, 1 / l)
|
||||
|
||||
true ->
|
||||
:na
|
||||
if -3 <= zscore and zscore <= 3 do
|
||||
m * :math.pow(1 + l * s * zscore, 1 / l)
|
||||
else
|
||||
:na
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user