0.6.2-dev0
FORCES
FORtran lib for Comp. Env. Sys.
Loading...
Searching...
No Matches
mo_boxcox::boxcox Interface Reference

Transform a positive dataset with a Box-Cox power transformation. More...

Public Member Functions

real(sp) function, dimension(size(x)) boxcox_sp (x, lmbda, mask)
 
real(dp) function, dimension(size(x)) boxcox_dp (x, lmbda, mask)
 

Detailed Description

Transform a positive dataset with a Box-Cox power transformation.

Calculate Box-Cox power transformed values given the original values and the exponent lambda.

\[ w_\text{Box-Cox}(x) = \begin{cases} \frac{x^\lambda - 1}{\lambda}&\text{, if }\lambda \neq 0 \\ \ln{x}&\text{, if }\lambda = 0 \end{cases} \]

If an optional mask is given, then the Box-Cox transformation is only performed on those locations that correspond to true values in the mask.
\(x\) can be single or double precision. The result will have the same numerical precision. \(x\) can be scalar or vector.
Example

out = boxcox(x, lmbda, mask=mask)

See also test folder for a detailed example, "pf_tests/test_mo_boxcox".

Parameters
[in]real(sp/dp) :: xScalar/1D-array with input numbers (`>0.`)
[in]real(sp/dp) :: lmbdaExponent power of Box-Cox transform (`>= 0.`)
[in]logical, optional :: maskScalar/1D-array of logical values with size(x). If present, only those locations in vec corresponding to the true values in mask are used.
Return values
real(sp/dp) :: boxcoxPower transformed values (at mask=.true.)
Note
Input values must be positive, i.e. \(x > 0\).
Author
Matthias Cuntz
Date
March 2011
  • Modified Python code of Travis Oliphant (2002): boxcox, llf_boxcox, get_boxcox
  • Modified numerical recipes: brent, mnbrak, swap, shft
Dec 2021
  • Updated doxygen docs

Definition at line 66 of file mo_boxcox.f90.

Member Function/Subroutine Documentation

◆ boxcox_dp()

real(dp) function, dimension(size(x)) mo_boxcox::boxcox::boxcox_dp ( real(dp), dimension(:), intent(in)  x,
real(dp), intent(in)  lmbda,
logical, dimension(:), intent(in), optional  mask 
)

Definition at line 154 of file mo_boxcox.f90.

◆ boxcox_sp()

real(sp) function, dimension(size(x)) mo_boxcox::boxcox::boxcox_sp ( real(sp), dimension(:), intent(in)  x,
real(sp), intent(in)  lmbda,
logical, dimension(:), intent(in), optional  mask 
)

Definition at line 122 of file mo_boxcox.f90.


The documentation for this interface was generated from the following file: