<?xml version="1.0" encoding="UTF-8"?>

<!--XBRL Document Created with Wdesk from Workiva-->
<!--Copyright 2022 Workiva-->
<!--r:8f5d7f8e-04f0-4ead-9f60-67b4a430075f,g:d83275c2-ac51-4534-b9d9-bf5dcd6c87a9-->
<link:linkbase xmlns:link="http://www.xbrl.org/2003/linkbase" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.xbrl.org/2003/linkbase http://www.xbrl.org/2003/xbrl-linkbase-2003-12-31.xsd">
  <link:roleRef roleURI="http://www.nationalmi.com/role/CONSOLIDATEDBALANCESHEETS" xlink:type="simple" xlink:href="nmih-20211231.xsd#CONSOLIDATEDBALANCESHEETS"/>
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/CONSOLIDATEDBALANCESHEETS" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Assets_2da27498-77b8-40b3-bb49-8a9f23fa1812" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_Assets"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtSecurities_8f729dfd-b427-424f-b2e7-867210e7236e" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AvailableForSaleSecuritiesDebtSecurities"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_2da27498-77b8-40b3-bb49-8a9f23fa1812" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtSecurities_8f729dfd-b427-424f-b2e7-867210e7236e" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents_afdb55d6-0404-4a64-ad7d-f4154b32a835" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_2da27498-77b8-40b3-bb49-8a9f23fa1812" xlink:to="loc_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents_afdb55d6-0404-4a64-ad7d-f4154b32a835" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PremiumsReceivableAtCarryingValue_ef29aa62-e54f-4886-a194-2c82496728e7" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PremiumsReceivableAtCarryingValue"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_2da27498-77b8-40b3-bb49-8a9f23fa1812" xlink:to="loc_us-gaap_PremiumsReceivableAtCarryingValue_ef29aa62-e54f-4886-a194-2c82496728e7" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccruedInvestmentIncomeReceivable_856e0902-33bb-4579-b369-0c6dd67a7b02" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AccruedInvestmentIncomeReceivable"/>
    <link:calculationArc order="4" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_2da27498-77b8-40b3-bb49-8a9f23fa1812" xlink:to="loc_us-gaap_AccruedInvestmentIncomeReceivable_856e0902-33bb-4579-b369-0c6dd67a7b02" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PrepaidExpenseCurrentAndNoncurrent_39adda78-fea0-4495-a462-d514da7ba58f" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PrepaidExpenseCurrentAndNoncurrent"/>
    <link:calculationArc order="5" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_2da27498-77b8-40b3-bb49-8a9f23fa1812" xlink:to="loc_us-gaap_PrepaidExpenseCurrentAndNoncurrent_39adda78-fea0-4495-a462-d514da7ba58f" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredPolicyAcquisitionCosts_d7500279-8c3d-4d0b-bae2-51cb8754b7bb" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DeferredPolicyAcquisitionCosts"/>
    <link:calculationArc order="6" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_2da27498-77b8-40b3-bb49-8a9f23fa1812" xlink:to="loc_us-gaap_DeferredPolicyAcquisitionCosts_d7500279-8c3d-4d0b-bae2-51cb8754b7bb" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PropertyPlantAndEquipmentNet_4350b8e3-db5a-443d-b9dc-d863243330ca" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PropertyPlantAndEquipmentNet"/>
    <link:calculationArc order="7" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_2da27498-77b8-40b3-bb49-8a9f23fa1812" xlink:to="loc_us-gaap_PropertyPlantAndEquipmentNet_4350b8e3-db5a-443d-b9dc-d863243330ca" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IntangibleAssetsNetIncludingGoodwill_ac77f162-44fc-4f20-a7a2-2f44b2776511" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IntangibleAssetsNetIncludingGoodwill"/>
    <link:calculationArc order="8" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_2da27498-77b8-40b3-bb49-8a9f23fa1812" xlink:to="loc_us-gaap_IntangibleAssetsNetIncludingGoodwill_ac77f162-44fc-4f20-a7a2-2f44b2776511" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PrepaidReinsurancePremiums_b228f8f4-f1bd-4b2b-944c-2a2ee909596a" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PrepaidReinsurancePremiums"/>
    <link:calculationArc order="9" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_2da27498-77b8-40b3-bb49-8a9f23fa1812" xlink:to="loc_us-gaap_PrepaidReinsurancePremiums_b228f8f4-f1bd-4b2b-944c-2a2ee909596a" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ReinsuranceRecoverablesGross_071a0363-0f6d-4287-8760-c7c7fc9476a6" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ReinsuranceRecoverablesGross"/>
    <link:calculationArc order="10" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_2da27498-77b8-40b3-bb49-8a9f23fa1812" xlink:to="loc_us-gaap_ReinsuranceRecoverablesGross_071a0363-0f6d-4287-8760-c7c7fc9476a6" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherAssets_6cdd5f3b-cea5-4f58-b70c-3564c0f7b252" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OtherAssets"/>
    <link:calculationArc order="11" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_2da27498-77b8-40b3-bb49-8a9f23fa1812" xlink:to="loc_us-gaap_OtherAssets_6cdd5f3b-cea5-4f58-b70c-3564c0f7b252" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Liabilities_393f7fee-6446-4a9e-8fe5-5a465f526411" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_Liabilities"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LongTermDebt_e20856cb-e6d9-469d-a75c-cb938de6ba29" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LongTermDebt"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Liabilities_393f7fee-6446-4a9e-8fe5-5a465f526411" xlink:to="loc_us-gaap_LongTermDebt_e20856cb-e6d9-469d-a75c-cb938de6ba29" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_UnearnedPremiums_e527b7a7-2aa2-4f89-855c-c400b6a8c4fc" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_UnearnedPremiums"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Liabilities_393f7fee-6446-4a9e-8fe5-5a465f526411" xlink:to="loc_us-gaap_UnearnedPremiums_e527b7a7-2aa2-4f89-855c-c400b6a8c4fc" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccountsPayableAndAccruedLiabilitiesCurrentAndNoncurrent_77b35c0a-b093-4da7-a70d-778bc03ed48f" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AccountsPayableAndAccruedLiabilitiesCurrentAndNoncurrent"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Liabilities_393f7fee-6446-4a9e-8fe5-5a465f526411" xlink:to="loc_us-gaap_AccountsPayableAndAccruedLiabilitiesCurrentAndNoncurrent_77b35c0a-b093-4da7-a70d-778bc03ed48f" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LiabilityForClaimsAndClaimsAdjustmentExpense_64cf08fa-7cbd-4ba3-a1a0-5b805126d53a" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LiabilityForClaimsAndClaimsAdjustmentExpense"/>
    <link:calculationArc order="4" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Liabilities_393f7fee-6446-4a9e-8fe5-5a465f526411" xlink:to="loc_us-gaap_LiabilityForClaimsAndClaimsAdjustmentExpense_64cf08fa-7cbd-4ba3-a1a0-5b805126d53a" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FundsHeldUnderReinsuranceAgreementsLiability_26d6bd7b-7348-4c72-99e5-821a70da88f2" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FundsHeldUnderReinsuranceAgreementsLiability"/>
    <link:calculationArc order="5" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Liabilities_393f7fee-6446-4a9e-8fe5-5a465f526411" xlink:to="loc_us-gaap_FundsHeldUnderReinsuranceAgreementsLiability_26d6bd7b-7348-4c72-99e5-821a70da88f2" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_WarrantsAndRightsOutstanding_413d8265-ee7d-43ec-8a78-b86db2c03406" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_WarrantsAndRightsOutstanding"/>
    <link:calculationArc order="6" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Liabilities_393f7fee-6446-4a9e-8fe5-5a465f526411" xlink:to="loc_us-gaap_WarrantsAndRightsOutstanding_413d8265-ee7d-43ec-8a78-b86db2c03406" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredIncomeTaxLiabilitiesNet_172af79e-53a0-41b9-b9e5-7e6d2e64711b" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DeferredIncomeTaxLiabilitiesNet"/>
    <link:calculationArc order="7" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Liabilities_393f7fee-6446-4a9e-8fe5-5a465f526411" xlink:to="loc_us-gaap_DeferredIncomeTaxLiabilitiesNet_172af79e-53a0-41b9-b9e5-7e6d2e64711b" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherLiabilities_1b18295f-a402-44c6-8300-f1149693aa88" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OtherLiabilities"/>
    <link:calculationArc order="8" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Liabilities_393f7fee-6446-4a9e-8fe5-5a465f526411" xlink:to="loc_us-gaap_OtherLiabilities_1b18295f-a402-44c6-8300-f1149693aa88" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LiabilitiesAndStockholdersEquity_c9e09e2a-feff-4e9c-8578-6ee2aadd08ab" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LiabilitiesAndStockholdersEquity"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Liabilities_6a72f55a-d5cc-4c79-9893-a8308298c899" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_Liabilities"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_LiabilitiesAndStockholdersEquity_c9e09e2a-feff-4e9c-8578-6ee2aadd08ab" xlink:to="loc_us-gaap_Liabilities_6a72f55a-d5cc-4c79-9893-a8308298c899" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommitmentsAndContingencies_be2e9bc1-a09b-4e8a-886c-12c88a893791" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CommitmentsAndContingencies"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_LiabilitiesAndStockholdersEquity_c9e09e2a-feff-4e9c-8578-6ee2aadd08ab" xlink:to="loc_us-gaap_CommitmentsAndContingencies_be2e9bc1-a09b-4e8a-886c-12c88a893791" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockholdersEquity_ab7ac344-e9cf-42e5-b07e-cd0c8637decb" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_StockholdersEquity"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_LiabilitiesAndStockholdersEquity_c9e09e2a-feff-4e9c-8578-6ee2aadd08ab" xlink:to="loc_us-gaap_StockholdersEquity_ab7ac344-e9cf-42e5-b07e-cd0c8637decb" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockholdersEquity_43d31fee-32a9-49a2-8329-78ee012e972c" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_StockholdersEquity"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonStockValueOutstanding_9587c8d5-570c-4316-9cdc-84c6115aee3e" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CommonStockValueOutstanding"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_StockholdersEquity_43d31fee-32a9-49a2-8329-78ee012e972c" xlink:to="loc_us-gaap_CommonStockValueOutstanding_9587c8d5-570c-4316-9cdc-84c6115aee3e" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AdditionalPaidInCapital_61e4c0fd-3d89-482f-b10d-809a10ec5498" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AdditionalPaidInCapital"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_StockholdersEquity_43d31fee-32a9-49a2-8329-78ee012e972c" xlink:to="loc_us-gaap_AdditionalPaidInCapital_61e4c0fd-3d89-482f-b10d-809a10ec5498" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccumulatedOtherComprehensiveIncomeLossNetOfTax_bac7b3fc-5a2c-4e79-b029-f59815247a08" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AccumulatedOtherComprehensiveIncomeLossNetOfTax"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_StockholdersEquity_43d31fee-32a9-49a2-8329-78ee012e972c" xlink:to="loc_us-gaap_AccumulatedOtherComprehensiveIncomeLossNetOfTax_bac7b3fc-5a2c-4e79-b029-f59815247a08" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RetainedEarningsAccumulatedDeficit_3cc40dfd-f7b1-4f8c-94f5-b1bfed3412d4" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_RetainedEarningsAccumulatedDeficit"/>
    <link:calculationArc order="4" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_StockholdersEquity_43d31fee-32a9-49a2-8329-78ee012e972c" xlink:to="loc_us-gaap_RetainedEarningsAccumulatedDeficit_3cc40dfd-f7b1-4f8c-94f5-b1bfed3412d4" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.nationalmi.com/role/CONSOLIDATEDSTATEMENTSOFOPERATIONSANDCOMPREHENSIVEINCOME" xlink:type="simple" xlink:href="nmih-20211231.xsd#CONSOLIDATEDSTATEMENTSOFOPERATIONSANDCOMPREHENSIVEINCOME"/>
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/CONSOLIDATEDSTATEMENTSOFOPERATIONSANDCOMPREHENSIVEINCOME" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest_3d3fd872-5333-43fe-89de-e7599c6c31fe" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CostsAndExpenses_730445e2-5c86-4dae-aad4-53c27b24c3f9" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CostsAndExpenses"/>
    <link:calculationArc order="1" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest_3d3fd872-5333-43fe-89de-e7599c6c31fe" xlink:to="loc_us-gaap_CostsAndExpenses_730445e2-5c86-4dae-aad4-53c27b24c3f9" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Revenues_4d559b74-8474-4f2c-b572-9414cdf219a0" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_Revenues"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest_3d3fd872-5333-43fe-89de-e7599c6c31fe" xlink:to="loc_us-gaap_Revenues_4d559b74-8474-4f2c-b572-9414cdf219a0" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetIncomeLoss_e759b6c5-bd8b-4b11-969c-d00d595890f8" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_NetIncomeLoss"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest_ee56c978-4169-4ad2-b387-25f8d5945ab4" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetIncomeLoss_e759b6c5-bd8b-4b11-969c-d00d595890f8" xlink:to="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest_ee56c978-4169-4ad2-b387-25f8d5945ab4" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeTaxExpenseBenefit_45868324-ea02-4998-a09d-e0bff032b847" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncomeTaxExpenseBenefit"/>
    <link:calculationArc order="2" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetIncomeLoss_e759b6c5-bd8b-4b11-969c-d00d595890f8" xlink:to="loc_us-gaap_IncomeTaxExpenseBenefit_45868324-ea02-4998-a09d-e0bff032b847" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Revenues_ec845af8-e4fc-451a-a5ba-aacde24dda73" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_Revenues"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PremiumsEarnedNet_e92b02db-f7ce-4237-8d8b-047d1d947143" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PremiumsEarnedNet"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Revenues_ec845af8-e4fc-451a-a5ba-aacde24dda73" xlink:to="loc_us-gaap_PremiumsEarnedNet_e92b02db-f7ce-4237-8d8b-047d1d947143" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetInvestmentIncome_585ccc9c-4eff-469d-8160-af93ba5c4ba8" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_NetInvestmentIncome"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Revenues_ec845af8-e4fc-451a-a5ba-aacde24dda73" xlink:to="loc_us-gaap_NetInvestmentIncome_585ccc9c-4eff-469d-8160-af93ba5c4ba8" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_GainLossOnInvestments_5d3548d4-aba5-4fa9-af95-0380a74371d8" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_GainLossOnInvestments"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Revenues_ec845af8-e4fc-451a-a5ba-aacde24dda73" xlink:to="loc_us-gaap_GainLossOnInvestments_5d3548d4-aba5-4fa9-af95-0380a74371d8" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherIncome_b41a0210-7f35-4f51-84df-07a39b80243d" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OtherIncome"/>
    <link:calculationArc order="4" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Revenues_ec845af8-e4fc-451a-a5ba-aacde24dda73" xlink:to="loc_us-gaap_OtherIncome_b41a0210-7f35-4f51-84df-07a39b80243d" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ComprehensiveIncomeNetOfTax_c4b5ee7f-435c-4f39-90e8-0d51cf03be3e" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ComprehensiveIncomeNetOfTax"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetIncomeLoss_c086a6fc-5221-4298-8142-e56c1e181393" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_NetIncomeLoss"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_ComprehensiveIncomeNetOfTax_c4b5ee7f-435c-4f39-90e8-0d51cf03be3e" xlink:to="loc_us-gaap_NetIncomeLoss_c086a6fc-5221-4298-8142-e56c1e181393" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent_5a27bbf1-526f-4a0c-bcf6-6f67e94af45b" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_ComprehensiveIncomeNetOfTax_c4b5ee7f-435c-4f39-90e8-0d51cf03be3e" xlink:to="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent_5a27bbf1-526f-4a0c-bcf6-6f67e94af45b" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CostsAndExpenses_083a1a98-5e02-432e-8930-2ad2aabfc577" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CostsAndExpenses"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncurredClaimsPropertyCasualtyAndLiability_054f2222-efef-4b80-aed4-81c48d798cd7" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncurredClaimsPropertyCasualtyAndLiability"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_CostsAndExpenses_083a1a98-5e02-432e-8930-2ad2aabfc577" xlink:to="loc_us-gaap_IncurredClaimsPropertyCasualtyAndLiability_054f2222-efef-4b80-aed4-81c48d798cd7" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherCostAndExpenseOperating_e07dd413-9848-4f4d-ba80-70436de0c63e" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OtherCostAndExpenseOperating"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_CostsAndExpenses_083a1a98-5e02-432e-8930-2ad2aabfc577" xlink:to="loc_us-gaap_OtherCostAndExpenseOperating_e07dd413-9848-4f4d-ba80-70436de0c63e" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherNonoperatingExpense_36b8782b-f2cc-45d8-82b2-c8912a11857f" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OtherNonoperatingExpense"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_CostsAndExpenses_083a1a98-5e02-432e-8930-2ad2aabfc577" xlink:to="loc_us-gaap_OtherNonoperatingExpense_36b8782b-f2cc-45d8-82b2-c8912a11857f" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InterestExpense_c8e79851-e204-4068-b73d-a772616b1391" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_InterestExpense"/>
    <link:calculationArc order="4" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_CostsAndExpenses_083a1a98-5e02-432e-8930-2ad2aabfc577" xlink:to="loc_us-gaap_InterestExpense_c8e79851-e204-4068-b73d-a772616b1391" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_nmih_GainLossonChangeinFairValueofWarrantLiability_5cbef80a-9b8c-4b2a-bd5d-ba160a97c559" xlink:href="nmih-20211231.xsd#nmih_GainLossonChangeinFairValueofWarrantLiability"/>
    <link:calculationArc order="5" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_CostsAndExpenses_083a1a98-5e02-432e-8930-2ad2aabfc577" xlink:to="loc_nmih_GainLossonChangeinFairValueofWarrantLiability_5cbef80a-9b8c-4b2a-bd5d-ba160a97c559" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_nmih_GainOnChangeInFairValueOfWarrantLiability_f8f25a4f-f5b4-4ae0-bf4d-3cc17d5a7b00" xlink:href="nmih-20211231.xsd#nmih_GainOnChangeInFairValueOfWarrantLiability"/>
    <link:calculationArc order="6" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_CostsAndExpenses_083a1a98-5e02-432e-8930-2ad2aabfc577" xlink:to="loc_nmih_GainOnChangeInFairValueOfWarrantLiability_f8f25a4f-f5b4-4ae0-bf4d-3cc17d5a7b00" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.nationalmi.com/role/CONSOLIDATEDSTATEMENTSOFCASHFLOWS" xlink:type="simple" xlink:href="nmih-20211231.xsd#CONSOLIDATEDSTATEMENTSOFCASHFLOWS"/>
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/CONSOLIDATEDSTATEMENTSOFCASHFLOWS" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_264cc65f-f568-43c0-9591-911184008da1" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_NetCashProvidedByUsedInFinancingActivities"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ProceedsFromIssuanceOfCommonStock_cc2eabe0-5468-4c97-a976-8ae310cddb16" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ProceedsFromIssuanceOfCommonStock"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_264cc65f-f568-43c0-9591-911184008da1" xlink:to="loc_us-gaap_ProceedsFromIssuanceOfCommonStock_cc2eabe0-5468-4c97-a976-8ae310cddb16" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ProceedsFromIssuanceOfSharesUnderIncentiveAndShareBasedCompensationPlansIncludingStockOptions_d30998e1-e1b8-435c-8aa0-ce04ef0e8878" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ProceedsFromIssuanceOfSharesUnderIncentiveAndShareBasedCompensationPlansIncludingStockOptions"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_264cc65f-f568-43c0-9591-911184008da1" xlink:to="loc_us-gaap_ProceedsFromIssuanceOfSharesUnderIncentiveAndShareBasedCompensationPlansIncludingStockOptions_d30998e1-e1b8-435c-8aa0-ce04ef0e8878" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ProceedsFromWarrantExercises_616305eb-5f9d-420f-bd18-a914d740071c" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ProceedsFromWarrantExercises"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_264cc65f-f568-43c0-9591-911184008da1" xlink:to="loc_us-gaap_ProceedsFromWarrantExercises_616305eb-5f9d-420f-bd18-a914d740071c" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ProceedsFromIssuanceOfLongTermDebt_f6d147c7-a370-438c-a9ff-58c2d840113b" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ProceedsFromIssuanceOfLongTermDebt"/>
    <link:calculationArc order="4" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_264cc65f-f568-43c0-9591-911184008da1" xlink:to="loc_us-gaap_ProceedsFromIssuanceOfLongTermDebt_f6d147c7-a370-438c-a9ff-58c2d840113b" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ProceedsFromIssuanceOfSeniorLongTermDebt_bf80b552-3252-46b6-9860-ed8599744178" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ProceedsFromIssuanceOfSeniorLongTermDebt"/>
    <link:calculationArc order="5" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_264cc65f-f568-43c0-9591-911184008da1" xlink:to="loc_us-gaap_ProceedsFromIssuanceOfSeniorLongTermDebt_bf80b552-3252-46b6-9860-ed8599744178" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RepaymentsOfSecuredDebt_17cfa7d4-82b6-43d3-86fb-7177bc4b946a" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_RepaymentsOfSecuredDebt"/>
    <link:calculationArc order="6" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_264cc65f-f568-43c0-9591-911184008da1" xlink:to="loc_us-gaap_RepaymentsOfSecuredDebt_17cfa7d4-82b6-43d3-86fb-7177bc4b946a" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PaymentsOfDebtIssuanceCosts_882149ab-988b-4be7-80a1-e4d3d36c1c8a" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PaymentsOfDebtIssuanceCosts"/>
    <link:calculationArc order="7" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_264cc65f-f568-43c0-9591-911184008da1" xlink:to="loc_us-gaap_PaymentsOfDebtIssuanceCosts_882149ab-988b-4be7-80a1-e4d3d36c1c8a" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PaymentsRelatedToTaxWithholdingForShareBasedCompensation_b941a180-f912-4015-8242-0859c409e547" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PaymentsRelatedToTaxWithholdingForShareBasedCompensation"/>
    <link:calculationArc order="8" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_264cc65f-f568-43c0-9591-911184008da1" xlink:to="loc_us-gaap_PaymentsRelatedToTaxWithholdingForShareBasedCompensation_b941a180-f912-4015-8242-0859c409e547" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RepaymentsOfLongTermDebt_6b4d1cdd-f673-41c5-b76f-1791a5cb936b" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_RepaymentsOfLongTermDebt"/>
    <link:calculationArc order="9" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_264cc65f-f568-43c0-9591-911184008da1" xlink:to="loc_us-gaap_RepaymentsOfLongTermDebt_6b4d1cdd-f673-41c5-b76f-1791a5cb936b" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetCashProvidedByUsedInInvestingActivities_44957507-8f94-4e7f-9bf4-de8c143723a2" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_NetCashProvidedByUsedInInvestingActivities"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PaymentsToAcquireShortTermInvestments_f4df81cc-6471-4be7-a584-197ff4041557" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PaymentsToAcquireShortTermInvestments"/>
    <link:calculationArc order="1" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInInvestingActivities_44957507-8f94-4e7f-9bf4-de8c143723a2" xlink:to="loc_us-gaap_PaymentsToAcquireShortTermInvestments_f4df81cc-6471-4be7-a584-197ff4041557" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PaymentsToAcquireAvailableForSaleSecuritiesDebt_0be7efc2-1458-41fa-bf53-550ae170e032" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PaymentsToAcquireAvailableForSaleSecuritiesDebt"/>
    <link:calculationArc order="2" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInInvestingActivities_44957507-8f94-4e7f-9bf4-de8c143723a2" xlink:to="loc_us-gaap_PaymentsToAcquireAvailableForSaleSecuritiesDebt_0be7efc2-1458-41fa-bf53-550ae170e032" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ProceedsFromSaleOfShortTermInvestments_8bfb56b7-fd0a-4db2-b619-b6fabee2f0d8" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ProceedsFromSaleOfShortTermInvestments"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInInvestingActivities_44957507-8f94-4e7f-9bf4-de8c143723a2" xlink:to="loc_us-gaap_ProceedsFromSaleOfShortTermInvestments_8bfb56b7-fd0a-4db2-b619-b6fabee2f0d8" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ProceedsFromSaleAndMaturityOfAvailableForSaleSecurities_4bf2ff63-313a-4e83-aae1-c8cd46ebbbaa" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ProceedsFromSaleAndMaturityOfAvailableForSaleSecurities"/>
    <link:calculationArc order="4" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInInvestingActivities_44957507-8f94-4e7f-9bf4-de8c143723a2" xlink:to="loc_us-gaap_ProceedsFromSaleAndMaturityOfAvailableForSaleSecurities_4bf2ff63-313a-4e83-aae1-c8cd46ebbbaa" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PaymentsToAcquirePropertyPlantAndEquipment_e9ce3f19-785d-4d8d-831c-71616712566a" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PaymentsToAcquirePropertyPlantAndEquipment"/>
    <link:calculationArc order="5" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInInvestingActivities_44957507-8f94-4e7f-9bf4-de8c143723a2" xlink:to="loc_us-gaap_PaymentsToAcquirePropertyPlantAndEquipment_e9ce3f19-785d-4d8d-831c-71616712566a" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PaymentsToAcquireInterestInSubsidiariesAndAffiliates_836b2df9-ec08-4b8a-84b4-ce2dd4370c07" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PaymentsToAcquireInterestInSubsidiariesAndAffiliates"/>
    <link:calculationArc order="6" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInInvestingActivities_44957507-8f94-4e7f-9bf4-de8c143723a2" xlink:to="loc_us-gaap_PaymentsToAcquireInterestInSubsidiariesAndAffiliates_836b2df9-ec08-4b8a-84b4-ce2dd4370c07" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsPeriodIncreaseDecreaseIncludingExchangeRateEffect_82bf0fc9-0797-4f53-bbc7-b34172d70984" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsPeriodIncreaseDecreaseIncludingExchangeRateEffect"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_e36e8881-a58d-4f08-b98d-c64589eaa0cd" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_NetCashProvidedByUsedInOperatingActivities"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsPeriodIncreaseDecreaseIncludingExchangeRateEffect_82bf0fc9-0797-4f53-bbc7-b34172d70984" xlink:to="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_e36e8881-a58d-4f08-b98d-c64589eaa0cd" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetCashProvidedByUsedInInvestingActivities_17fbb27b-fa7a-4b79-9a98-6a19abe0a621" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_NetCashProvidedByUsedInInvestingActivities"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsPeriodIncreaseDecreaseIncludingExchangeRateEffect_82bf0fc9-0797-4f53-bbc7-b34172d70984" xlink:to="loc_us-gaap_NetCashProvidedByUsedInInvestingActivities_17fbb27b-fa7a-4b79-9a98-6a19abe0a621" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_8cbdf921-f866-4a3f-a780-2c8d3ebb80ae" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_NetCashProvidedByUsedInFinancingActivities"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsPeriodIncreaseDecreaseIncludingExchangeRateEffect_82bf0fc9-0797-4f53-bbc7-b34172d70984" xlink:to="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_8cbdf921-f866-4a3f-a780-2c8d3ebb80ae" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_6ad15d2f-4ca8-42fe-b95b-d9c0a6796f67" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_NetCashProvidedByUsedInOperatingActivities"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetIncomeLoss_d73f9444-8be6-4c72-ab2f-1ef2a4b043e0" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_NetIncomeLoss"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_6ad15d2f-4ca8-42fe-b95b-d9c0a6796f67" xlink:to="loc_us-gaap_NetIncomeLoss_d73f9444-8be6-4c72-ab2f-1ef2a4b043e0" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleRealizedGainLoss_a35666bc-5171-471c-9bdf-151b4c8af26c" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DebtSecuritiesAvailableForSaleRealizedGainLoss"/>
    <link:calculationArc order="2" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_6ad15d2f-4ca8-42fe-b95b-d9c0a6796f67" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleRealizedGainLoss_a35666bc-5171-471c-9bdf-151b4c8af26c" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueAdjustmentOfWarrants_8cfed3e3-1a44-433e-b0c4-74d1f6017505" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FairValueAdjustmentOfWarrants"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_6ad15d2f-4ca8-42fe-b95b-d9c0a6796f67" xlink:to="loc_us-gaap_FairValueAdjustmentOfWarrants_8cfed3e3-1a44-433e-b0c4-74d1f6017505" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DepreciationAmortizationAndAccretionNet_8078e39d-d310-4a69-83d2-971aed6067c3" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DepreciationAmortizationAndAccretionNet"/>
    <link:calculationArc order="4" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_6ad15d2f-4ca8-42fe-b95b-d9c0a6796f67" xlink:to="loc_us-gaap_DepreciationAmortizationAndAccretionNet_8078e39d-d310-4a69-83d2-971aed6067c3" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccretionAmortizationOfDiscountsAndPremiumsInvestments_b0b44f48-d097-4a97-a4f0-4e51573348e7" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AccretionAmortizationOfDiscountsAndPremiumsInvestments"/>
    <link:calculationArc order="5" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_6ad15d2f-4ca8-42fe-b95b-d9c0a6796f67" xlink:to="loc_us-gaap_AccretionAmortizationOfDiscountsAndPremiumsInvestments_b0b44f48-d097-4a97-a4f0-4e51573348e7" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AmortizationOfFinancingCostsAndDiscounts_e20553a7-f9eb-41c7-b677-81e1f14f0472" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AmortizationOfFinancingCostsAndDiscounts"/>
    <link:calculationArc order="6" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_6ad15d2f-4ca8-42fe-b95b-d9c0a6796f67" xlink:to="loc_us-gaap_AmortizationOfFinancingCostsAndDiscounts_e20553a7-f9eb-41c7-b677-81e1f14f0472" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredIncomeTaxesAndTaxCredits_461861e9-e480-471f-93de-a92f4196c854" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DeferredIncomeTaxesAndTaxCredits"/>
    <link:calculationArc order="7" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_6ad15d2f-4ca8-42fe-b95b-d9c0a6796f67" xlink:to="loc_us-gaap_DeferredIncomeTaxesAndTaxCredits_461861e9-e480-471f-93de-a92f4196c854" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensation_e7600e78-3f88-4719-82c1-bf0bb6b4f552" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShareBasedCompensation"/>
    <link:calculationArc order="8" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_6ad15d2f-4ca8-42fe-b95b-d9c0a6796f67" xlink:to="loc_us-gaap_ShareBasedCompensation_e7600e78-3f88-4719-82c1-bf0bb6b4f552" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInPremiumsReceivable_33712133-8afc-484f-ac91-0eb62797abf8" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncreaseDecreaseInPremiumsReceivable"/>
    <link:calculationArc order="9" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_6ad15d2f-4ca8-42fe-b95b-d9c0a6796f67" xlink:to="loc_us-gaap_IncreaseDecreaseInPremiumsReceivable_33712133-8afc-484f-ac91-0eb62797abf8" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInAccruedInvestmentIncomeReceivable_f3b85b43-fe0f-47be-a826-727008fafbbe" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncreaseDecreaseInAccruedInvestmentIncomeReceivable"/>
    <link:calculationArc order="10" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_6ad15d2f-4ca8-42fe-b95b-d9c0a6796f67" xlink:to="loc_us-gaap_IncreaseDecreaseInAccruedInvestmentIncomeReceivable_f3b85b43-fe0f-47be-a826-727008fafbbe" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInPrepaidExpense_eda3ea2f-814d-46a5-bf98-ce2d5322ae9d" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncreaseDecreaseInPrepaidExpense"/>
    <link:calculationArc order="11" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_6ad15d2f-4ca8-42fe-b95b-d9c0a6796f67" xlink:to="loc_us-gaap_IncreaseDecreaseInPrepaidExpense_eda3ea2f-814d-46a5-bf98-ce2d5322ae9d" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInDeferredPolicyAcquisitionCosts_605a1b8e-1470-4c6b-8d41-6023847e40b1" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncreaseDecreaseInDeferredPolicyAcquisitionCosts"/>
    <link:calculationArc order="12" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_6ad15d2f-4ca8-42fe-b95b-d9c0a6796f67" xlink:to="loc_us-gaap_IncreaseDecreaseInDeferredPolicyAcquisitionCosts_605a1b8e-1470-4c6b-8d41-6023847e40b1" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInReinsuranceRecoverable_c2bd479b-b16e-4dfd-8ef6-e0af4f145478" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncreaseDecreaseInReinsuranceRecoverable"/>
    <link:calculationArc order="13" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_6ad15d2f-4ca8-42fe-b95b-d9c0a6796f67" xlink:to="loc_us-gaap_IncreaseDecreaseInReinsuranceRecoverable_c2bd479b-b16e-4dfd-8ef6-e0af4f145478" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInPrepaidDeferredExpenseAndOtherAssets_50ae4a0e-98f2-4aa8-b3a9-0d9be669994f" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncreaseDecreaseInPrepaidDeferredExpenseAndOtherAssets"/>
    <link:calculationArc order="14" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_6ad15d2f-4ca8-42fe-b95b-d9c0a6796f67" xlink:to="loc_us-gaap_IncreaseDecreaseInPrepaidDeferredExpenseAndOtherAssets_50ae4a0e-98f2-4aa8-b3a9-0d9be669994f" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInUnearnedPremiums_6db81b52-1544-4b1f-81fd-e7eb62f3b73d" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncreaseDecreaseInUnearnedPremiums"/>
    <link:calculationArc order="15" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_6ad15d2f-4ca8-42fe-b95b-d9c0a6796f67" xlink:to="loc_us-gaap_IncreaseDecreaseInUnearnedPremiums_6db81b52-1544-4b1f-81fd-e7eb62f3b73d" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInLiabilityForClaimsAndClaimsAdjustmentExpenseReserve_05c613a1-5bfb-4abe-a418-5518ecc86ccf" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncreaseDecreaseInLiabilityForClaimsAndClaimsAdjustmentExpenseReserve"/>
    <link:calculationArc order="16" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_6ad15d2f-4ca8-42fe-b95b-d9c0a6796f67" xlink:to="loc_us-gaap_IncreaseDecreaseInLiabilityForClaimsAndClaimsAdjustmentExpenseReserve_05c613a1-5bfb-4abe-a418-5518ecc86ccf" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_nmih_IncreaseDecreaseinReinsuranceAssetsandLiabilities_b3b08983-f8d2-4918-8c2a-292aab085e06" xlink:href="nmih-20211231.xsd#nmih_IncreaseDecreaseinReinsuranceAssetsandLiabilities"/>
    <link:calculationArc order="17" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_6ad15d2f-4ca8-42fe-b95b-d9c0a6796f67" xlink:to="loc_nmih_IncreaseDecreaseinReinsuranceAssetsandLiabilities_b3b08983-f8d2-4918-8c2a-292aab085e06" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInAccountsPayableAndAccruedLiabilities_3eed299e-f52d-484e-9af9-7022794d9dc5" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncreaseDecreaseInAccountsPayableAndAccruedLiabilities"/>
    <link:calculationArc order="18" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_6ad15d2f-4ca8-42fe-b95b-d9c0a6796f67" xlink:to="loc_us-gaap_IncreaseDecreaseInAccountsPayableAndAccruedLiabilities_3eed299e-f52d-484e-9af9-7022794d9dc5" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_GainLossOnSaleOfStockInSubsidiaryOrEquityMethodInvestee_a07559d5-004c-4f9b-bde9-12bcdb161020" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_GainLossOnSaleOfStockInSubsidiaryOrEquityMethodInvestee"/>
    <link:calculationArc order="19" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_6ad15d2f-4ca8-42fe-b95b-d9c0a6796f67" xlink:to="loc_us-gaap_GainLossOnSaleOfStockInSubsidiaryOrEquityMethodInvestee_a07559d5-004c-4f9b-bde9-12bcdb161020" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseDueFromAffiliates_239331f3-d61c-47bb-8c9b-d8ccbd00eb74" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncreaseDecreaseDueFromAffiliates"/>
    <link:calculationArc order="20" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_6ad15d2f-4ca8-42fe-b95b-d9c0a6796f67" xlink:to="loc_us-gaap_IncreaseDecreaseDueFromAffiliates_239331f3-d61c-47bb-8c9b-d8ccbd00eb74" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.nationalmi.com/role/InvestmentsFairValuesandGrossUnrealizedGainsandLossesDetails" xlink:type="simple" xlink:href="nmih-20211231.xsd#InvestmentsFairValuesandGrossUnrealizedGainsandLossesDetails"/>
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/InvestmentsFairValuesandGrossUnrealizedGainsandLossesDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleDebtSecuritiesAmortizedCostBasis_b8b5eec4-919b-475b-a0da-80c96a2b9e7c" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AvailableForSaleDebtSecuritiesAmortizedCostBasis"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedLossBeforeTax_7cd95f02-ecdf-4129-b5a0-624884e63694" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedLossBeforeTax"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AvailableForSaleDebtSecuritiesAmortizedCostBasis_b8b5eec4-919b-475b-a0da-80c96a2b9e7c" xlink:to="loc_us-gaap_AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedLossBeforeTax_7cd95f02-ecdf-4129-b5a0-624884e63694" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedGainBeforeTax_c237ac09-6eba-4071-a984-9914d0f630f0" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedGainBeforeTax"/>
    <link:calculationArc order="2" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AvailableForSaleDebtSecuritiesAmortizedCostBasis_b8b5eec4-919b-475b-a0da-80c96a2b9e7c" xlink:to="loc_us-gaap_AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedGainBeforeTax_c237ac09-6eba-4071-a984-9914d0f630f0" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtSecurities_5022e31e-c8bf-4a4e-8c88-297f9083c071" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AvailableForSaleSecuritiesDebtSecurities"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AvailableForSaleDebtSecuritiesAmortizedCostBasis_b8b5eec4-919b-475b-a0da-80c96a2b9e7c" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtSecurities_5022e31e-c8bf-4a4e-8c88-297f9083c071" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.nationalmi.com/role/InvestmentsScheduledMaturitiesDetails" xlink:type="simple" xlink:href="nmih-20211231.xsd#InvestmentsScheduledMaturitiesDetails"/>
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/InvestmentsScheduledMaturitiesDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleDebtSecuritiesAmortizedCostBasis_6c4ffa98-af4d-4a0e-b666-3f72355a06c5" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AvailableForSaleDebtSecuritiesAmortizedCostBasis"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesNextRollingTwelveMonthsAmortizedCostBasis_b0e7be05-7b76-479b-aeac-51fab5933393" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AvailableForSaleSecuritiesDebtMaturitiesNextRollingTwelveMonthsAmortizedCostBasis"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AvailableForSaleDebtSecuritiesAmortizedCostBasis_6c4ffa98-af4d-4a0e-b666-3f72355a06c5" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesNextRollingTwelveMonthsAmortizedCostBasis_b0e7be05-7b76-479b-aeac-51fab5933393" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesRollingYearTwoThroughFiveAmortizedCostBasis_f5d838b7-6f40-47a4-bccb-3c35efc5b009" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AvailableForSaleSecuritiesDebtMaturitiesRollingYearTwoThroughFiveAmortizedCostBasis"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AvailableForSaleDebtSecuritiesAmortizedCostBasis_6c4ffa98-af4d-4a0e-b666-3f72355a06c5" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesRollingYearTwoThroughFiveAmortizedCostBasis_f5d838b7-6f40-47a4-bccb-3c35efc5b009" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesRollingYearSixThroughTenAmortizedCostBasis_3dc08707-5fb0-489c-9d1e-f9ff79a53c15" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AvailableForSaleSecuritiesDebtMaturitiesRollingYearSixThroughTenAmortizedCostBasis"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AvailableForSaleDebtSecuritiesAmortizedCostBasis_6c4ffa98-af4d-4a0e-b666-3f72355a06c5" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesRollingYearSixThroughTenAmortizedCostBasis_3dc08707-5fb0-489c-9d1e-f9ff79a53c15" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesRollingAfterYearTenAmortizedCostBasis_382eae2a-f018-406a-908c-f10bbb325de4" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AvailableForSaleSecuritiesDebtMaturitiesRollingAfterYearTenAmortizedCostBasis"/>
    <link:calculationArc order="4" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AvailableForSaleDebtSecuritiesAmortizedCostBasis_6c4ffa98-af4d-4a0e-b666-3f72355a06c5" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesRollingAfterYearTenAmortizedCostBasis_382eae2a-f018-406a-908c-f10bbb325de4" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesWithoutSingleMaturityDateAmortizedCost_0e89927a-a2ea-469a-ba42-fc7e18b4f19d" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AvailableForSaleSecuritiesDebtMaturitiesWithoutSingleMaturityDateAmortizedCost"/>
    <link:calculationArc order="5" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AvailableForSaleDebtSecuritiesAmortizedCostBasis_6c4ffa98-af4d-4a0e-b666-3f72355a06c5" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesWithoutSingleMaturityDateAmortizedCost_0e89927a-a2ea-469a-ba42-fc7e18b4f19d" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtSecurities_d37c4128-26b3-4358-bb5d-e2590b8965fc" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AvailableForSaleSecuritiesDebtSecurities"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesNextRollingTwelveMonthsFairValue_5c0a7240-b71f-4b5c-9f6c-0286c5598ab1" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AvailableForSaleSecuritiesDebtMaturitiesNextRollingTwelveMonthsFairValue"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AvailableForSaleSecuritiesDebtSecurities_d37c4128-26b3-4358-bb5d-e2590b8965fc" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesNextRollingTwelveMonthsFairValue_5c0a7240-b71f-4b5c-9f6c-0286c5598ab1" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesRollingYearTwoThroughFiveFairValue_d2198bf7-d97b-4df4-96b8-e636742af2c2" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AvailableForSaleSecuritiesDebtMaturitiesRollingYearTwoThroughFiveFairValue"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AvailableForSaleSecuritiesDebtSecurities_d37c4128-26b3-4358-bb5d-e2590b8965fc" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesRollingYearTwoThroughFiveFairValue_d2198bf7-d97b-4df4-96b8-e636742af2c2" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesRollingYearSixThroughTenFairValue_713e21e7-97e6-4a3d-9452-2063b5ee9528" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AvailableForSaleSecuritiesDebtMaturitiesRollingYearSixThroughTenFairValue"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AvailableForSaleSecuritiesDebtSecurities_d37c4128-26b3-4358-bb5d-e2590b8965fc" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesRollingYearSixThroughTenFairValue_713e21e7-97e6-4a3d-9452-2063b5ee9528" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesRollingAfterYearTenFairValue_26abbf8b-60dd-47c7-a7dc-b2818778e9fc" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AvailableForSaleSecuritiesDebtMaturitiesRollingAfterYearTenFairValue"/>
    <link:calculationArc order="4" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AvailableForSaleSecuritiesDebtSecurities_d37c4128-26b3-4358-bb5d-e2590b8965fc" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesRollingAfterYearTenFairValue_26abbf8b-60dd-47c7-a7dc-b2818778e9fc" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesWithoutSingleMaturityDateFairValue_155a21a0-a84d-4201-b294-0fabdb04c5b3" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AvailableForSaleSecuritiesDebtMaturitiesWithoutSingleMaturityDateFairValue"/>
    <link:calculationArc order="5" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AvailableForSaleSecuritiesDebtSecurities_d37c4128-26b3-4358-bb5d-e2590b8965fc" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesWithoutSingleMaturityDateFairValue_155a21a0-a84d-4201-b294-0fabdb04c5b3" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.nationalmi.com/role/InvestmentsAgingofUnrealizedLossesDetails" xlink:type="simple" xlink:href="nmih-20211231.xsd#InvestmentsAgingofUnrealizedLossesDetails"/>
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/InvestmentsAgingofUnrealizedLossesDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPositionNumberOfPositions_d65c8f68-bb25-4783-87a5-cde3e2215769" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPositionNumberOfPositions"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLongerNumberOfPositions_d30c9ab5-c7bf-4abb-bb05-08c7db2a7fa6" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLongerNumberOfPositions"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPositionNumberOfPositions_d65c8f68-bb25-4783-87a5-cde3e2215769" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLongerNumberOfPositions_d30c9ab5-c7bf-4abb-bb05-08c7db2a7fa6" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionLessThan12MonthsNumberOfPositions_f91b30ab-a2e6-443c-b1aa-3635627cfede" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionLessThan12MonthsNumberOfPositions"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPositionNumberOfPositions_d65c8f68-bb25-4783-87a5-cde3e2215769" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionLessThan12MonthsNumberOfPositions_f91b30ab-a2e6-443c-b1aa-3635627cfede" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPositionAccumulatedLoss_0b82b49a-0d04-46f4-a6d8-d2e6ef8e3674" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPositionAccumulatedLoss"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionLessThan12MonthsAccumulatedLoss_7520ed1a-c65c-4a42-be29-9bb739608ad4" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionLessThan12MonthsAccumulatedLoss"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPositionAccumulatedLoss_0b82b49a-0d04-46f4-a6d8-d2e6ef8e3674" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionLessThan12MonthsAccumulatedLoss_7520ed1a-c65c-4a42-be29-9bb739608ad4" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLongerAccumulatedLoss_b39702fd-7d67-4219-a8f2-dea22ef80546" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLongerAccumulatedLoss"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPositionAccumulatedLoss_0b82b49a-0d04-46f4-a6d8-d2e6ef8e3674" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLongerAccumulatedLoss_b39702fd-7d67-4219-a8f2-dea22ef80546" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPosition_64e09b3c-8e3f-4a53-bd7b-a656ba1a74fb" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPosition"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionLessThan12Months_3deb2649-6e4f-4c95-9781-247d8912e47d" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionLessThan12Months"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPosition_64e09b3c-8e3f-4a53-bd7b-a656ba1a74fb" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionLessThan12Months_3deb2649-6e4f-4c95-9781-247d8912e47d" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLonger_5b3cbfe5-d560-46b5-bc91-67b5798546f4" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLonger"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPosition_64e09b3c-8e3f-4a53-bd7b-a656ba1a74fb" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLonger_5b3cbfe5-d560-46b5-bc91-67b5798546f4" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.nationalmi.com/role/InvestmentsNetInvestmentIncomeDetails" xlink:type="simple" xlink:href="nmih-20211231.xsd#InvestmentsNetInvestmentIncomeDetails"/>
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/InvestmentsNetInvestmentIncomeDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InvestmentIncomeNet_1af79000-865b-4d1a-b302-9107e67690ab" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_InvestmentIncomeNet"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InvestmentIncomeInvestmentExpense_c6493ce1-ce93-44a6-82a0-a8909757424c" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_InvestmentIncomeInvestmentExpense"/>
    <link:calculationArc order="1" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_InvestmentIncomeNet_1af79000-865b-4d1a-b302-9107e67690ab" xlink:to="loc_us-gaap_InvestmentIncomeInvestmentExpense_c6493ce1-ce93-44a6-82a0-a8909757424c" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InvestmentIncomeInterestAndDividend_28643fcb-d1ae-49e5-8e34-9501f4d1dbc7" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_InvestmentIncomeInterestAndDividend"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_InvestmentIncomeNet_1af79000-865b-4d1a-b302-9107e67690ab" xlink:to="loc_us-gaap_InvestmentIncomeInterestAndDividend_28643fcb-d1ae-49e5-8e34-9501f4d1dbc7" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.nationalmi.com/role/InvestmentsNetRealizedInvestmentsGainsLossesDetails" xlink:type="simple" xlink:href="nmih-20211231.xsd#InvestmentsNetRealizedInvestmentsGainsLossesDetails"/>
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/InvestmentsNetRealizedInvestmentsGainsLossesDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleRealizedGainLoss_a7bb2d7a-ebc1-4b52-a488-34929c5ba8c0" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DebtSecuritiesAvailableForSaleRealizedGainLoss"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleRealizedGain_bf32447a-a1d9-4e62-b17f-47fc8437c310" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DebtSecuritiesAvailableForSaleRealizedGain"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_DebtSecuritiesAvailableForSaleRealizedGainLoss_a7bb2d7a-ebc1-4b52-a488-34929c5ba8c0" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleRealizedGain_bf32447a-a1d9-4e62-b17f-47fc8437c310" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleRealizedLoss_1247cb6f-f485-451c-9d19-f1dacda1d611" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DebtSecuritiesAvailableForSaleRealizedLoss"/>
    <link:calculationArc order="2" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_DebtSecuritiesAvailableForSaleRealizedGainLoss_a7bb2d7a-ebc1-4b52-a488-34929c5ba8c0" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleRealizedLoss_1247cb6f-f485-451c-9d19-f1dacda1d611" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.nationalmi.com/role/FairValueofFinancialInstrumentsAssetsandLiabilitiesatFairValueDetails" xlink:type="simple" xlink:href="nmih-20211231.xsd#FairValueofFinancialInstrumentsAssetsandLiabilitiesatFairValueDetails"/>
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/FairValueofFinancialInstrumentsAssetsandLiabilitiesatFairValueDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LiabilitiesFairValueDisclosure_0551d7fd-6152-42e8-966b-0a3fba73085b" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LiabilitiesFairValueDisclosure"/>
    <link:loc xlink:type="locator" xlink:label="loc_nmih_WarrantLiability_20e4c680-ad35-4f65-8d6c-f18286bc146e" xlink:href="nmih-20211231.xsd#nmih_WarrantLiability"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_LiabilitiesFairValueDisclosure_0551d7fd-6152-42e8-966b-0a3fba73085b" xlink:to="loc_nmih_WarrantLiability_20e4c680-ad35-4f65-8d6c-f18286bc146e" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AssetsFairValueDisclosure_7a4e205f-263f-4005-944b-bfa7148cefd4" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AssetsFairValueDisclosure"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtSecurities_76796814-6cf3-4852-bbaa-8a6f44284d23" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AvailableForSaleSecuritiesDebtSecurities"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AssetsFairValueDisclosure_7a4e205f-263f-4005-944b-bfa7148cefd4" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtSecurities_76796814-6cf3-4852-bbaa-8a6f44284d23" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CashAndCashEquivalentsFairValueDisclosure_732b01c3-b06a-4d14-b69f-70beb6148437" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CashAndCashEquivalentsFairValueDisclosure"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AssetsFairValueDisclosure_7a4e205f-263f-4005-944b-bfa7148cefd4" xlink:to="loc_us-gaap_CashAndCashEquivalentsFairValueDisclosure_732b01c3-b06a-4d14-b69f-70beb6148437" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.nationalmi.com/role/ReinsuranceEffectofReinsuranceAgreementsonPremiumsWrittenandEarnedDetails" xlink:type="simple" xlink:href="nmih-20211231.xsd#ReinsuranceEffectofReinsuranceAgreementsonPremiumsWrittenandEarnedDetails"/>
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/ReinsuranceEffectofReinsuranceAgreementsonPremiumsWrittenandEarnedDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PremiumsEarnedNet_6cf047e3-5052-49d7-af5f-939fddb7c49c" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PremiumsEarnedNet"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DirectPremiumsEarned_23953aaf-5f46-4853-983d-a7955572a7df" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DirectPremiumsEarned"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_PremiumsEarnedNet_6cf047e3-5052-49d7-af5f-939fddb7c49c" xlink:to="loc_us-gaap_DirectPremiumsEarned_23953aaf-5f46-4853-983d-a7955572a7df" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CededPremiumsEarned_a34fa610-2f6d-4701-9775-9325279dabf2" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CededPremiumsEarned"/>
    <link:calculationArc order="2" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_PremiumsEarnedNet_6cf047e3-5052-49d7-af5f-939fddb7c49c" xlink:to="loc_us-gaap_CededPremiumsEarned_a34fa610-2f6d-4701-9775-9325279dabf2" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PremiumsWrittenNet_322fbbd2-243c-4456-be52-79d878215353" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PremiumsWrittenNet"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DirectPremiumsWritten_8c118ef7-ee70-4b4c-be64-b09d84ee8025" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DirectPremiumsWritten"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_PremiumsWrittenNet_322fbbd2-243c-4456-be52-79d878215353" xlink:to="loc_us-gaap_DirectPremiumsWritten_8c118ef7-ee70-4b4c-be64-b09d84ee8025" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CededPremiumsWritten_bd95a3f1-339d-4de8-81e9-efc40276d837" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CededPremiumsWritten"/>
    <link:calculationArc order="2" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_PremiumsWrittenNet_322fbbd2-243c-4456-be52-79d878215353" xlink:to="loc_us-gaap_CededPremiumsWritten_bd95a3f1-339d-4de8-81e9-efc40276d837" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.nationalmi.com/role/ReservesforInsuranceClaimsandClaimExpensesReconciliationofReserveBalancesforInsuranceClaimsandClaimExpenseDetails" xlink:type="simple" xlink:href="nmih-20211231.xsd#ReservesforInsuranceClaimsandClaimExpensesReconciliationofReserveBalancesforInsuranceClaimsandClaimExpenseDetails"/>
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/ReservesforInsuranceClaimsandClaimExpensesReconciliationofReserveBalancesforInsuranceClaimsandClaimExpenseDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PaymentsForLossesAndLossAdjustmentExpense_8f612292-f0a8-46a7-ae0f-a70970fd02aa" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PaymentsForLossesAndLossAdjustmentExpense"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LiabilityForUnpaidClaimsAndClaimsAdjustmentExpenseClaimsPaidCurrentYear1_d930a28e-a9cd-47a7-a41e-393021381b6e" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LiabilityForUnpaidClaimsAndClaimsAdjustmentExpenseClaimsPaidCurrentYear1"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_PaymentsForLossesAndLossAdjustmentExpense_8f612292-f0a8-46a7-ae0f-a70970fd02aa" xlink:to="loc_us-gaap_LiabilityForUnpaidClaimsAndClaimsAdjustmentExpenseClaimsPaidCurrentYear1_d930a28e-a9cd-47a7-a41e-393021381b6e" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LiabilityForUnpaidClaimsAndClaimsAdjustmentExpenseClaimsPaidPriorYears1_bf6edb96-ee9e-409a-b165-045205ac9410" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LiabilityForUnpaidClaimsAndClaimsAdjustmentExpenseClaimsPaidPriorYears1"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_PaymentsForLossesAndLossAdjustmentExpense_8f612292-f0a8-46a7-ae0f-a70970fd02aa" xlink:to="loc_us-gaap_LiabilityForUnpaidClaimsAndClaimsAdjustmentExpenseClaimsPaidPriorYears1_bf6edb96-ee9e-409a-b165-045205ac9410" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_nmih_LiabilityForUnpaidClaimsAndClaimsAdjustmentExpenseClaimsPaidReinsuranceTerminations_2d8640fd-b91b-483a-8ca1-24696f372a0d" xlink:href="nmih-20211231.xsd#nmih_LiabilityForUnpaidClaimsAndClaimsAdjustmentExpenseClaimsPaidReinsuranceTerminations"/>
    <link:calculationArc order="3" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_PaymentsForLossesAndLossAdjustmentExpense_8f612292-f0a8-46a7-ae0f-a70970fd02aa" xlink:to="loc_nmih_LiabilityForUnpaidClaimsAndClaimsAdjustmentExpenseClaimsPaidReinsuranceTerminations_2d8640fd-b91b-483a-8ca1-24696f372a0d" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LiabilityForUnpaidClaimsAndClaimsAdjustmentExpenseNet_a63a668b-33a5-4b25-ba57-36f417554574" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LiabilityForUnpaidClaimsAndClaimsAdjustmentExpenseNet"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LiabilityForClaimsAndClaimsAdjustmentExpense_81a49c43-fb5f-4299-95d9-c57432637ff6" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LiabilityForClaimsAndClaimsAdjustmentExpense"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_LiabilityForUnpaidClaimsAndClaimsAdjustmentExpenseNet_a63a668b-33a5-4b25-ba57-36f417554574" xlink:to="loc_us-gaap_LiabilityForClaimsAndClaimsAdjustmentExpense_81a49c43-fb5f-4299-95d9-c57432637ff6" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ReinsuranceRecoverablesOnPaidAndUnpaidLosses_a771c0e3-6131-49bf-82cc-472d3d1d2387" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ReinsuranceRecoverablesOnPaidAndUnpaidLosses"/>
    <link:calculationArc order="2" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_LiabilityForUnpaidClaimsAndClaimsAdjustmentExpenseNet_a63a668b-33a5-4b25-ba57-36f417554574" xlink:to="loc_us-gaap_ReinsuranceRecoverablesOnPaidAndUnpaidLosses_a771c0e3-6131-49bf-82cc-472d3d1d2387" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LiabilityForUnpaidClaimsAndClaimsAdjustmentExpenseIncurredClaims1_2f50b8f1-4d3f-4328-85dd-6bb3b6bf70bc" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LiabilityForUnpaidClaimsAndClaimsAdjustmentExpenseIncurredClaims1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SupplementalInformationForPropertyCasualtyInsuranceUnderwritersCurrentYearClaimsAndClaimsAdjustmentExpense_496c8420-3b3b-49d9-a1e7-747b7ea78013" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_SupplementalInformationForPropertyCasualtyInsuranceUnderwritersCurrentYearClaimsAndClaimsAdjustmentExpense"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_LiabilityForUnpaidClaimsAndClaimsAdjustmentExpenseIncurredClaims1_2f50b8f1-4d3f-4328-85dd-6bb3b6bf70bc" xlink:to="loc_us-gaap_SupplementalInformationForPropertyCasualtyInsuranceUnderwritersCurrentYearClaimsAndClaimsAdjustmentExpense_496c8420-3b3b-49d9-a1e7-747b7ea78013" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SupplementalInformationForPropertyCasualtyInsuranceUnderwritersPriorYearClaimsAndClaimsAdjustmentExpense_d0bde251-315f-4950-b1b9-439e7904693a" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_SupplementalInformationForPropertyCasualtyInsuranceUnderwritersPriorYearClaimsAndClaimsAdjustmentExpense"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_LiabilityForUnpaidClaimsAndClaimsAdjustmentExpenseIncurredClaims1_2f50b8f1-4d3f-4328-85dd-6bb3b6bf70bc" xlink:to="loc_us-gaap_SupplementalInformationForPropertyCasualtyInsuranceUnderwritersPriorYearClaimsAndClaimsAdjustmentExpense_d0bde251-315f-4950-b1b9-439e7904693a" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.nationalmi.com/role/ReservesforInsuranceClaimsandClaimExpensesReconciliationofDisclosureofIncurredandPaidClaimsDevelopmenttotheLiabilityforUnpaidClaimsandClaimsAdjustmentExpensesDetails" xlink:type="simple" xlink:href="nmih-20211231.xsd#ReservesforInsuranceClaimsandClaimExpensesReconciliationofDisclosureofIncurredandPaidClaimsDevelopmenttotheLiabilityforUnpaidClaimsandClaimsAdjustmentExpensesDetails"/>
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/ReservesforInsuranceClaimsandClaimExpensesReconciliationofDisclosureofIncurredandPaidClaimsDevelopmenttotheLiabilityforUnpaidClaimsandClaimsAdjustmentExpensesDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShortdurationInsuranceContractsLiabilityForUnpaidClaimsAndAllocatedClaimAdjustmentExpenseNet_3c1994f5-0abc-4f6b-9dcc-1445edaecefa" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShortdurationInsuranceContractsLiabilityForUnpaidClaimsAndAllocatedClaimAdjustmentExpenseNet"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShortdurationInsuranceContractsIncurredClaimsAndAllocatedClaimAdjustmentExpenseNet_285a6910-a432-4ce0-b492-5858c1475b4e" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShortdurationInsuranceContractsIncurredClaimsAndAllocatedClaimAdjustmentExpenseNet"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_ShortdurationInsuranceContractsLiabilityForUnpaidClaimsAndAllocatedClaimAdjustmentExpenseNet_3c1994f5-0abc-4f6b-9dcc-1445edaecefa" xlink:to="loc_us-gaap_ShortdurationInsuranceContractsIncurredClaimsAndAllocatedClaimAdjustmentExpenseNet_285a6910-a432-4ce0-b492-5858c1475b4e" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShortdurationInsuranceContractsCumulativePaidClaimsAndAllocatedClaimAdjustmentExpenseNet_bbee5833-6e14-4ca4-a51a-c48af04fd792" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ShortdurationInsuranceContractsCumulativePaidClaimsAndAllocatedClaimAdjustmentExpenseNet"/>
    <link:calculationArc order="2" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_ShortdurationInsuranceContractsLiabilityForUnpaidClaimsAndAllocatedClaimAdjustmentExpenseNet_3c1994f5-0abc-4f6b-9dcc-1445edaecefa" xlink:to="loc_us-gaap_ShortdurationInsuranceContractsCumulativePaidClaimsAndAllocatedClaimAdjustmentExpenseNet_bbee5833-6e14-4ca4-a51a-c48af04fd792" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.nationalmi.com/role/EarningsperShareDetails" xlink:type="simple" xlink:href="nmih-20211231.xsd#EarningsperShareDetails"/>
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/EarningsperShareDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_WeightedAverageNumberOfDilutedSharesOutstanding_483fbc73-6d36-4ad6-81a5-5bd2350b4687" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_WeightedAverageNumberOfDilutedSharesOutstanding"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_WeightedAverageNumberOfSharesOutstandingBasic_7d39a313-6ac6-4e6f-8796-1e0a23f3f5f9" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_WeightedAverageNumberOfSharesOutstandingBasic"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_WeightedAverageNumberOfDilutedSharesOutstanding_483fbc73-6d36-4ad6-81a5-5bd2350b4687" xlink:to="loc_us-gaap_WeightedAverageNumberOfSharesOutstandingBasic_7d39a313-6ac6-4e6f-8796-1e0a23f3f5f9" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_WeightedAverageNumberDilutedSharesOutstandingAdjustment_472e4690-be8a-4122-9bac-958ec6cd8e03" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_WeightedAverageNumberDilutedSharesOutstandingAdjustment"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_WeightedAverageNumberOfDilutedSharesOutstanding_483fbc73-6d36-4ad6-81a5-5bd2350b4687" xlink:to="loc_us-gaap_WeightedAverageNumberDilutedSharesOutstandingAdjustment_472e4690-be8a-4122-9bac-958ec6cd8e03" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetIncomeLossAttributableToParentDiluted_cbe7a4b4-ea67-4b21-abaf-4c95fd811490" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_NetIncomeLossAttributableToParentDiluted"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetIncomeLoss_5c47220c-34ed-40f6-9131-c97fa52166fd" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_NetIncomeLoss"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetIncomeLossAttributableToParentDiluted_cbe7a4b4-ea67-4b21-abaf-4c95fd811490" xlink:to="loc_us-gaap_NetIncomeLoss_5c47220c-34ed-40f6-9131-c97fa52166fd" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_nmih_GainOnChangeInFairValueOfWarrantLiability_8a5175e1-c070-4fbe-b420-254509dc2cc8" xlink:href="nmih-20211231.xsd#nmih_GainOnChangeInFairValueOfWarrantLiability"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetIncomeLossAttributableToParentDiluted_cbe7a4b4-ea67-4b21-abaf-4c95fd811490" xlink:to="loc_nmih_GainOnChangeInFairValueOfWarrantLiability_8a5175e1-c070-4fbe-b420-254509dc2cc8" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.nationalmi.com/role/IncomeTaxesComponentsofIncomeTaxExpenseBenefitDetails" xlink:type="simple" xlink:href="nmih-20211231.xsd#IncomeTaxesComponentsofIncomeTaxExpenseBenefitDetails"/>
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/IncomeTaxesComponentsofIncomeTaxExpenseBenefitDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeTaxExpenseBenefit_243c5933-2002-45b1-9580-ac430c0f1b05" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncomeTaxExpenseBenefit"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CurrentIncomeTaxExpenseBenefit_148a6406-e7f0-431b-8888-29ac4d860c48" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CurrentIncomeTaxExpenseBenefit"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_IncomeTaxExpenseBenefit_243c5933-2002-45b1-9580-ac430c0f1b05" xlink:to="loc_us-gaap_CurrentIncomeTaxExpenseBenefit_148a6406-e7f0-431b-8888-29ac4d860c48" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredIncomeTaxExpenseBenefit_fd10bdd0-ddae-4314-929b-7e3d344dfe6c" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DeferredIncomeTaxExpenseBenefit"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_IncomeTaxExpenseBenefit_243c5933-2002-45b1-9580-ac430c0f1b05" xlink:to="loc_us-gaap_DeferredIncomeTaxExpenseBenefit_fd10bdd0-ddae-4314-929b-7e3d344dfe6c" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.nationalmi.com/role/IncomeTaxesEffectiveIncomeTaxRateReconciliationDetails" xlink:type="simple" xlink:href="nmih-20211231.xsd#IncomeTaxesEffectiveIncomeTaxRateReconciliationDetails"/>
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/IncomeTaxesEffectiveIncomeTaxRateReconciliationDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EffectiveIncomeTaxRateContinuingOperations_62adc146-ee3e-4a76-a791-d21b6f6998eb" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_EffectiveIncomeTaxRateContinuingOperations"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EffectiveIncomeTaxRateReconciliationAtFederalStatutoryIncomeTaxRate_b2a0710f-1264-498f-83dc-dc050489c6cb" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_EffectiveIncomeTaxRateReconciliationAtFederalStatutoryIncomeTaxRate"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_EffectiveIncomeTaxRateContinuingOperations_62adc146-ee3e-4a76-a791-d21b6f6998eb" xlink:to="loc_us-gaap_EffectiveIncomeTaxRateReconciliationAtFederalStatutoryIncomeTaxRate_b2a0710f-1264-498f-83dc-dc050489c6cb" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EffectiveIncomeTaxRateReconciliationStateAndLocalIncomeTaxes_815dbaac-6b77-499b-911c-881e634ac144" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_EffectiveIncomeTaxRateReconciliationStateAndLocalIncomeTaxes"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_EffectiveIncomeTaxRateContinuingOperations_62adc146-ee3e-4a76-a791-d21b6f6998eb" xlink:to="loc_us-gaap_EffectiveIncomeTaxRateReconciliationStateAndLocalIncomeTaxes_815dbaac-6b77-499b-911c-881e634ac144" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_nmih_EffectiveIncomeTaxRateReconciliationCompensationShareBasedAndOtherPercent_168e12ab-ef11-403c-b78f-c3dc0f5c4e12" xlink:href="nmih-20211231.xsd#nmih_EffectiveIncomeTaxRateReconciliationCompensationShareBasedAndOtherPercent"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_EffectiveIncomeTaxRateContinuingOperations_62adc146-ee3e-4a76-a791-d21b6f6998eb" xlink:to="loc_nmih_EffectiveIncomeTaxRateReconciliationCompensationShareBasedAndOtherPercent_168e12ab-ef11-403c-b78f-c3dc0f5c4e12" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_nmih_EffectiveIncomeTaxRateReconciliationWarrantGainLossPercent_2ac227f9-98cc-4488-8a41-4677dc1a5ee8" xlink:href="nmih-20211231.xsd#nmih_EffectiveIncomeTaxRateReconciliationWarrantGainLossPercent"/>
    <link:calculationArc order="4" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_EffectiveIncomeTaxRateContinuingOperations_62adc146-ee3e-4a76-a791-d21b6f6998eb" xlink:to="loc_nmih_EffectiveIncomeTaxRateReconciliationWarrantGainLossPercent_2ac227f9-98cc-4488-8a41-4677dc1a5ee8" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EffectiveIncomeTaxRateReconciliationOtherAdjustments_57368b93-e769-472f-95c0-f2ef019ace94" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_EffectiveIncomeTaxRateReconciliationOtherAdjustments"/>
    <link:calculationArc order="5" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_EffectiveIncomeTaxRateContinuingOperations_62adc146-ee3e-4a76-a791-d21b6f6998eb" xlink:to="loc_us-gaap_EffectiveIncomeTaxRateReconciliationOtherAdjustments_57368b93-e769-472f-95c0-f2ef019ace94" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.nationalmi.com/role/IncomeTaxesDeferredTaxAssetandLiabilitiesDetails" xlink:type="simple" xlink:href="nmih-20211231.xsd#IncomeTaxesDeferredTaxAssetandLiabilitiesDetails"/>
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/IncomeTaxesDeferredTaxAssetandLiabilitiesDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredIncomeTaxLiabilities_1d4b133e-d471-4fd9-9ea8-a5a087b3cc18" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DeferredIncomeTaxLiabilities"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredTaxLiabilitiesDeferredExpenseReservesAndAccruals_fd6fd33b-70b1-47f0-aca0-1fce1aca00f6" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DeferredTaxLiabilitiesDeferredExpenseReservesAndAccruals"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_DeferredIncomeTaxLiabilities_1d4b133e-d471-4fd9-9ea8-a5a087b3cc18" xlink:to="loc_us-gaap_DeferredTaxLiabilitiesDeferredExpenseReservesAndAccruals_fd6fd33b-70b1-47f0-aca0-1fce1aca00f6" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredTaxLiabilitiesDeferredExpenseDeferredPolicyAcquisitionCost_aab80bbe-11a6-480f-8545-062985e29ff2" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DeferredTaxLiabilitiesDeferredExpenseDeferredPolicyAcquisitionCost"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_DeferredIncomeTaxLiabilities_1d4b133e-d471-4fd9-9ea8-a5a087b3cc18" xlink:to="loc_us-gaap_DeferredTaxLiabilitiesDeferredExpenseDeferredPolicyAcquisitionCost_aab80bbe-11a6-480f-8545-062985e29ff2" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredTaxLiabilitiesDeferredExpenseCapitalizedSoftware_1746e508-e97f-4915-839c-39979bd0f1d3" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DeferredTaxLiabilitiesDeferredExpenseCapitalizedSoftware"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_DeferredIncomeTaxLiabilities_1d4b133e-d471-4fd9-9ea8-a5a087b3cc18" xlink:to="loc_us-gaap_DeferredTaxLiabilitiesDeferredExpenseCapitalizedSoftware_1746e508-e97f-4915-839c-39979bd0f1d3" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredTaxLiabilitiesInvestments_209045ff-5bb3-444f-a49c-63ba1ec9a41c" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DeferredTaxLiabilitiesInvestments"/>
    <link:calculationArc order="4" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_DeferredIncomeTaxLiabilities_1d4b133e-d471-4fd9-9ea8-a5a087b3cc18" xlink:to="loc_us-gaap_DeferredTaxLiabilitiesInvestments_209045ff-5bb3-444f-a49c-63ba1ec9a41c" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredTaxLiabilitiesOther_cb0c4891-283c-4bbc-865c-8e796916ba58" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DeferredTaxLiabilitiesOther"/>
    <link:calculationArc order="5" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_DeferredIncomeTaxLiabilities_1d4b133e-d471-4fd9-9ea8-a5a087b3cc18" xlink:to="loc_us-gaap_DeferredTaxLiabilitiesOther_cb0c4891-283c-4bbc-865c-8e796916ba58" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredTaxAssetsGross_c5d99044-8c00-4e99-9d45-c64cab34ce68" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DeferredTaxAssetsGross"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredTaxAssetsOperatingLossCarryforwards_1f80c78e-20b5-4bb2-9267-8b948df0624c" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DeferredTaxAssetsOperatingLossCarryforwards"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_DeferredTaxAssetsGross_c5d99044-8c00-4e99-9d45-c64cab34ce68" xlink:to="loc_us-gaap_DeferredTaxAssetsOperatingLossCarryforwards_1f80c78e-20b5-4bb2-9267-8b948df0624c" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredTaxAssetsTaxDeferredExpenseCompensationAndBenefitsShareBasedCompensationCost_3c05108d-616e-47ac-b352-c00fa0e1eda8" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DeferredTaxAssetsTaxDeferredExpenseCompensationAndBenefitsShareBasedCompensationCost"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_DeferredTaxAssetsGross_c5d99044-8c00-4e99-9d45-c64cab34ce68" xlink:to="loc_us-gaap_DeferredTaxAssetsTaxDeferredExpenseCompensationAndBenefitsShareBasedCompensationCost_3c05108d-616e-47ac-b352-c00fa0e1eda8" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredTaxAssetsTaxDeferredExpenseReservesAndAccrualsUnearnedPremiumsReserve_85f854f5-ffcc-4609-b86d-143af4402c9f" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DeferredTaxAssetsTaxDeferredExpenseReservesAndAccrualsUnearnedPremiumsReserve"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_DeferredTaxAssetsGross_c5d99044-8c00-4e99-9d45-c64cab34ce68" xlink:to="loc_us-gaap_DeferredTaxAssetsTaxDeferredExpenseReservesAndAccrualsUnearnedPremiumsReserve_85f854f5-ffcc-4609-b86d-143af4402c9f" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredTaxAssetsTaxDeferredExpenseReservesAndAccrualsOther_95cd6b75-d278-4e7f-af7a-9388ac4e36d8" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DeferredTaxAssetsTaxDeferredExpenseReservesAndAccrualsOther"/>
    <link:calculationArc order="4" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_DeferredTaxAssetsGross_c5d99044-8c00-4e99-9d45-c64cab34ce68" xlink:to="loc_us-gaap_DeferredTaxAssetsTaxDeferredExpenseReservesAndAccrualsOther_95cd6b75-d278-4e7f-af7a-9388ac4e36d8" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredTaxAssetsOther_496f0173-484c-4a30-bcb9-cb1da462198b" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DeferredTaxAssetsOther"/>
    <link:calculationArc order="5" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_DeferredTaxAssetsGross_c5d99044-8c00-4e99-9d45-c64cab34ce68" xlink:to="loc_us-gaap_DeferredTaxAssetsOther_496f0173-484c-4a30-bcb9-cb1da462198b" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredTaxAssetsNet_db1e8843-4b53-4a4a-b451-29cfd7e13562" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DeferredTaxAssetsNet"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredTaxAssetsGross_69ae9db9-7d4e-430f-937e-b366dc60b722" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DeferredTaxAssetsGross"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_DeferredTaxAssetsNet_db1e8843-4b53-4a4a-b451-29cfd7e13562" xlink:to="loc_us-gaap_DeferredTaxAssetsGross_69ae9db9-7d4e-430f-937e-b366dc60b722" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredTaxAssetsValuationAllowance_bb0c0c14-a64c-46b4-b945-a7059b17c9b3" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DeferredTaxAssetsValuationAllowance"/>
    <link:calculationArc order="2" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_DeferredTaxAssetsNet_db1e8843-4b53-4a4a-b451-29cfd7e13562" xlink:to="loc_us-gaap_DeferredTaxAssetsValuationAllowance_bb0c0c14-a64c-46b4-b945-a7059b17c9b3" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredTaxLiabilities_7849c3e6-2436-4a47-b40e-62242c1540d4" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DeferredTaxLiabilities"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredIncomeTaxLiabilities_81627a86-b7d3-4168-a6a0-9f945371a958" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DeferredIncomeTaxLiabilities"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_DeferredTaxLiabilities_7849c3e6-2436-4a47-b40e-62242c1540d4" xlink:to="loc_us-gaap_DeferredIncomeTaxLiabilities_81627a86-b7d3-4168-a6a0-9f945371a958" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredTaxAssetsNet_0d2d4438-1649-44fc-b683-496f5e8d782d" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DeferredTaxAssetsNet"/>
    <link:calculationArc order="2" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_DeferredTaxLiabilities_7849c3e6-2436-4a47-b40e-62242c1540d4" xlink:to="loc_us-gaap_DeferredTaxAssetsNet_0d2d4438-1649-44fc-b683-496f5e8d782d" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.nationalmi.com/role/SoftwareandEquipmentNetBalancesDetails" xlink:type="simple" xlink:href="nmih-20211231.xsd#SoftwareandEquipmentNetBalancesDetails"/>
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/SoftwareandEquipmentNetBalancesDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PropertyPlantAndEquipmentNet_ca7ebd95-48d6-4e88-9240-ba443f8ad844" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PropertyPlantAndEquipmentNet"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PropertyPlantAndEquipmentGross_cac2e47d-3c32-4f7d-bd3b-3e3946c372cd" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PropertyPlantAndEquipmentGross"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_PropertyPlantAndEquipmentNet_ca7ebd95-48d6-4e88-9240-ba443f8ad844" xlink:to="loc_us-gaap_PropertyPlantAndEquipmentGross_cac2e47d-3c32-4f7d-bd3b-3e3946c372cd" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccumulatedDepreciationDepletionAndAmortizationPropertyPlantAndEquipment_c21c639a-0d3b-4cd9-8e03-3537f763da9f" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AccumulatedDepreciationDepletionAndAmortizationPropertyPlantAndEquipment"/>
    <link:calculationArc order="2" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_PropertyPlantAndEquipmentNet_ca7ebd95-48d6-4e88-9240-ba443f8ad844" xlink:to="loc_us-gaap_AccumulatedDepreciationDepletionAndAmortizationPropertyPlantAndEquipment_c21c639a-0d3b-4cd9-8e03-3537f763da9f" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.nationalmi.com/role/IntangibleAssetsandGoodwillDetails" xlink:type="simple" xlink:href="nmih-20211231.xsd#IntangibleAssetsandGoodwillDetails"/>
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/IntangibleAssetsandGoodwillDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IntangibleAssetsNetIncludingGoodwill_a6406418-5d27-40eb-b364-5895eff04dc9" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IntangibleAssetsNetIncludingGoodwill"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Goodwill_bea1cada-0f77-43bf-8366-2a2aba177248" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_Goodwill"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_IntangibleAssetsNetIncludingGoodwill_a6406418-5d27-40eb-b364-5895eff04dc9" xlink:to="loc_us-gaap_Goodwill_bea1cada-0f77-43bf-8366-2a2aba177248" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IndefiniteLivedIntangibleAssetsExcludingGoodwill_f29909c7-b917-4084-961e-6e3166d737b1" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IndefiniteLivedIntangibleAssetsExcludingGoodwill"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_IntangibleAssetsNetIncludingGoodwill_a6406418-5d27-40eb-b364-5895eff04dc9" xlink:to="loc_us-gaap_IndefiniteLivedIntangibleAssetsExcludingGoodwill_f29909c7-b917-4084-961e-6e3166d737b1" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.nationalmi.com/role/CommitmentsandContingenciesFuturePaymentDueUnderOperatingLeasesDetails" xlink:type="simple" xlink:href="nmih-20211231.xsd#CommitmentsandContingenciesFuturePaymentDueUnderOperatingLeasesDetails"/>
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/CommitmentsandContingenciesFuturePaymentDueUnderOperatingLeasesDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue_0afa5e4c-bc49-4ee3-a1e6-b001e4adacec" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueNextTwelveMonths_33e5b24f-441a-4b05-bb22-04358cf5a072" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueNextTwelveMonths"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue_0afa5e4c-bc49-4ee3-a1e6-b001e4adacec" xlink:to="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueNextTwelveMonths_33e5b24f-441a-4b05-bb22-04358cf5a072" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearTwo_5e8faa53-a093-422a-984b-3cb65be411cb" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearTwo"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue_0afa5e4c-bc49-4ee3-a1e6-b001e4adacec" xlink:to="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearTwo_5e8faa53-a093-422a-984b-3cb65be411cb" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.nationalmi.com/role/CommitmentsandContingenciesFuturePaymentDueUnderOperatingLeasesDetails_1" xlink:type="simple" xlink:href="nmih-20211231.xsd#CommitmentsandContingenciesFuturePaymentDueUnderOperatingLeasesDetails_1"/>
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/CommitmentsandContingenciesFuturePaymentDueUnderOperatingLeasesDetails_1" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue_dc69b7ab-b36f-490e-b4b2-183658950859" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LesseeOperatingLeaseLiabilityUndiscountedExcessAmount_21cdb189-7869-4ce1-ae1e-694ae3f1983d" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LesseeOperatingLeaseLiabilityUndiscountedExcessAmount"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue_dc69b7ab-b36f-490e-b4b2-183658950859" xlink:to="loc_us-gaap_LesseeOperatingLeaseLiabilityUndiscountedExcessAmount_21cdb189-7869-4ce1-ae1e-694ae3f1983d" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingLeaseLiability_59bd9404-3507-4ba8-9a77-0a7ac1188b80" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OperatingLeaseLiability"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue_dc69b7ab-b36f-490e-b4b2-183658950859" xlink:to="loc_us-gaap_OperatingLeaseLiability_59bd9404-3507-4ba8-9a77-0a7ac1188b80" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.nationalmi.com/role/RegulatoryInformationScheduleofCombinedStatutoryNetLossStatutorySurplusContingencyReserveandRTCRatiosDetails" xlink:type="simple" xlink:href="nmih-20211231.xsd#RegulatoryInformationScheduleofCombinedStatutoryNetLossStatutorySurplusContingencyReserveandRTCRatiosDetails"/>
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/RegulatoryInformationScheduleofCombinedStatutoryNetLossStatutorySurplusContingencyReserveandRTCRatiosDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_nmih_StatutoryAccountingPracticesStatutoryCapitalAndSurplusIncludingContingencyReserve_1b8ebc6a-5e18-4edd-aff1-ac7b41ceb324" xlink:href="nmih-20211231.xsd#nmih_StatutoryAccountingPracticesStatutoryCapitalAndSurplusIncludingContingencyReserve"/>
    <link:loc xlink:type="locator" xlink:label="loc_nmih_StatutoryAccountingPracticesContingencyReserve_4de37635-c997-48fe-b6b3-2f4702fe8006" xlink:href="nmih-20211231.xsd#nmih_StatutoryAccountingPracticesContingencyReserve"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_nmih_StatutoryAccountingPracticesStatutoryCapitalAndSurplusIncludingContingencyReserve_1b8ebc6a-5e18-4edd-aff1-ac7b41ceb324" xlink:to="loc_nmih_StatutoryAccountingPracticesContingencyReserve_4de37635-c997-48fe-b6b3-2f4702fe8006" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatutoryAccountingPracticesStatutoryCapitalAndSurplusBalance_49e40dd6-2324-4307-b2b3-3c348a264430" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_StatutoryAccountingPracticesStatutoryCapitalAndSurplusBalance"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_nmih_StatutoryAccountingPracticesStatutoryCapitalAndSurplusIncludingContingencyReserve_1b8ebc6a-5e18-4edd-aff1-ac7b41ceb324" xlink:to="loc_us-gaap_StatutoryAccountingPracticesStatutoryCapitalAndSurplusBalance_49e40dd6-2324-4307-b2b3-3c348a264430" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.nationalmi.com/role/SCHEDULEIIFINANCIALINFORMATIONOFREGISTRANTPARENTCOMPANYONLYBalanceSheetsParentCompanyOnlyDetails" xlink:type="simple" xlink:href="nmih-20211231.xsd#SCHEDULEIIFINANCIALINFORMATIONOFREGISTRANTPARENTCOMPANYONLYBalanceSheetsParentCompanyOnlyDetails"/>
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/SCHEDULEIIFINANCIALINFORMATIONOFREGISTRANTPARENTCOMPANYONLYBalanceSheetsParentCompanyOnlyDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Assets_528b3c13-f945-4973-9160-3f5743401d77" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_Assets"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtSecurities_0bab7ac5-926f-4b9a-9277-585b5dcffea4" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AvailableForSaleSecuritiesDebtSecurities"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_528b3c13-f945-4973-9160-3f5743401d77" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtSecurities_0bab7ac5-926f-4b9a-9277-585b5dcffea4" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents_293d844c-5f0e-4b5c-98dc-74389ba9cec0" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_528b3c13-f945-4973-9160-3f5743401d77" xlink:to="loc_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents_293d844c-5f0e-4b5c-98dc-74389ba9cec0" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InvestmentsInAffiliatesSubsidiariesAssociatesAndJointVentures_1dc13202-83c6-43fa-a1d1-0f3cb92b1d1a" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_InvestmentsInAffiliatesSubsidiariesAssociatesAndJointVentures"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_528b3c13-f945-4973-9160-3f5743401d77" xlink:to="loc_us-gaap_InvestmentsInAffiliatesSubsidiariesAssociatesAndJointVentures_1dc13202-83c6-43fa-a1d1-0f3cb92b1d1a" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccruedInvestmentIncomeReceivable_e2ef7e39-b3bf-4e64-a07f-9d0438148214" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AccruedInvestmentIncomeReceivable"/>
    <link:calculationArc order="4" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_528b3c13-f945-4973-9160-3f5743401d77" xlink:to="loc_us-gaap_AccruedInvestmentIncomeReceivable_e2ef7e39-b3bf-4e64-a07f-9d0438148214" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PrepaidExpenseCurrentAndNoncurrent_d5f42b01-9fed-4f65-9780-fb3e67d3f9c9" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PrepaidExpenseCurrentAndNoncurrent"/>
    <link:calculationArc order="5" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_528b3c13-f945-4973-9160-3f5743401d77" xlink:to="loc_us-gaap_PrepaidExpenseCurrentAndNoncurrent_d5f42b01-9fed-4f65-9780-fb3e67d3f9c9" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DueFromAffiliates_f44cf410-a693-4598-9a0e-37abb42315d5" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DueFromAffiliates"/>
    <link:calculationArc order="6" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_528b3c13-f945-4973-9160-3f5743401d77" xlink:to="loc_us-gaap_DueFromAffiliates_f44cf410-a693-4598-9a0e-37abb42315d5" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PropertyPlantAndEquipmentNet_8ed2e38f-34f3-464c-803f-7f66395761a0" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PropertyPlantAndEquipmentNet"/>
    <link:calculationArc order="7" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_528b3c13-f945-4973-9160-3f5743401d77" xlink:to="loc_us-gaap_PropertyPlantAndEquipmentNet_8ed2e38f-34f3-464c-803f-7f66395761a0" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherAssets_3af0345a-d352-4ee5-8972-772561aba17a" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OtherAssets"/>
    <link:calculationArc order="8" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_528b3c13-f945-4973-9160-3f5743401d77" xlink:to="loc_us-gaap_OtherAssets_3af0345a-d352-4ee5-8972-772561aba17a" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.nationalmi.com/role/SCHEDULEIIFINANCIALINFORMATIONOFREGISTRANTPARENTCOMPANYONLYStatementofOperationsParentCompanyOnlyDetails" xlink:type="simple" xlink:href="nmih-20211231.xsd#SCHEDULEIIFINANCIALINFORMATIONOFREGISTRANTPARENTCOMPANYONLYStatementofOperationsParentCompanyOnlyDetails"/>
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/SCHEDULEIIFINANCIALINFORMATIONOFREGISTRANTPARENTCOMPANYONLYStatementofOperationsParentCompanyOnlyDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CostsAndExpenses_c8b6113a-a571-4149-a66c-3c919b14a3c6" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CostsAndExpenses"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherExpenses_04c63c71-702f-4c6b-90d4-d4b9ae1942db" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OtherExpenses"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_CostsAndExpenses_c8b6113a-a571-4149-a66c-3c919b14a3c6" xlink:to="loc_us-gaap_OtherExpenses_04c63c71-702f-4c6b-90d4-d4b9ae1942db" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InterestExpense_55d2aec3-8c5a-4c61-9db4-4ab954b43c68" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_InterestExpense"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_CostsAndExpenses_c8b6113a-a571-4149-a66c-3c919b14a3c6" xlink:to="loc_us-gaap_InterestExpense_55d2aec3-8c5a-4c61-9db4-4ab954b43c68" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_nmih_GainLossonChangeinFairValueofWarrantLiability_c37ae564-17c4-48e7-afa7-d8cbef7c262a" xlink:href="nmih-20211231.xsd#nmih_GainLossonChangeinFairValueofWarrantLiability"/>
    <link:calculationArc order="3" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_CostsAndExpenses_c8b6113a-a571-4149-a66c-3c919b14a3c6" xlink:to="loc_nmih_GainLossonChangeinFairValueofWarrantLiability_c37ae564-17c4-48e7-afa7-d8cbef7c262a" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent_cb0401d1-94a4-46d0-a2bc-481d703f4f4e" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherComprehensiveIncomeUnrealizedHoldingGainLossOnSecuritiesArisingDuringPeriodNetOfTax_12039d13-30ff-4a2d-b89c-9cadd92cc65a" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OtherComprehensiveIncomeUnrealizedHoldingGainLossOnSecuritiesArisingDuringPeriodNetOfTax"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent_cb0401d1-94a4-46d0-a2bc-481d703f4f4e" xlink:to="loc_us-gaap_OtherComprehensiveIncomeUnrealizedHoldingGainLossOnSecuritiesArisingDuringPeriodNetOfTax_12039d13-30ff-4a2d-b89c-9cadd92cc65a" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherComprehensiveIncomeLossReclassificationAdjustmentFromAOCIForSaleOfSecuritiesNetOfTax_4e9e61c3-18ad-4f69-adc3-4d02d30630c6" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OtherComprehensiveIncomeLossReclassificationAdjustmentFromAOCIForSaleOfSecuritiesNetOfTax"/>
    <link:calculationArc order="2" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent_cb0401d1-94a4-46d0-a2bc-481d703f4f4e" xlink:to="loc_us-gaap_OtherComprehensiveIncomeLossReclassificationAdjustmentFromAOCIForSaleOfSecuritiesNetOfTax_4e9e61c3-18ad-4f69-adc3-4d02d30630c6" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_nmih_OtherComprehensiveIncomeLossNetofTaxPortionAttributabletoSubsidiary_3148202a-3a59-4d45-b47c-7a65ff260532" xlink:href="nmih-20211231.xsd#nmih_OtherComprehensiveIncomeLossNetofTaxPortionAttributabletoSubsidiary"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent_cb0401d1-94a4-46d0-a2bc-481d703f4f4e" xlink:to="loc_nmih_OtherComprehensiveIncomeLossNetofTaxPortionAttributabletoSubsidiary_3148202a-3a59-4d45-b47c-7a65ff260532" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest_dbd49587-af1f-4ecb-9ebe-5be7bea6b823" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Revenues_d5a17a23-6ea9-46e8-9ce2-79567210f219" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_Revenues"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest_dbd49587-af1f-4ecb-9ebe-5be7bea6b823" xlink:to="loc_us-gaap_Revenues_d5a17a23-6ea9-46e8-9ce2-79567210f219" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CostsAndExpenses_c4611fe2-cb33-4017-a2f7-9bbc2c752dfa" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CostsAndExpenses"/>
    <link:calculationArc order="2" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest_dbd49587-af1f-4ecb-9ebe-5be7bea6b823" xlink:to="loc_us-gaap_CostsAndExpenses_c4611fe2-cb33-4017-a2f7-9bbc2c752dfa" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeLossFromEquityMethodInvestments_80e18820-5ab4-496f-aa9a-b80fc8d05bcb" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncomeLossFromEquityMethodInvestments"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest_dbd49587-af1f-4ecb-9ebe-5be7bea6b823" xlink:to="loc_us-gaap_IncomeLossFromEquityMethodInvestments_80e18820-5ab4-496f-aa9a-b80fc8d05bcb" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.nationalmi.com/role/SCHEDULEIVFINANCIALINFORMATIONOFREGISTRANTREINSURANCEDetails" xlink:type="simple" xlink:href="nmih-20211231.xsd#SCHEDULEIVFINANCIALINFORMATIONOFREGISTRANTREINSURANCEDetails"/>
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/SCHEDULEIVFINANCIALINFORMATIONOFREGISTRANTREINSURANCEDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PremiumsEarnedNet_6f4b12f1-1b87-4533-976a-634de02ad6a4" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PremiumsEarnedNet"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DirectPremiumsEarned_7b863535-65de-4605-b7fb-c29e4e9a91d1" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DirectPremiumsEarned"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_PremiumsEarnedNet_6f4b12f1-1b87-4533-976a-634de02ad6a4" xlink:to="loc_us-gaap_DirectPremiumsEarned_7b863535-65de-4605-b7fb-c29e4e9a91d1" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CededPremiumsEarned_4f895559-3645-4969-9f7d-7492b28cb660" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CededPremiumsEarned"/>
    <link:calculationArc order="2" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_PremiumsEarnedNet_6f4b12f1-1b87-4533-976a-634de02ad6a4" xlink:to="loc_us-gaap_CededPremiumsEarned_4f895559-3645-4969-9f7d-7492b28cb660" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AssumedPremiumsEarned_abb5f8bf-52fd-42b3-b844-e7534f230175" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AssumedPremiumsEarned"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_PremiumsEarnedNet_6f4b12f1-1b87-4533-976a-634de02ad6a4" xlink:to="loc_us-gaap_AssumedPremiumsEarned_abb5f8bf-52fd-42b3-b844-e7534f230175" xlink:type="arc"/>
  </link:calculationLink>
</link:linkbase>
