Everyone needs to keep some cash on hand for bills and emergencies. But cash held in bank savings accounts can also help reduce the volatility of an investment portfolio, and it can provide a reserve for jumping on investment opportunities.

So how much of this type of cash should you have?

A key issue in deciding is the amount of risk in bonds and bond funds, which come next to cash in the stocks-bonds-cash hierarchy of risks versus returns.

Bonds are not as risky as stocks but they are riskier than cash, and the degree of risk rises and falls with market conditions. In periods when bonds are riskier, it can make sense to switch some money from bond holdings to safe bank savings like certificates of deposit.

While bonds involve various types of risks, one of the most important is “interest-rate risk,” the danger that an older bond’s value will fall if newer bonds offer higher yields.

After all, no one would give you the full $1,000 face value of an old bond yielding 5% if a new bond paying 10% could be bought for the same price. In this simplified example, your old bond’s value would fall to $500, so its annual $50 coupon would equal the 10% yield offered by new bonds.

In the real world, it’s much more complicated than that. A bond with 10 years to mature would be hit much harder by a rise in interest rates than one with a two-year maturity because the owner of the long-term bond would be stuck with the below-market yield for so much longer.

To provide an easy measure of interest-rate risk, bond experts have devised a measure called “duration,” which is expressed as a number of years. A longer duration means bonds and bond mutual funds are riskier. A 10-year duration means a bond would lose about 10% of its value if interest rates rose by 1%, while a bond with a two-year duration would lose just 2%.

This calculation is useful if you’d consider selling your bond as interest rates rise. But a refined view described by Morningstar Inc. (Stock Quote: MORN), the market-data firm, shows how you’d be affected over a 12-month period, when you would continue to receive interest earnings despite the decline in the bond’s value.

This view, used for “stress testing” a bond holding’s sensitivity to interest rate changes, replaces duration with a figure calculated by subtracting the bond’s SEC yield from its duration. Morningstar credits The Vanguard Group, the mutual fund company, for this refined approach to gauging risk.

In Morningstar’s example, the Vanguard Total Bond Market Index Fund (Stock Quote: VBMFX) has an SEC yield of 2.36% and a 4.8-year duration. Subtracting the first figure from the second leaves 2.44 years. So, if interest rates rose by one percentage point, the investor would lose 2.44% over the following 12 months. Interest earnings would offset some of the bond’s 4.8% loss in value.

SEC yield, devised by the Securities and Exchange Commission, is based on yields reported in SEC filings over the previous 30 days, also accounting for factors like fund expenses. The figure, found on mutual fund sites, tends to be lower than yields reported elsewhere. Morningstar, for example, reports the Vanguard Total Bond fund’s yield at 3.4%, a good deal higher than the 2.36% figure reported by Vanguard.

These days, yields on bank savings are extraordinarily low, with the average 12-month CD paying just 0.56%, according to the BankingMyWay.com survey. That encourages savers to shift money to bonds that offer higher yields.

But bank savings do not incur interest-rate risk, as principal is federally insured no matter what happens to interest rates. Interest-rate risk is a serious consideration with bonds and bond funds, because yields are so low they are more likely to go up than down.

By using Vanguard’s refined view of duration, savers can get a better sense of the relative risks and rewards of bonds versus bank savings. Though bond yields look higher than bank yields, bank savings may turn out to be the better bet if interest rates rise.

—For the best rates on loans, bank accounts and credit cards, enter your ZIP code at BankingMyWay.com.