Covariance calculator
Pick any two series, a stock or ETF by ticker or name, or one of more than 850,000 FRED economic series by its id or title. Choose how often to sample them and how far back to look, and get their covariance matrix, correlation and beta. Free, no sign-in.
This product uses the FRED® API but is not endorsed or certified by the Federal Reserve Bank of St. Louis.
Levels over the window
Paired period values
Method
Every number on this page comes from the steps below, in this order. Nothing is smoothed, filled in or estimated.
- Data. A security's price is its daily adjusted close (the close for currencies and crypto, which have no adjusted close). Our price history begins on 2023-12-01, so a security can be looked back at most to that date. A FRED series is downloaded from the Federal Reserve Bank of St. Louis the first time anyone uses it and refreshed when FRED reports an update; FRED's "no value" marks are left out.
- Periods. Each series is put into periods at the chosen frequency (the day; the week, Monday to Sunday; the calendar month; the quarter; the year) and the last value in each period is kept. A weekly period is shown as its Friday, the others as their last day.
- Alignment. Only periods in which both series have a value are kept, so both changes are always measured over the same interval.
- Changes. Each series is measured between consecutive kept periods as a percent change, a change in level, a log change, or left as its level. Percent and log changes need values above zero.
- Statistics. Sample covariance with the N−1 denominator, Pearson correlation, R² (the square of the correlation), and each beta (the covariance divided by the other series' variance). The annualized covariance multiplies the per-period figure by the periods in a year: 252 trading days, 52 weeks, 12 months, 4 quarters or 1 year. Levels are not annualized.
Rules the calculator enforces
- A series cannot be used more often than it is published: a monthly FRED series needs a monthly, quarterly or annual frequency.
- At least 10 shared observations are needed. With fewer than 30 the page says the estimate is imprecise and gives the correlation's approximate standard error.
- When one series starts later than the look-back, the window starts where both have data, and the page says so.
Reading the result
Covariance is in the units of the two measures multiplied together (for two percent changes, a fraction squared), so its size depends on the series. Correlation removes the units and runs from −1 to 1. The beta of the second series on the first is how much the second series' change moves, on average, for a one-unit change in the first.
FRED data and its owners
Each FRED series is listed with its source under the result. FRED marks some series as owned by a third party that requires permission before its data is used; the calculator does not offer those, nor series FRED gives no copyright status.
Economic data: Federal Reserve Bank of St. Louis, FRED®.