Differencing and Log Transformation
Premium
Removing Variability Using Logarithmic Transformation
Since the data shows changing variance over time, the first thing we will do is stabilize the variance by applying log transformation using the log()
function. The resulting series will be a linear time series.
1> sp_linear<-log(sp_ts)
2> plot.ts(sp_linear, main="Daily Stock Prices (log)", ylab="Price", col=4)
3
Unlock Premium Content
Upgrade your account to access the full article, downloads, and exercises.
You'll get access to:
- Access complete tutorials and examples
- Download source code and resources
- Follow along with practical exercises
- Get in-depth explanations