Box-Cox参数估计是否达到lambda = 0?这样推荐的变换是一个日志函数?或者这种可能性只是一种数学上的好处,使功能连续,但很少在实践中使用?
我问,因为我一直在尝试在R中测试Box Cox变换,看它是否lambda==0在适当的时候进行估算:
> require(car)
> x <- exp(qnorm(runif(1000))) # 1000 numbers from a normal distribution then exp()
> p = powerTransform(x)
> p
Estimated transformation parameters
x
-0.1098415
# clearly this does not equal zero
Run Code Online (Sandbox Code Playgroud)
由于数据是随机的,因此您不会得到完全零.
> p <- powerTransform(rlnorm(100))
> coef(p)
rlnorm(100)
-0.05007203
> coef(p, round=TRUE) # Recommended transform
rlnorm(100)
0
Run Code Online (Sandbox Code Playgroud)
如果删除随机性,则该值更接近于零.
> p <- powerTransform(qlnorm(ppoints(100)))
> p
Estimated transformation parameters
qlnorm(ppoints(100))
-2.635191e-12
Run Code Online (Sandbox Code Playgroud)