fix(growth): typespec and doc for centile calc

This commit is contained in:
João Paulo Dubas 2024-06-10 18:34:24 +00:00
parent 4234b2e917
commit c175c3edfd
Signed by: joao.dubas
SSH Key Fingerprint: SHA256:V1mixgOGRc/YMhGx/DNkOSmJxgA2vHNrDZEk3wt/kOA

View File

@ -23,11 +23,13 @@ defmodule Growth.Calc.Centile do
alias Growth.Calc.ZScore
@spec compute(number(), number(), number(), number()) :: number()
@spec compute(number(), number(), number(), number()) :: number() | :na
@doc """
Compute the centile for a given measurement (`y`) and the Box-Cox values: power (`l`), median (`m`), and
coefficient of variation (`s`).
Returns the centile based on the z-score when -3 <= z-score <= 3; otherwise, returns `:na.`
## Examples:
iex> Growth.Calc.Centile.compute(19, -1.6318, 16.049, 0.10038)