# log transformation - negative values [duplicate]

I am trying to log transform time series data of Inflation. However, there is one negative value. I have added the constant 1 to all my values and the log transformed.

loginfl <- log(infl_ts + 1)


Will this affect my analysis?

I am planning to tun predictions on this data.

• You would usually log-transform your data X if you can safely assume that the underlying probability distribution of Y = log(X) is normal; you can then use a linear model with normally distributed residuals for a downstream modelling/prediction analysis. The fact that you have negative values suggests to me that this is not the case. Could you please clarify, what is the rationale/justification for log-transforming the data? Dec 11, 2017 at 0:15
• i am log transformig the data so i can interpret it as % increments Dec 11, 2017 at 0:24
• I would first model inflation directly (i.e. not log-transformed), then look at the distribution of residuals. You can always infer % changes from the model coefficients. If residuals are not (approximately) normally distributed, you might try a log transformation of the data; however the negative values suggest to me that your data is in fact not log-normal. Dec 11, 2017 at 0:33
• I am doing a time series analysis - checking for stationary, looking for granger causality, cointegration, predictions ... Why is the normality assumption of my residuals so crucial in this case? I thought i just need my residuals to be white noise ? I use the Ljung Box test to validate my Autoregressive Distributed Lag model Dec 11, 2017 at 0:44
• Most popular models for time series data analysis (AR(1), ARIMA, etc.) have some form of normality assumption. If your residuals are not (approximately) normal, the MLE process to estimate model parameters may not be reliable. Looking at the distribution of residuals is always a crucial step in assessing the quality/validity of your model. Dec 11, 2017 at 0:54

$Y = \text{sign}(x) \log(|x|+1)$
x <- sample(c(1,-1),size = 100,replace = T)*exp(runif(100, 10,20))

• A reference is Whittaker, J., J. Whitehead and M. Somers. 2005. The neglog transformation and quantile regression for the analysis of a large credit scoring database. Applied Statistics 54: 863-878 FWIW, I don't find the name transparent, but I can't think of a much better one, and in any case it needs a really good name to justify muddying the waters with yet more terminology. I think I'd explain it as an extended logarithmic transformation, but even then it doesn't collapse to logarithm as a special case; it just is arbitrarily close for large $|x|$. Dec 11, 2017 at 14:30