IDEAS home Printed from https://ideas.repec.org/p/fip/fedgfe/2024-75.html
   My bibliography  Save this paper

Explaining Machine Learning by Bootstrapping Partial Marginal Effects and Shapley Values

Author

Abstract

Machine learning and artificial intelligence are often described as “black boxes.” Traditional linear regression is interpreted through its marginal relationships as captured by regression coefficients. We show that the same marginal relationship can be described rigorously for any machine learning model by calculating the slope of the partial dependence functions, which we call the partial marginal effect (PME). We prove that the PME of OLS is analytically equivalent to the OLS regression coefficient. Bootstrapping provides standard errors and confidence intervals around the point estimates of the PMEs. We apply the PME to a hedonic house pricing example and demonstrate that the PMEs of neural networks, support vector machines, random forests, and gradient boosting models reveal the non-linear relationships discovered by the machine learning models and allow direct comparison between those models and a traditional linear regression. Finally we extend PME to a Shapley value decomposition and explore how it can be used to further explain model outputs.

Suggested Citation

  • Thomas R. Cook & Zach Modig & Nathan M. Palmer, 2024. "Explaining Machine Learning by Bootstrapping Partial Marginal Effects and Shapley Values," Finance and Economics Discussion Series 2024-075, Board of Governors of the Federal Reserve System (U.S.).
  • Handle: RePEc:fip:fedgfe:2024-75
    DOI: 10.17016/FEDS.2024.075
    as

    Download full text from publisher

    File URL: https://www.federalreserve.gov/econres/feds/files/2024075pap.pdf
    Download Restriction: no

    File URL: https://libkey.io/10.17016/FEDS.2024.075?utm_source=ideas
    LibKey link: if access is restricted and if your library uses this service, LibKey will redirect you to where you can use your library subscription to access this item
    ---><---

    References listed on IDEAS

    as
    1. Glaeser, Edward L. & Sinai, Todd (ed.), 2013. "Housing and the Financial Crisis," National Bureau of Economic Research Books, University of Chicago Press, number 9780226030586, July.
    2. Edward E. Leamer, 2015. "Housing Really Is the Business Cycle: What Survives the Lessons of 2008–09?," Journal of Money, Credit and Banking, Blackwell Publishing, vol. 47(S1), pages 43-50, March.
    3. Marianne Bertrand & Sendhil Mullainathan, 2004. "Are Emily and Greg More Employable Than Lakisha and Jamal? A Field Experiment on Labor Market Discrimination," American Economic Review, American Economic Association, vol. 94(4), pages 991-1013, September.
    4. Richard Williams, 2012. "Using the margins command to estimate and interpret adjusted predictions and marginal effects," Stata Journal, StataCorp LP, vol. 12(2), pages 308-331, June.
    5. Edward L. Glaeser & Todd Sinai, 2013. "Housing and the Financial Crisis," NBER Books, National Bureau of Economic Research, Inc, number glae11-1.
    Full references (including those not matched with items on IDEAS)

    Most related items

    These are the items that most often cite the same works as this one and are cited by the same works as this one.
    1. Begley, Jaclene & Chan, Sewin, 2018. "The effect of housing wealth shocks on work and retirement decisions," Regional Science and Urban Economics, Elsevier, vol. 73(C), pages 180-195.
    2. Ono, Arito & Uchida, Hirofumi & Udell, Gregory F. & Uesugi, Iichiro, 2021. "Lending pro-cyclicality and macroprudential policy: Evidence from Japanese LTV ratios," Journal of Financial Stability, Elsevier, vol. 53(C).
    3. Jane K. Dokko & Benjamin J. Keys & Lindsay E. Relihan, 2019. "Affordability, financial innovation and the start of the housing boom," CEP Discussion Papers dp1611, Centre for Economic Performance, LSE.
    4. Adam M Guren & Alisdair McKay & Emi Nakamura & Jón Steinsson, 2021. "Housing Wealth Effects: The Long View," The Review of Economic Studies, Review of Economic Studies Ltd, vol. 88(2), pages 669-707.
    5. Cerutti, Eugenio & Dagher, Jihad & Dell'Ariccia, Giovanni, 2017. "Housing finance and real-estate booms: A cross-country perspective," Journal of Housing Economics, Elsevier, vol. 38(C), pages 1-13.
    6. Cheol Eun & Lingling Wang & Tim Zhang, 2022. "House Price Growth Synchronization and Business Cycle Alignment," The Journal of Real Estate Finance and Economics, Springer, vol. 65(4), pages 675-710, November.
    7. Peter Leasure & Robert J. Kaminski, 2021. "The Effectiveness of Certificates of Relief: A Correspondence Audit of Hiring Outcomes," Journal of Empirical Legal Studies, John Wiley & Sons, vol. 18(4), pages 849-875, December.
    8. Tomasz Piskorski & Amit Seru, 2018. "Mortgage Market Design: Lessons from the Great Recession," Brookings Papers on Economic Activity, Economic Studies Program, The Brookings Institution, vol. 49(1 (Spring), pages 429-513.
    9. Mølbak Ingholt, Marcus, 2022. "Multiple Credit Constraints and Time-Varying Macroeconomic Dynamics," Journal of Economic Dynamics and Control, Elsevier, vol. 143(C).
    10. Johannes Stroebel & Joseph Vavra, 2019. "House Prices, Local Demand, and Retail Prices," Journal of Political Economy, University of Chicago Press, vol. 127(3), pages 1391-1436.
    11. Takaaki Ohnishi & Takayuki Mizuno & Tsutomu Watanabe, 2019. "House Price Dispersion in Boom-Bust Cycles: Evidence from Tokyo," Working Papers on Central Bank Communication 008, University of Tokyo, Graduate School of Economics.
    12. Stefanie J. Huber & Tobias Schmidt, 2016. "Cross-Country Differences in Homeownership: A Cultural Phenomenon?," ERES eres2016_47, European Real Estate Society (ERES).
    13. Takaaki Ohnishi & Takayuki Mizuno & Tsutomu Watanabe, 2020. "House price dispersion in boom–bust cycles: evidence from Tokyo," The Japanese Economic Review, Springer, vol. 71(4), pages 511-539, October.
    14. Matthew Davis & Fernando V. Ferreira, 2017. "Housing Disease and Public School Finances," NBER Working Papers 24140, National Bureau of Economic Research, Inc.
    15. Takaaki Ohnishi & Takayuki Mizuno & Tsutomu Watanabe, 2019. "House Price Dispersion in Boom-Bust Cycles: Evidence from Tokyo," CARF F-Series CARF-F-461, Center for Advanced Research in Finance, Faculty of Economics, The University of Tokyo.
    16. J. R. Kim & K. Chung, 2014. "Regime switching and the (in)stability of the price-rent relationship: evidence from the US," Applied Economics, Taylor & Francis Journals, vol. 46(33), pages 4041-4052, November.
    17. Shane Thompson, 2017. "College Advising And Gender," Economic Inquiry, Western Economic Association International, vol. 55(2), pages 1007-1016, April.
    18. Huber, Stefanie J. & Schmidt, Tobias, 2022. "Nevertheless, they persist: Cross-country differences in homeownership behavior," Journal of Housing Economics, Elsevier, vol. 55(C).
    19. repec:bin:bpeajo:v:49:y:2019:i:2018-01:p:429-513 is not listed on IDEAS
    20. Tomasz Piskorski & Alexei Tchistyi, 2017. "An Equilibrium Model of Housing and Mortgage Markets with State-Contingent Lending Contracts," NBER Working Papers 23452, National Bureau of Economic Research, Inc.
    21. Paul S. Calem & Julapa Jagtiani & William W. Lang, 2017. "Foreclosure Delay and Consumer Credit Performance," Journal of Financial Services Research, Springer;Western Finance Association, vol. 52(3), pages 225-251, December.

    More about this item

    Keywords

    Machine learning; House prices; Statistical inference;
    All these keywords.

    JEL classification:

    • C14 - Mathematical and Quantitative Methods - - Econometric and Statistical Methods and Methodology: General - - - Semiparametric and Nonparametric Methods: General
    • C18 - Mathematical and Quantitative Methods - - Econometric and Statistical Methods and Methodology: General - - - Methodolical Issues: General
    • C15 - Mathematical and Quantitative Methods - - Econometric and Statistical Methods and Methodology: General - - - Statistical Simulation Methods: General
    • C45 - Mathematical and Quantitative Methods - - Econometric and Statistical Methods: Special Topics - - - Neural Networks and Related Topics
    • C52 - Mathematical and Quantitative Methods - - Econometric Modeling - - - Model Evaluation, Validation, and Selection

    NEP fields

    This paper has been announced in the following NEP Reports:

    Statistics

    Access and download statistics

    Corrections

    All material on this site has been provided by the respective publishers and authors. You can help correct errors and omissions. When requesting a correction, please mention this item's handle: RePEc:fip:fedgfe:2024-75. See general information about how to correct material in RePEc.

    If you have authored this item and are not yet registered with RePEc, we encourage you to do it here. This allows to link your profile to this item. It also allows you to accept potential citations to this item that we are uncertain about.

    If CitEc recognized a bibliographic reference but did not link an item in RePEc to it, you can help with this form .

    If you know of missing items citing this one, you can help us creating those links by adding the relevant references in the same way as above, for each refering item. If you are a registered author of this item, you may also want to check the "citations" tab in your RePEc Author Service profile, as there may be some citations waiting for confirmation.

    For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: Ryan Wolfslayer ; Keisha Fournillier (email available below). General contact details of provider: https://edirc.repec.org/data/frbgvus.html .

    Please note that corrections may take a couple of weeks to filter through the various RePEc services.

    IDEAS is a RePEc service. RePEc uses bibliographic data supplied by the respective publishers.