BoxCoxTrans.lambda
— Methodlambda(𝐱; interval = (-2.0, 2.0), method = :geomean)
Calculate lambda from an array using a log-likelihood estimator.
Keyword arguments:
- method: either :geomean or :normal
- any other keyword arguments accepted by Optim.optimize function e.g. abs_tol
See also: log_likelihood
BoxCoxTrans.log_likelihood
— Methodlog_likelihood(𝐱, λ; method = :geomean)
Return log-likelihood for the given array and lambda.
Method :geomean => -N / 2.0 * log(2 * π * σ² / gm ^ (2 * (λ - 1)) + 1)
Method :normal => -N / 2.0 * log(σ²) + (λ - 1) * sum(log.(𝐱))
BoxCoxTrans.transform
— Methodtransform(𝐱, λ; α = 0)
Transform an array using Box-Cox method with the provided power parameter λ. If the array contains any non-positive values then a DomainError is thrown.
Keyword arguments:
- α: added to all values in 𝐱 before transformation. Default = 0.
- scaled: scale transformation results. Default = false.
BoxCoxTrans.transform
— Methodtransform(𝐱)
Transform an array using Box-Cox method. The power parameter λ is derived from maximizing a log-likelihood estimator.
If the array contains any non-positive values then a DomainError is thrown. This can be avoided by providing the shift parameter α to make all values positive.
Keyword arguments:
- α: added to all values in 𝐱 before transformation. Default = 0.
- scaled: scale transformation results. Default = false.