BookmarkSubscribeRSS Feed
Calcite | Level 5

I am working with a transform both sides regression model via the two parameter Box-Cox power transformation which addresses negative values of x. That is,

fx = [(x + lambda2)^lambda1 - 1]/lambda1

I would like to use maximum likelihood to determine both parameters. The problem is the nonlinear optimization algorithm will only run (for obvious reasons) for large enough values of lambda2. Also different starting values for lambda2 results in different values for lambda1. Is there a way to specify a constraint such as x + lambda2 > 0. Is there a work around to address this problem? If this is not possible, what would be the best starting value for lambda2?




A few comments:

1) The TRANSREG procedure solves regression models with Box-Cox transformations. Would that help? I think it requires that you fix lambda2 >= -min(x). It then optimizes over lambda1.

2) lambda2 is called a threashold parameter, and MLE problems of this kind do sometimes have problems converging. They arise in density estimation, such as in PROC UNIVARIATE with the HISTOGRAM statement.  Many practitioners set the value of lambda2 to be either -min(x) or some value that has physical significance.

3) If you really want to solve the two-parameter problem, you can use the BLC matrix to define the linear inequality x+lambda2 > 0.  Again, a feasible starting point is any value such that lambda2 > -min(x). An example of specifying a constraint is at "Specifying the BLC Matrix". You can then use your favorite NLP function to solve the optimization problem.

4) For a worked out example of using SAS/IML to solve an MLE problem, see Maximum likelihood estimation in SAS/IML - The DO Loop

That example does not use a BLC constaint matrix, but the ideas are all there.

5) If you use an optimization routine that requires derivatives, see the hints in this article: Optimizing? Two hints for specifying derivatives - The DO Loop

6) Don't forget to evaluate the BC transformation as log(x+lambda2) when lambda1=0.

Calcite | Level 5

Thanks Rick!



Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

Multiple Linear Regression in SAS

Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.

Find more tutorials on the SAS Users YouTube channel.

From The DO Loop
Want more? Visit our blog for more articles like these.
Discussion stats
  • 2 replies
  • 2 in conversation