In the past few weeks, the price of a barrel of oil has risen to its highest level in the last several years, and I believe it is poised to move higher. Lately, I’ve been asked quite a bit about what this means for the stock market. While high oil prices may have an effect on certain sectors and industries, I believe the far greater impact would be indirect — and could happen in several different ways.

Why have oil prices risen?

There are always a number of different forces at work that affect oil prices, but I will focus on just a few that have had a significant impact recently. First, the United States recently refused to recertify the nuclear accord with Iran, which means Iran is now prohibited from selling oil to US entities. In addition, the US is attempting to force European Union entities from buying oil from Iran as well. This could mean that Iran will not be able to sell its oil to much of the global market, thereby shrinking global supply and increasing prices.

Second, the current crisis in Venezuela has worsened, reducing oil production even further. According to the Organization of Petroleum Exporting Countries (OPEC), Venezuela’s oil production in March 2018 was at a 30-year low of approximately 1.4 million barrels per day; this oil production has been declining for more than a year as the country falls deeper into a chaotic mixture of corruption, deteriorating infrastructure, runaway inflation and an inability to service its debt. In my view, further deterioration for Venezuela seems likely given its re-election of President Nicolas Maduro on May 20. This could be very problematic given that Venezuela holds more of the world’s oil reserves than any other country.

What does this mean for stocks?

And so a question I have been asked a lot lately is: What does this mean for the stock market? I believe the best way to answer such questions is to look at history. Over the past few decades, the relationship between the price of oil and the global stock market has varied over time, having changed multiple times. There have been periods of positive correlation, negative correlation and relatively no correlation in the last three decades.1 My takeaway from history is that there is no strong relationship on a broad basis.

And that means investors should not assume that higher oil prices will be bad for stocks in general. For example, in 2010 oil prices rose substantially, about 15% — from approximately $78 per barrel for West Texas Intermediate crude oil in January 2010 to $89 in December 2010. However, the performance of the MSCI All Country World Index for calendar year 2010 was 12.67%. That makes sense given that there are so many factors impacting the price of stocks in general — including monetary policy, which can be very powerful.

Instead, the strong relationships have been between the price of oil and certain stock market sectors and industries — specifically, energy and transports. In addition, stocks in countries that import oil tend to be hurt by higher oil prices, while stocks in countries that are export oil tend to rise on higher oil prices. I also expect that, if oil prices rise high enough, it could have a significant impact on low- and middle-income consumers, thereby impacting a portion of the consumer discretionary sector.

Related: Webcast: Behind the Machines: Investing in Robotics from a Research Perspective

However, my view is that higher oil prices may have a far greater indirect impact on the stock market — and the economy — and that this would likely happen in several different ways. One way is by forcing the US Federal Reserve (Fed) to get more aggressive in its rate hike cycle. It’s widely known that the Fed focuses on core inflation — which excludes food and energy prices — rather than headline inflation in determining the pace of tightening, so many assume that higher oil prices won’t have an impact on the type of inflation that the Fed cares about.

However, higher oil prices can and do pass through into core inflation, as was noted in a 2017 Fed commentary. The authors concluded that “oil price fluctuations have a limited but long lasting effect on core inflation.” Therefore, as higher oil prices seep into core inflation — exacerbated by other inflationary forces such as wage growth and tariffs on items such as aluminum and steel — they have the potential to cause the Fed to get more aggressive in its rate hikes.