Investment to GDP
Get the Investment to GDP Ratio for a variety of countries over time from the Global Macro Database (GMDB). The Investment to GDP Ratio is the ratio of the total amount of money spent by businesses on capital goods, such as machinery, equipment, and buildings to the Gross Domestic Product (GDP).
Data comes from the Global Macro Database (GMDB), further information about the variable can be found within https://www.globalmacrodata.com/documentation.html
The ratio is expressed as a decimal fraction (0.2248 for 22.48% of GDP).
Changed in v2.2.0: this used to be returned in percentage points. It is now a decimal fraction, matching every other ratio in the Finance Toolkit.
Also known as: investment rate.
No programming experience? With the Finance Toolkit MCP server, AI assistants such as Claude and ChatGPT can calculate the Investment to GDP for you. Just ask in plain English.
Calculate the Investment to GDP in Python
The Investment to GDP is available in the Economics module of the open-source Finance Toolkit. Install it with:
pip install financetoolkit -U
Then call get_investment_to_gdp_ratio as shown below.
from financetoolkit import Economics
economics = Economics(start_date='2019-01-01')
investment_to_gdp_ratio = economics.get_investment_to_gdp_ratio()
investment_to_gdp_ratio.loc[:, ['Australia', 'Japan', 'Turkey']]
Which returns:
| Australia | Japan | Turkey | |
|---|---|---|---|
| 2019 | 0.2255 | 0.2579 | 0.2488 |
| 2020 | 0.223 | 0.2522 | 0.3134 |
| 2021 | 0.2331 | 0.258 | 0.314 |
| 2022 | 0.2372 | 0.2681 | 0.3504 |
| 2023 | 0.2398 | 0.264 | 0.2996 |
| 2024 | 0.2415 | 0.2657 | 0.2557 |
| 2025 | 0.2393 | 0.2664 | 0.2465 |
| 2026 | 0.2403 | 0.2652 | 0.254 |
Parameters
get_investment_to_gdp_ratio accepts the following parameters:
- countries (list[str] | str | None, optional): A list of countries or a single country to include in the results. Defaults to None.
- rolling (int, optional): The rolling window size to use for smoothing the data (simple moving average). Defaults to None.
- trailing (int, optional): The trailing window size to use for summing the data over trailing periods (e.g. a trailing-4-quarter sum). Defaults to None.
- growth (bool, optional): Whether to return the growth data or the actual data. Defaults to False.
- lag (int, optional): The number of periods to lag the growth data. Defaults to 1.
- standardize (bool, optional): Whether to standardize (Z-Score) the result. When combined with growth=True, standardizes the growth values instead of the raw values. Defaults to False.
- rounding (int | None, optional): The number of decimals to round the results to. Defaults to None.
Related Government
The Economics module page introduces the module, and the sidebar lists all of its functions.