Calculate Variance and Standard Deviation of an Asset

After discussing the calculation of returns on investments, let’s now learn about how to measure the risks associated with these returns.

In general, the risk of an asset or a portfolio is measured in the form of the standard deviation of the returns, where standard deviation is the square root of variance. Let’s look at how standard deviation and variance is calculated.

The variance is calculated as follows. Once you have the price data, the first step is to calculate the returns. What kind of returns we have depends on the periodicity of the data. For example, if we have daily prices, then we calculate the daily returns, which is calculated as (P(t1) – P(t0))/p(t0).

Using the returns data, we calculate the mean/average returns. The variance of the asset returns will then be the average of square of the difference between the returns and the mean.

Where n is the number of observations in the data, Rt represents the returns for each time period and μ represents the mean returns.

The standard deviation will simply be the square root of the variance.

The following is a simple example that illustrates the calculation:

Related Downloads

Data Science in Finance: 9-Book Bundle

Data Science in Finance Book Bundle

Master R and Python for financial data science with our comprehensive bundle of 9 ebooks.

What's Included:

  • Getting Started with R
  • R Programming for Data Science
  • Data Visualization with R
  • Financial Time Series Analysis with R
  • Quantitative Trading Strategies with R
  • Derivatives with R
  • Credit Risk Modelling With R
  • Python for Data Science
  • Machine Learning in Finance using Python

Each book includes PDFs, explanations, instructions, data files, and R code for all examples.

Get the Bundle for $39 (Regular $57)
JOIN 30,000 DATA PROFESSIONALS

Free Guides - Getting Started with R and Python

Enter your name and email address below and we will email you the guides for R programming and Python.

Data Science in Finance: 9-Book Bundle

Data Science in Finance Book Bundle

Master R and Python for financial data science with our comprehensive bundle of 9 ebooks.

What's Included:

  • Getting Started with R
  • R Programming for Data Science
  • Data Visualization with R
  • Financial Time Series Analysis with R
  • Quantitative Trading Strategies with R
  • Derivatives with R
  • Credit Risk Modelling With R
  • Python for Data Science
  • Machine Learning in Finance using Python

Each book comes with PDFs, detailed explanations, step-by-step instructions, data files, and complete downloadable R code for all examples.