FORCES
FORtran lib for Comp. Env. Sys.
|
Back-transformation of Box-Cox-transformed data. More...
Public Member Functions | |
real(sp) function | invboxcox_0d_sp (x, lmbda) |
real(dp) function | invboxcox_0d_dp (x, lmbda) |
real(sp) function, dimension(size(x)) | invboxcox_1d_sp (x, lmbda, mask) |
real(dp) function, dimension(size(x)) | invboxcox_1d_dp (x, lmbda, mask) |
Back-transformation of Box-Cox-transformed data.
Calculate the inverse Box-Cox given the transformed values and the exponent lambda.
\[ w_\text{Box-Cox}^{-1}(y) = \begin{cases} (\lambda y + 1)^{\frac{1}{\lambda}}&\text{, if }\lambda \neq 0 \\ e^{y}&\text{, if }\lambda = 0 \end{cases} \]
If an optional mask is given, then the inverse Box-Cox transformation is only performed on those locations that correspond to true values in the mask.
\(y\) can be single or double precision. The result will have the same numerical precision.
\(y\) can be scalar or vector.
Example
See also test folder for a detailed example, "pf_tests/test_mo_boxcox".
[in] | real(sp/dp) :: y | Scalar/1D-array with input numbers (`>0.`) |
[in] | real(sp/dp) :: lmbda | Exponent power of Box-Cox transform (`>= 0.`) |
[in] | optional, logical :: mask | 1D-array of logical values with size(x) . If present, only those locations in vec corresponding to the true values in mask are used. Only applicable if x is a 1D-array. |
real(sp/dp) :: invboxcox | Back transformed values (at mask=.true. ) |
Definition at line 108 of file mo_boxcox.f90.
real(dp) function mo_boxcox::invboxcox::invboxcox_0d_dp | ( | real(dp), intent(in) | x, |
real(dp), intent(in) | lmbda | ||
) |
Definition at line 289 of file mo_boxcox.f90.
real(sp) function mo_boxcox::invboxcox::invboxcox_0d_sp | ( | real(sp), intent(in) | x, |
real(sp), intent(in) | lmbda | ||
) |
Definition at line 263 of file mo_boxcox.f90.
real(dp) function, dimension(size(x)) mo_boxcox::invboxcox::invboxcox_1d_dp | ( | real(dp), dimension(:), intent(in) | x, |
real(dp), intent(in) | lmbda, | ||
logical, dimension(:), intent(in), optional | mask | ||
) |
Definition at line 226 of file mo_boxcox.f90.
real(sp) function, dimension(size(x)) mo_boxcox::invboxcox::invboxcox_1d_sp | ( | real(sp), dimension(:), intent(in) | x, |
real(sp), intent(in) | lmbda, | ||
logical, dimension(:), intent(in), optional | mask | ||
) |
Definition at line 189 of file mo_boxcox.f90.