This repository was archived by the owner on Mar 11, 2026. It is now read-only.
Commit 356517f
committed
Fix BoxCoxTransform inverse for negative lambda values
The _invert method used `if lmbda > 0` to decide between the power
formula and the exponential. This caused negative lambda values to
incorrectly fall through to the `exp` branch, which is only valid for
lmbda == 0. The Box-Cox inverse for any non-zero lambda is
`(lmbda * y + 1) ** (1 / lmbda)`, regardless of sign.
Changed the condition to `if lmbda != 0` so that negative lambdas
(common for heavy-tailed time series) are inverted correctly.1 parent 085ef8a commit 356517f
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
200 | 200 | | |
201 | 201 | | |
202 | 202 | | |
203 | | - | |
| 203 | + | |
204 | 204 | | |
205 | 205 | | |
206 | 206 | | |
| |||
0 commit comments