Calculate the Root Mean Squared Error (RMSE) between every unordered pair of tickers’ series in the Toolkit instance.

Also known as: RMSD (Root Mean Squared Deviation).

This controller method compares two ASSETS’ series directly, treating one as a naive “forecast” proxy for the other – a simple, tracking-error style measure of how closely two series move together in absolute deviation terms (e.g. a portfolio versus a benchmark, or one asset as a naive stand-in forecast for a similar one). For evaluating an actual FORECASTING MODEL (ARIMA/VAR) rather than one asset as a naive proxy for another, use get_out_of_sample_validation instead.

For a fund against its index the RMSE comes close to the tracking error but is not the same: the tracking error (Performance.get_tracking_error) is the Standard Deviation of the return differences, which leaves out their average, while the RMSE includes it. The RMSE is per period, so a daily figure is usually multiplied by the square root of 252 to annualize it.

The formula is as follows:

\[\text{RMSE} = \sqrt{(1 / n) \cdot \operatorname{Σ}(\text{aₜ} - \text{bₜ}) ^{2}},\;\; \text{with aₜ and bₜ the two tickers' column (Return by default) on the n dates where both have data}\]

Root Mean Squared Error (RMSE) in Python or via the MCP

Install the Finance Toolkit with:

pip install financetoolkit -U

Then call get_rmse as shown below.

from financetoolkit import Toolkit

toolkit = Toolkit(
    ["IVV", "VOO"],
    api_key="FINANCIAL_MODELING_PREP_KEY",
    start_date="2025-01-01",
    end_date="2025-12-31",
)

toolkit.econometrics.get_rmse(include_benchmark=True)

Or, after setting up the Finance Toolkit MCP, ask:

How closely did the daily returns of IVV, VOO and SPY track each other in 2025, measured by the root mean squared error?

Which returns:

  RMSE
(‘IVV’, ‘VOO’) 0.0004
(‘IVV’, ‘Benchmark’) 0.0009
(‘VOO’, ‘Benchmark’) 0.001

Using Your Own Data

get_rmse runs on any data, not only prices: ratios, economic indicators, yield curves or your own dataset. Pass a DataFrame, a Series or a dictionary of them to Econometrics as data, with the dates in the rows or the columns, and set changes to how its changes are calculated: "percentage", "log", "difference" for rates and ratios, or None when the data are changes already. For example, for the monthly unemployment rates of the United States and Germany:

from financetoolkit import Economics, Econometrics

economics = Economics(start_date="2000-01-01")

unemployment = economics.get_unemployment_rate(
    countries=["United States", "Germany"], period="monthly"
)

econometrics = Econometrics(data=unemployment, changes="difference")

econometrics.get_rmse()

Parameters

get_rmse accepts the following parameters.

ParameterTypeDescriptionExample
periodstrThe data frequency (daily, weekly, monthly, quarterly, or yearly). Defaults to “daily”."weekly"
columnstrThe historical data column to compare. Defaults to “Return”."Return"
include_benchmarkboolWhether to include “Benchmark” among the tickers paired up. Defaults to False.True
roundingint | NoneThe number of decimals to round the results to. Defaults to None.2
Share