## Log Modulus Transformation

Solved
Frequent Contributor
Posts: 130

# Log Modulus Transformation

I read a recent Blog at :

http://blogs.sas.com/content/iml/2014/07/14/log-transformation-of-pos-neg.html

related to the log-modulus transformation which was listed as:

L(x) = sign(x) * log(|x| + 1)

My question is that once you have the transformed value which is now positive how should that value be calculated for the normal scale.  I am using natural logs for my example

EG  x=0.24  ln(x)=-1.42

L(x)=-1 *Ln(|0.24|+1)=0.42

What sould I do if I have  values in that data set that do not give negative logs also add 1.0?

When  I want to return to the normal scale for this Ln value (0.42) ie ( exp) x,  what should be the appropriate value for x?

I hope that I have interpreted the blog correctly.

Accepted Solutions
Solution
‎08-30-2016 08:33 AM
SAS Super FREQ
Posts: 4,242

## Re: Log Modulus Transformation

I'm not sure what you mean by the "normal scale"?  What are you trying to accomplish?

The log-modulus transformation is one of many transformations that can be used for a variety of purposes, including visualizing data that spans many orders of magnitude, such as {-10000, -10, -0.01, 0.1, 100, 1000}.

Some other transformations (such as log() or sqrt()) are sometimes used as normalizing transformations. You can apply a normalizing transformation with the data are lognormally distributed (use log() ) or are distributed like x^2 (use sqrt()).

Perhaps you are asking "how can I undo the log-modulus transformation"?

The inverse transformation is

z = sign(y) ( exp(abs(y)) - 1 )

For example, if your original data X are normally distributed and you apply the log-modulus transformation to get Y, then you can apply the inverse transformation to recover X.

All Replies
Solution
‎08-30-2016 08:33 AM
SAS Super FREQ
Posts: 4,242

## Re: Log Modulus Transformation

I'm not sure what you mean by the "normal scale"?  What are you trying to accomplish?

The log-modulus transformation is one of many transformations that can be used for a variety of purposes, including visualizing data that spans many orders of magnitude, such as {-10000, -10, -0.01, 0.1, 100, 1000}.

Some other transformations (such as log() or sqrt()) are sometimes used as normalizing transformations. You can apply a normalizing transformation with the data are lognormally distributed (use log() ) or are distributed like x^2 (use sqrt()).

Perhaps you are asking "how can I undo the log-modulus transformation"?

The inverse transformation is

z = sign(y) ( exp(abs(y)) - 1 )

For example, if your original data X are normally distributed and you apply the log-modulus transformation to get Y, then you can apply the inverse transformation to recover X.

Frequent Contributor
Posts: 130

## Re: Log Modulus Transformation

The inverse transform was what I was seeking.  Thanks for the clarification.

☑ This topic is solved.