Finding Optimal Lambda for Box-Cox Transform in R

前端 未结 2 495
无人及你
无人及你 2021-02-06 08:23

I am trying to transform data in a vector in R.

This is not for linear regression so I don\'t have a predictor and response relationship. I am simply using a model that

2条回答
  •  青春惊慌失措
    2021-02-06 08:47

    For applying box cox transformation on vector, use forecast package in r:

    library(forecast)
    # to find optimal lambda
    lambda = BoxCox.lambda( vector )
    # now to transform vector
    trans.vector = BoxCox( vector, lambda)
    

提交回复
热议问题