Rental properties can help level out the peaks and valleys in your portfolio.

Is a bear market on the way? That’s the question experts and investors alike have been debating for months.

Given the cyclical nature of the market, it’s unrealistic to expect the current bull market to continue its run forever. What’s uncertain is when the bear will dig in its claws.

Hindsight is 20/20 but foresight is just as important and the investments you make now could pay off once a bear market hits. With stocks treading the path of volatility and bond yields looking dismal in the current rate environment, real estate jumps to the forefront.

“Real estate exhibits low correlation with public markets and due to its fundamental value, is uniquely positioned to weather downturns,” says Omer Amsel, co-founder and chief operating officer at real estate equity crowdfunding platform StraightUp. “It’s not typically impacted by changes in market sentiment as quickly as equities,” representing an opportunity to “diversify, reduce overall volatility and create a stronger portfolio, offering downside protection among stocks, bonds and other assets.”

If bear market fears are on your radar, here’s what you need to know about investing in real estate now.

Rising rates, inflation could be a mixed bag. Following June’s increase of the federal funds rate, at least two more rate hikes are in the forecast for 2018. Rising rates have been accompanied by a moderate, yet steady, uptick in inflation.

“Rising interest rates will both help and hurt,” says Sean O’Hara, president of Pacer ETFs in Paoli, Pennsylvania. Rising rates mean the cost of borrowing increases, but inflation also means real estate values rise. “In the end, rising interest rates and inflation counterbalance each other.”

Jay Hatfield, portfolio manager of InfraCap’s REIT Preferred ETF, says the biggest downside associated with rising interest rates for real estate investors is rising capitalization rates, which negatively impact valuations. When inflation rises at a similar pace, however, it can have a neutralizing or even positive effect “as the cost of replacing real estate will rise and rents are likely to be rising at an accelerating rate.”

The main concern for investors is how that carries over to returns. Viraj Patel, managing director and head of asset allocation at Fiduciary Trust Company International in New York, says total returns in real estate drill down to two factors: change in market value and net operating income. Rising rates may negatively effect market value, while having a positive effect on net operating income if it pushes more people toward renting.

How inflation affects the return outlook often depends on how quickly prices rise.

“Properties financed with fixed-rate debt and have rents that adjust periodically, like multifamily properties, can perform very well in an inflationary period,” says Dan Aronson, chartered financial analyst and managing partner of EPIQ Partners in Minneapolis. “Rents can climb faster than expenses, providing more income to the owners.” Rising rates could, however, put a damper on returns when it’s time to refinance.

Certain sectors may outperform in a bear market. If you’re considering real estate for a bear market – or in the worst-case scenario, a recession – sector choice matters.

“Sectors that should continue to do well even during a recession include data and infrastructure real estate, especially those connected to e-commerce,” O’Hara says. Industrial properties and health-care should also hold up well in a bear market economy.

Matt Topley, chief investment officer of Fortis Wealth in Valley Forge, Pennsylvania says investors should be focused on holdings that are naturally more insulated against a downturn. He says a boom in vacation homes is usually characteristic after a long stock bull market, as well as a cyclical rotation from multifamily to residential housing.

“The biggest risk on the real estate side right now is economically sensitive subsectors, like high-end apartments, second-class offices and hotels,” Topley says. Careful evaluation within the context of the broader economy can help you pinpoint sectors with the most return and lowest risk potential.

Private real estate or REITs? Real estate investment trusts tend to correlate more closely with equities in a bear market, especially in the short to medium term, says Samuel Miller, senior investment strategist, Signature Estate & Investment Advisors in Los Angeles. Between 1994 and 2016, for instance, U.S. REITs on the FTSE NAREIT All Equity REITs Index exhibited a correlation of 0.58 with the S&P 500 index.

Miller says that in recessionary periods, REITs have generally fully participated in the downside experienced by U.S. stocks, while private real estate has outperformed them both by a wide margin. During the tech bubble and global financial crisis, private real estate outperformed U.S. equities by 60.6 percent and 33.6 percent respectively. Private real estate also boasts a consistent track record of surpassing the U.S. bond market during rising rate periods.

But don’t count REITs out entirely, says Beth Mallette, portfolio manager at Manning & Napier Advisors in Rochester, New York. “REITs provide an option to invest in diversified portfolios of real estate without tying large amounts of capital in a few buildings.”

While REIT returns can be more volatile than private or direct real estate in the shorter term, publicly traded REITs have the liquidity advantage. And, “over a longer time frame, we see little difference in the drivers of returns for private versus public real estate,” she says.

Opportunity may be knocking in the rental market. Owning a rental property can be more time- and capital-intensive but it may prove worthwhile in a bear market.

“We believe the rental market will continue to grow,” says Robert Mulcahy, senior vice president, Angel Oak Prime Bridge in Atlanta. “As with any investment, the challenging question is at what point it will pull back.”

With rental properties, this typically results from a decrease of rental rates and/or a shift in the underlying economy. According to the Urban Institute, there will be 13 million new rental households by 2030, with a growing preference for single-family units among millennials and baby boomers, suggesting “that the rental market will experience sustained momentum for years to come,” Mulcahy says.

Investing in rental property in anticipation of a bear market could put you ahead of the game if you’re committed to a buy-and-hold strategy. “Real estate is a generational wealth investment and should be viewed with a long-term horizon, says Jon Swire, real estate advisor, The Agency RE in Los Angeles.

Whether all signs point to a bull or bear market right now, you can never perfect the timing. In the meantime, rental properties can help level out the peaks and valleys in your portfolio, generating “an increasing annual passive income stream that you can retire on and use to secure your financial future,” Swire says. ~Rebecca Lake