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. […]

# Data Science

## Handling Missing Values in Time Series

In the examples we saw earlier, we had good quality data with all values available for all time indexes. However, in real life, the data may contain missing values which will influence our analysis. Depending on the nature of data, we may choose to ignore missing values. However, in some cases it might be more […]

## Plotting Time Series in R

While we can explore time series data using commands such as print(), head(), tail(), etc in R, it can be very helpful to plot the time series data as a line chart and explore it visually. In the following examples, we plot the Microsoft stock data and the quarterly GDP data in two different plots using the plot() function in […]

## Exploring Time Series Data in R

Let’s look at a few commands that we will frequently use while exploring time series data. length() The length() function tells us the number of elements in out time series dataset. head() The head() function displays the top n elements of the dataset. This is useful while exploring large datasets. tail() The tail() function displays the last n elements of the […]

## Financial Time Series Data

Welcome to this course on financial time series analysis using R. In this course, we will learn about financial time series data analysis in R. You will learn about how to explore and build time series data, calculate its key statistics, and plot time series charts. You will also learn about how to use the […]

## Check If Data Is Normally Distributed Using R – QQ Plots

The first step to check if your data is normally distributed is to plot a histogram and observe its shape. If it looks bell-shaped and symmetric around the mean you can assume that your data is normally distributed. However, using histograms to assess normality of data can be problematic especially if you have small dataset. […]

## Settlement Price of Futures Contracts

While looking at the historical price dataset of a Futures contract, you will see some important columns such as Open, High, Low, Last, Change, Settle, Volume, and Previous Open Day Interest for each trading day. The Last column is the price of the last trade on the day. The Settle column shows the settlement price […]

## Calmar Ratio: Definition, Calculation, and Importance

Calmar ratio is a popular risk-adjusted measure used by investors in their investment selection process. The Calmar ratio is calculated by dividing the compounded annual rate of return for period and dividing it by the maximum drawdown for the same period. The calculations are done using absolute values. Calmar ratios are generally calculated using 36 […]

## New Course – Quantitative Trading Strategies with R

We are pleased to announce the addition of a new course – Quantitative Trading Strategies with R – to our growing library of courses on Data Science for Finance Professionals. Course: Quantitative Trading Strategies with R A step-by-step approach to building solid quantitative trading strategies using R Quantitative and algorithmic trading now accounts for over one-third of all […]

## Backtesting Quantitative Trading Strategies

Backtesting is one of the most important steps in building a successful quantitative trading strategy. It is in fact a key step that differentiates algorithmic trading from discretionary trading. Quants use their computational finance and programming skills to build complex trading strategies. However, before these strategies are executed in the live market, they are tested […]