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).

See forecast_evaluation_model.get_rmse for the formula. 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.

No programming experience? With the Finance Toolkit MCP server, AI assistants such as Claude and ChatGPT can calculate the Root Mean Squared Error (RMSE) for you. Just ask in plain English.

Calculate the Root Mean Squared Error (RMSE) in Python

The Root Mean Squared Error (RMSE) is available in the Econometrics module of the open-source Finance Toolkit. Install it with:

pip install financetoolkit -U

Then call get_rmse as shown below.

from financetoolkit import Toolkit

toolkit = Toolkit(["AAPL", "MSFT"], api_key="FINANCIAL_MODELING_PREP_KEY")

toolkit.econometrics.get_rmse(period="quarterly")

Which returns:

Ticker A Ticker B RMSE
AAPL MSFT 0.1084

Parameters

get_rmse accepts the following parameters:

  • period (str, optional): The data frequency (daily, weekly, monthly, quarterly, or yearly). Defaults to “daily”.
  • column (str, optional): The historical data column to compare. Defaults to “Return”.
  • include_benchmark (bool, optional): Whether to include “Benchmark” among the tickers paired up. Defaults to False.
  • rounding (int | None, optional): The number of decimals to round the results to. Defaults to None.

The Econometrics module page introduces the module, and the sidebar lists all of its functions.

Share