Autocorrelation is an important part of time series analysis. It helps us understand how each observation in a time series is related to its recent past observations. When autocorrelation is high in a time series, it becomes easy to predict their future observations. Let us consider the Microsoft stock prices for the year 2016, which […]

## Differencing and Log Transformation

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. Removing Linear Trend We will now perform the first difference transformation [z(t) – z(t-1)] to our series to remove […]

## Time Series Transformation in R

We will now learn about how we can perform the mathematical transformations in R in order to make a non-stationary series stationary. We have the daily stock prices of an imaginary stock exhibiting rapid growth stored in a csv file. You can download the csv file and follow along this tutorial to perform the transformations […]

## Transforming a Series to Stationary

Most financial and economic times series are not stationary. Even when you adjust them for seasonal variations, they will exhibit trends, cycles, random walk and other non-stationary behavior. We can use a variety of techniques to make a non-stationary series stationary depending on the kind of non-stationary behavior present in the series. The two techniques […]

## Stationary Process in Time Series

A common assumption made in time series analysis is that one of the components of the pattern exhibited by a time series is the stationary series. This is the random or irregular component we discussed earlier. This random variation is not explained by any other factor. There are three characteristics of a stationary series: It […]

## Role of Data Science in Risk Management

Risk management is an integral part of any financial institution. All businesses face a variety of risks and the risk management practice works towards maximizing the businesses’ return on investment and reducing their losses. Anyone who works in risk management is not new to data analytics. The field of risk management is highly dependent on […]

## Characteristics of Time Series

Time series have several characteristics that make their analysis different from other types of data. The time series variable (for example, the stock price) may have a trend over time. This refers to the increasing or decreasing values in a given time series. The variable may exhibit cyclicity or seasonality. This refers to the repeating cycle over a […]

## Plotting Financial Time Series Data (Multiple Columns) in R

Let’s take one more example of plotting financial time series data. This time we will use the EuStockMarkets data set that comes by default with R. It contains the daily closing prices of major European stock indices from 1991 to 1998. Check and Print the Data Let’s first check if the data is a time series and […]

## Check if an object is a time series object in R

In R, objects can be of different class such as vector, list, dataframe, ts, etc. When you load a dataset into R, it may not necessarily be a time series object. We can use the is.ts() function to test if the given object is a time series (ts) object or not. Below we perform this test on […]

## Creating a Time Series Object in R

In R, we can use the ts() function to create a time series object. Usage Below is a simplified format of the ts function. For complete details use ?ts in your R console. data: a vector or matrix of the observed time-series values. start: the time of the first observation. end: the time of the last observation, specified in the same way as start. […]