BookmarkSubscribeRSS Feed
R_Fraser
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?

Thanks,

Raphael

2 REPLIES 2
Rick_SAS
SAS Super FREQ

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.

R_Fraser
Calcite | Level 5

Thanks Rick!

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 873 views
  • 4 likes
  • 2 in conversation