Change theme
Change theme

Liquidity Management of Canadian Corporate Bond Mutual Funds: A Machine Learning Approach


Fund managers use different liquidity-management strategies to meet investor redemptions depending on whether market volatility is low or high (Arora and Ouellet Leblanc 2018). Canadian corporate bond funds (CCBFs) use liquid holdings, including cash, to meet investor redemptions when volatility is low (horizontal slicing). When volatility is high, CCBFs use relatively less cash but also sell less-liquid assets to preserve the liquidity in their portfolios (vertical slicing). Identifying drivers and the threshold for liquidity-management decisions using standard linear models is difficult because of the large variety of features and styles funds have and the risk events that funds face. A machine learning (ML) approach may allow for more flexibility in describing relationships than linear models provide (Varian 2014).

In this note, we use ML algorithms, in particular decision trees and random forests (Breiman 2001; Breiman et al. 1984; Ho 1995), to uncover new patterns in the decisions made by fund managers. We confirm the robustness of Arora and Ouellet Leblanc’s (2018) core finding. We also find that an interaction between the holdings of relatively less-liquid assets and higher market risk appears to trigger the shift between different liquidity strategies. The probability that CCBF managers will choose vertical slicing spikes when two conditions are met:

  • the fund’s share of corporate bonds is greater than about 23 per cent, and
  • the Canadian term spread is greater than approximately 90 basis points.

A decision tree therefore identifies two simple thresholds that interact to classify fund managers’ liquidity decisions, something that would be difficult to capture with linear models. If this interaction is neglected, as many as 10 per cent of the slicing decisions made by funds with relatively more-liquid assets could be misclassified when the term spread increases.

Understanding CCBFs’ liquidity management is important because these funds offer investors the right to daily redemptions, but fund managers invest in relatively less-liquid assets. This liquidity mismatch and the fact that CCBFs have become larger and increased their holdings of riskier assets since 2007 point to a potential increase in the likelihood of large redemptions (Arora, Merali and Ouellet Leblanc 2018; Goldstein, Jiang and Ng 2017). Liquidity-management decisions thus play a central role in assessing the potential impact of CCBFs’ asset sales on fixed-income market liquidity. This note helps quantify this impact.

Downside price risks contribute to vertical slicing

In this section, we use a decision tree to examine the decision by CCBF managers to meet redemptions with horizontal and vertical slicing. Decision trees bring three important benefits compared with standard linear models. First, a decision tree works well when there are important non-linearities in data. Second, a decision tree can pick the model’s specification (variable selection, threshold identification and interaction with other variables) and discover relationships that were not specified in advance. Third, looking at the tree makes it easy to interpret how the algorithm arrives at different predictions.

When a fund faces redemptions by investors, it can use a different mix of cash and less-liquid assets. This is the decision that we model with a tree. We classify all liquidity decisions made by fund managers (when they face outflows) as horizontal or vertical slicing based on the changes in asset holdings from the previous quarter. We say a decision is horizontal slicing if a CCBF decreases the share of liquid assets relative to the share of corporate bonds in its holdings. Alternatively, we say a decision is vertical slicing if the share of corporate bonds and the share of liquid assets remain relatively stable (Arora and Ouellet Leblanc [2018] explain the details of each strategy). To predict horizontal and vertical slicing, we use a decision tree trained on more than 100 financial variables and fund characteristics. The Appendix provides details on the data sources and methodology.

Decision trees let the data point to the determinants of CCBFs’ strategies for meeting redemptions. The left branch of the tree in Figure 1 shows what happens when the Canadian term spread is large. The tree predicts a 69 per cent probability of vertical slicing when the Canadian term spread is larger than approximately 90 basis points and if a fund’s share of corporate bonds is greater than about 23 per cent (i.e., red rectangle at the bottom left). This simple decision tree works relatively well to predict a vertical slicing strategy. With two branches, we correctly classify 71 per cent of the vertical slicing observations in our test (out-of-sample) set. The test set contains observations not used to estimate the algorithm and provides evidence that our results are robust and applicable in other samples of CCBF liquidity decisions. Finally, across all variables in our data set, the tree selects the Canadian term spread as the most important determinant of CCBFs’ liquidity-management decisions.

Figure 1: CCBFs' liquidity-management decisions are influenced by market conditions

Canadian term spread >= 93 bps
N = 940
Yes No
Share of corporate bonds >= 23% CCBF's portfolio return <= -1.83%
Yes No Yes No
Vertical slicing
Pr. = 69%
N = 438
Horizontal slicing
Pr. = 79%
N = 119
Vertical slicing
Pr. = 72%
N = 23
Horizontal slicing
Pr. = 77%
N = 360

Note: Final leaves (i.e., green and red rectangles) predict horizontal or vertical slicing when the probability (Pr.) exceeds the threshold of 50 per cent. N denotes the total number of observations classified in each leaf, while Pr. indicates the percentage of observations that predicts CCBFs’ liquidity strategies. The algorithm is trained on 2001Q1 to 2012Q4 outflow data. The test (out-of-sample) set contains outflow data from 2013Q1 to 2016Q4.

The evidence suggests that the combination of relatively less-liquid holdings and market conditions with a larger term spread increases the likelihood of a vertical slicing decision. This is because, in times of stress, anticipation of redemptions and portfolio losses may become self-fulfilling, and mutual funds may become vulnerable to bank runs (Arora 2018; Chen, Goldstein and Jiang 2010). When faced with a greater likelihood of negative fund returns, CCBF managers prefer vertical slicing to maintain the liquidity of their portfolios.

Overall, our findings are in line with the conclusions Arora and Ouellet Leblanc (2018) reach using linear regression models. CCBF managers’ shift from horizontal to vertical slicing suggests that liquidity-management decisions are influenced by market conditions. But the widening of Canadian term spread adds to the information in the Chicago Board Options Exchange Volatility Index (VIX) used by Arora and Ouellet Leblanc (2018) to explain changes in CCBFs’ strategies for meeting redemptions.

Random forest predicts liquidity-management decisions well

In this section, we compare the performance of decision trees, a random forest and a benchmark model (logit) to forecast fund strategies. A random forest is an ML algorithm that uses multiple decision trees to make predictions. Each tree is fitted using different samples of slicing decisions and a different subset of predictive variables to obtain distinct trees. One advantage of a random forest over a single decision tree is its ability to improve the model’s stability by averaging predictions across multiple trees (the wisdom of crowds).

This performance comparison is important. It tells us whether these classification algorithms help predict CCBF managers’ responses to redemptions on data not yet seen by the algorithms. The Appendix provides more details on the model validation methodology, while Hastie, Tibshirani and Friedman (2009) offer an excellent treatment of the algorithms used in this note.

We find that a random forest yields better forecasts than a standard logistic model. Table 1 compares the predictive performance along three dimensions: accuracy, precision and recall scores (Powers 2011). The recall score measures the model’s performance at correctly classifying vertical slicing observations that were not used to estimate the model (the out-of-sample set). The random forest algorithm correctly predicts 68 per cent of vertical slicing out-of-sample observations, on average, an 11 per cent improvement over the benchmark logistic classification (recall = 0.68 versus recall = 0.57 in Table 1). This improvement is non-negligible given the size of the out-of-sample set (940 observations). The accuracy and precision scores also improve. Because a random forest improves all three dimensions, we conclude that it minimizes classification errors.

Table 1: Predictive performance of the classification learning models

Models Accuracy Precision Recall
Random forest 0.66 0.67 0.68
Decision trees 0.61 0.63 0.61
Logit 0.59 0.60 0.57

Note: Algorithms are fitted based on 1,000 bootstrap samples drawn from 2001Q1 to 2012Q4 outflow data (training set). The table reports the average forecasting performance on the outflow data from 2013Q1 to 2016Q4 (test/out-of-sample set).

Factors driving liquidity-management decisions

We identify the most important variables selected by our random forest model to forecast the liquidity-management decisions made by CCBF managers facing investor redemptions.

We find that the optimized random forest uses measures of the risk in fund portfolios and financial variables to improve forecast accuracy. Chart 1 shows the score of the most important variables. A variable with a higher score is more useful for predicting than a variable with a lower score. In the results, the most important variables are the share of corporate bond holdings, the share of liquid assets and the duration of the fixed-income portfolio. These are followed by the Canadian term spread and Canadian corporate credit spread. Perhaps surprisingly, the size of redemptions was not selected as an important variable to predict liquidity-management decisions.

This is consistent with the existing literature on mutual funds that uses classical regressions. For example, Chernenko and Sunderam (2016) and Massa and Phalippou (2005) find that the composition of a fund’s holdings is a key determinant in liquidity-management decisions. Ben-Rephael (2017), Huang (2015) and Jiang, Li and Wang (2016) also find that market conditions play an important role in liquidity-management decisions.

Chart 1: Drivers of liquidity-management decisions


In this note, we revisit the question of how CCBFs meet investor redemptions. Using decision tree and random forest algorithms, we uncover new patterns in fund managers’ decisions. The result shows the robustness of Arora and Ouellet Leblanc’s (2018) core finding: greater downside risks to asset prices make vertical slicing more likely. But we also show that these algorithms can extract new knowledge that is not apparent using a traditional linear modelling approach. We find that the interaction between relatively less-liquid holdings and greater market risk appears to trigger the shift between different liquidity-management strategies.

Our findings are an important contribution to quantify the impact of asset liquidation of fixed-income funds on market liquidity in times of stress (Arora, Bédard-Pagé and Ouellet Leblanc, forthcoming). Future research could compare the performance of other ML algorithms (e.g., boosting methods, support vector machines, neural networks) and key results by broadening the sample of mutual funds used in this note.



This note uses the definition and sample of CCBFs presented in Arora, Merali and Ouellet Leblanc (2018), which yields an unbalanced panel with 111 CCBFs from the first quarter of 2002 to the fourth quarter of 2016.

Table A1: Subset of important variables and data sources

Variables Description Sources Computation and units
Horizontal versus vertical slicing Dummy variable Morningstar Holdings and Thomson Reuters fixed-income reference data For each fund facing redemptions in each period, we classify the decision as horizontal slicing if the share of liquid assets decreased and the share of corporate bonds increased by at least 0.75%. Alternatively, we classify the decision as vertical slicing if the share of corporate bonds and the share of liquid assets changed by less than 0.75%.
Cash holdings Share of cash and equivalents holdings in book value Morningstar Holdings and Thomson Reuters fixed-income reference data In percentage points. Cash and equivalents include cash holdings and certificates of deposit.
Corporate bond holdings Share of corporate bond holdings in book value Morningstar Holdings and Thomson Reuters fixed-income reference data All corporate bonds held by a fund are matched with the Thomson Reuters fixed-income reference data to obtain the book value of each security. We calculate the asset class holdings by aggregating all corporate bond securities at each period. We then compute its share of the portfolio in percentage points.
Government bond holdings Share of government bond holdings in book value Morningstar Holdings and Thomson Reuters fixed-income reference data All government bonds held by a fund are matched with the Thomson Reuters fixed-income reference data to obtain the book value of each security. We calculate the asset class holdings by aggregating all government bond securities at each period. We then compute its share of the portfolio in percentage points.
Inflows Net inflows as a percentage of total net assets Morningstar Direct In percentage points. Inflows are winsorized at the 1st and 99th percentiles.
Outflows Net outflows as a percentage of total net assets Morningstar Direct In percentage points. Outflows are winsorized at the 1st and 99th percentiles.
One period lagged flow Morningstar Direct One period lag of flow
Fund return Quarterly net return in percentage points Morningstar Direct Quarterly net return in percentage points
Fund size Morningstar Direct Log of fund size
Term spread Yield on 10-year Canadian government bonds minus yield on 3-month treasury bills Bank of Canada In percentage points
Modified duration of fund’s fixed-income portfolio Modified duration measures the sensitivity of a bond’s percentage price to changes in the bond’s yield. For example, an increase in interest rates negatively affects the value of a bond. Morningstar Direct and Bank of Canada calculations In years
TED spread Yield on 3-month interbank loans minus yield on 3-month US Treasury bills Haver Analytics In percentage points
MOVE Merrill Lynch Option Volatility Estimate Index Bank of America Merrill Lynch Merrill Lynch Option Volatility Estimate Index
WTI price Average spot price of West Texas Intermediate crude oil World Bank In US dollars
VIX Chicago Board Options Exchange Volatility Index Haver Analytics In percentage points
VIXC S&P/TSX 60 VIX Index Haver Analytics In percentage points
Canadian financial stress index Index of financial stress for the Canadian financial system Based on the methodology developed by Duprey, Klaus and Peltonen (2017) Rescaled to be bounded between 0 and 1
Bank of Canada commodity price index energy commodity index Chain Fisher price index of energy commodities Bank of Canada Index
Canadian broad market credit spread Option-adjusted spreads of the Bank of America Merrill Lynch Canada Broad Market Index Bank of America Merrill Lynch and Bloomberg In percentage points
Excess bond premium Corporate bond spreads component that reflects a compensation for risk beyond expected default Leboeuf and Pinnington (2017) In percentage points

Model validation methodology and estimation

In machine learning, we divide the data into separate sets to train, validate and test the model. We use the training data to estimate a model, the validation set to choose the model and the test set to evaluate how well the chosen model performs. In this note, validation and testing sets are combined, a common practice in the literature.

The time dimension in our panel is subject to inconsistency and look-ahead bias if our algorithms are estimated using random sampling of observations. For example, look-ahead bias can occur when some observations in the training set are not known or available to make a prediction for a given period. This bias can then lead to inaccurate conclusions about a model’s performance.

To account for look-ahead bias, we first perform a bootstrap resampling method, which consists of

  1. drawing N observations (with replacement) from the training data set (in-sample data; 2002Q1 to 2012Q4),
  2. collecting these observations to create a bootstrap sample M,
  3. estimating (training) each model with this bootstrap sample M,
  4. forecasting the test set sample (2013Q1 to 2016Q4),
  5. comparing those forecasts with the actual results of the test set observations (out-of-sample data) and calculating the evaluation metrics, and
  6. repeating this procedure 1,000 times.

We then report the average of our evaluation metrics. We use the classification and regression tree algorithm to train decision trees and a random forest. This algorithm is available in the scikit-learn library in Python. For robustness, we also perform a walk-forward cross-validation (Chakraborty and Joseph 2017).


  1. Arora, R. 2018. “Redemption Runs in Canadian Corporate Bond Funds?” Bank of Canada Staff Analytical Note No. 2018-21.
  2. Arora, R., G. Bédard-Pagé and G. Ouellet Leblanc. Forthcoming. “Bond Funds and Fixed-Income Market Liquidity: A Stress-Testing Approach.” Bank of Canada Technical Report.
  3. Arora, R., N. Merali and G. Ouellet Leblanc. 2018. “Did Canadian Corporate Bond Funds Increase their Exposures to Risks?” Bank of Canada Staff Analytical Note No. 2018-7.
  4. Arora, R. and G. Ouellet Leblanc. 2018. “How do Canadian Corporate Bond Funds Meet Investor Redemptions?” Bank of Canada Staff Analytical Note No. 2018-14.
  5. Ben-Rephael, A. 2017. “Flight-to-Liquidity, Market Uncertainty, and the Actions of Mutual Fund Investors.” Journal of Financial Intermediation 3: 30–44.
  6. Breiman, L. 2001. “Random Forests.” Machine Learning 45 (1): 5–32.
  7. Breiman, L., J. H. Friedman, R. A. Olshen and C. J. Stone. 1984. Classification and Regression Trees. Boca Raton, Florida: Chapman & Hall.
  8. Chakraborty, C. and A. Joseph. 2017. “Machine Learning at Central Banks.” Bank of England Working Paper No. 674.
  9. Chen, Q., I. Goldstein and W. Jiang. 2010. “Payoff Complementarities and Financial Fragility: Evidence from Mutual Fund Outflows.” Journal of Financial Economics 97 (2): 239–262.
  10. Chernenko, S. and A. Sunderam. 2016. “Liquidity Transformation in Asset Management: Evidence from the Cash Holdings of Mutual Funds.” European Systemic Risk Board Working Paper No. 23.
  11. Duprey, T., B. Klaus and T. Peltonen. 2017. “Dating Systemic Financial Stress Episodes in the EU Countries.” Journal of Financial Stability 32: 30–56.
  12. Goldstein, I., H. Jiang and D. T. Ng. 2017. “Investor Flows and Fragility in Corporate Bond Funds.” Journal of Financial Economics 126 (3): 592–613.
  13. Hastie, T., R. Tibshirani and J. Friedman. 2009. The Elements of Statistical Learning: Data Mining, Inference, and Prediction. 2nd ed. New York: Springer.
  14. Ho, T. 1995. “Random Decision Forests.” In Proceedings of the Third International Conference on Document Analysis and Recognition, 278–282. Washington, DC: IEEE.
  15. Huang, J. 2015. “Dynamic Liquidity Preferences of Mutual Funds.” Working paper.
  16. Jiang, H., D. Li and A. Wang. 2016. “Dynamic Liquidity Management by Corporate Bond Mutual Funds.” Available at
  17. Leboeuf, M. and J. Pinnington. 2017. “What Explains the Recent Increase in Canadian Corporate Bond Spreads.” Bank of Canada Staff Analytical Note No. 2017-2.
  18. Massa, M. and L. Phalippou. 2005. “Mutual Funds and the Market for Liquidity.” CEPR Discussion Paper No. 4818.
  19. Powers, D. 2011. “Evaluation: From Precision, Recall and F-Measure to ROC., Informedness, Markedness & Correlation.” Journal of Machine Learning Technologies 2 (1): 37–63.
  20. Varian, H. R. 2014. “Big Data: New Tricks for Econometrics.” Journal of Economic Perspectives 28 (2): 3–28.


We thank Guillaume Bédard-Pagé, Lerby Ergun, Jean-Sébastien Fontaine, Guillaume Nolin and Adrian Walton for helpful comments and suggestions.


Bank of Canada staff analytical notes are short articles that focus on topical issues relevant to the current economic and financial context, produced independently from the Bank’s Governing Council. This work may support or challenge prevailing policy orthodoxy. Therefore, the views expressed in this note are solely those of the authors and may differ from official Bank of Canada views. No responsibility for them should be attributed to the Bank.

JEL Code(s): G, G1, G2, G20, G23


On this page
Table of contents