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

<!--XBRL Document Created with Wdesk from Workiva-->
<!--Copyright 2021 Workiva-->
<!--r:a34a33ac-fb34-4dd2-934c-b50751c8434d,g:7f48eb27-7dfb-4895-ac21-d4939922fb5a-->
<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/CONDENSEDCONSOLIDATEDBALANCESHEETSUNAUDITED" xlink:type="simple" xlink:href="nmih-20210930.xsd#CONDENSEDCONSOLIDATEDBALANCESHEETSUNAUDITED"/>
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/CONDENSEDCONSOLIDATEDBALANCESHEETSUNAUDITED" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockholdersEquity_9c877483-e6a9-4507-a5aa-1550914800c3" 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_6a903f64-ab9e-412c-b2a9-0c969c16ab0e" 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_9c877483-e6a9-4507-a5aa-1550914800c3" xlink:to="loc_us-gaap_CommonStockValueOutstanding_6a903f64-ab9e-412c-b2a9-0c969c16ab0e" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AdditionalPaidInCapital_99419a4e-1c93-443f-a7e7-083d7f468a5a" 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_9c877483-e6a9-4507-a5aa-1550914800c3" xlink:to="loc_us-gaap_AdditionalPaidInCapital_99419a4e-1c93-443f-a7e7-083d7f468a5a" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccumulatedOtherComprehensiveIncomeLossNetOfTax_d8e01cb1-e3d8-4212-bb09-d21ae2555a10" 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_9c877483-e6a9-4507-a5aa-1550914800c3" xlink:to="loc_us-gaap_AccumulatedOtherComprehensiveIncomeLossNetOfTax_d8e01cb1-e3d8-4212-bb09-d21ae2555a10" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RetainedEarningsAccumulatedDeficit_7370fe91-2b17-49e9-a160-0a0cf5ab4cd1" 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_9c877483-e6a9-4507-a5aa-1550914800c3" xlink:to="loc_us-gaap_RetainedEarningsAccumulatedDeficit_7370fe91-2b17-49e9-a160-0a0cf5ab4cd1" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Assets_622eee57-3ead-4f16-b1fc-f13b269c3a2e" 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_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents_887520fe-7e23-46c3-9887-daaff63e1ab7" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_622eee57-3ead-4f16-b1fc-f13b269c3a2e" xlink:to="loc_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents_887520fe-7e23-46c3-9887-daaff63e1ab7" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtSecurities_2b32a9ce-a86c-4d20-b6ff-161675c6ca6e" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AvailableForSaleSecuritiesDebtSecurities"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_622eee57-3ead-4f16-b1fc-f13b269c3a2e" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtSecurities_2b32a9ce-a86c-4d20-b6ff-161675c6ca6e" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherAssets_929626c7-3a5f-4459-a80f-15842bccc316" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OtherAssets"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_622eee57-3ead-4f16-b1fc-f13b269c3a2e" xlink:to="loc_us-gaap_OtherAssets_929626c7-3a5f-4459-a80f-15842bccc316" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PropertyPlantAndEquipmentNet_0617c354-56ea-4fa1-8fa2-421af9362668" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PropertyPlantAndEquipmentNet"/>
    <link:calculationArc order="4" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_622eee57-3ead-4f16-b1fc-f13b269c3a2e" xlink:to="loc_us-gaap_PropertyPlantAndEquipmentNet_0617c354-56ea-4fa1-8fa2-421af9362668" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PrepaidExpenseCurrentAndNoncurrent_cab3ab37-b9a1-4efe-a904-ea5d87274758" 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_622eee57-3ead-4f16-b1fc-f13b269c3a2e" xlink:to="loc_us-gaap_PrepaidExpenseCurrentAndNoncurrent_cab3ab37-b9a1-4efe-a904-ea5d87274758" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredPolicyAcquisitionCosts_a3bcb1d8-9496-4b73-a84a-e0b20dae367e" 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_622eee57-3ead-4f16-b1fc-f13b269c3a2e" xlink:to="loc_us-gaap_DeferredPolicyAcquisitionCosts_a3bcb1d8-9496-4b73-a84a-e0b20dae367e" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PremiumsReceivableAtCarryingValue_8cffda9d-2227-4a57-bd25-29cd793e276f" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PremiumsReceivableAtCarryingValue"/>
    <link:calculationArc order="7" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_622eee57-3ead-4f16-b1fc-f13b269c3a2e" xlink:to="loc_us-gaap_PremiumsReceivableAtCarryingValue_8cffda9d-2227-4a57-bd25-29cd793e276f" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IntangibleAssetsNetIncludingGoodwill_61bd7812-6228-4b41-9c39-fb51c84d8db6" 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_622eee57-3ead-4f16-b1fc-f13b269c3a2e" xlink:to="loc_us-gaap_IntangibleAssetsNetIncludingGoodwill_61bd7812-6228-4b41-9c39-fb51c84d8db6" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PrepaidReinsurancePremiums_3109159a-21a2-4248-8b75-5bffbfef69cc" 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_622eee57-3ead-4f16-b1fc-f13b269c3a2e" xlink:to="loc_us-gaap_PrepaidReinsurancePremiums_3109159a-21a2-4248-8b75-5bffbfef69cc" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ReinsuranceRecoverablesGross_8932c39e-45aa-40ce-899e-81645b899df9" 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_622eee57-3ead-4f16-b1fc-f13b269c3a2e" xlink:to="loc_us-gaap_ReinsuranceRecoverablesGross_8932c39e-45aa-40ce-899e-81645b899df9" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccruedInvestmentIncomeReceivable_0933febc-83e8-427a-ad5e-a6edf63d25fc" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AccruedInvestmentIncomeReceivable"/>
    <link:calculationArc order="11" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_622eee57-3ead-4f16-b1fc-f13b269c3a2e" xlink:to="loc_us-gaap_AccruedInvestmentIncomeReceivable_0933febc-83e8-427a-ad5e-a6edf63d25fc" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LiabilitiesAndStockholdersEquity_cc79188e-5da6-4d5e-987f-91fd27ceb07a" 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_CommitmentsAndContingencies_b4cbe311-701d-4bc5-986d-2ebfca1fe90e" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_CommitmentsAndContingencies"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_LiabilitiesAndStockholdersEquity_cc79188e-5da6-4d5e-987f-91fd27ceb07a" xlink:to="loc_us-gaap_CommitmentsAndContingencies_b4cbe311-701d-4bc5-986d-2ebfca1fe90e" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Liabilities_8b581986-a421-4b49-98c1-639096065438" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_Liabilities"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_LiabilitiesAndStockholdersEquity_cc79188e-5da6-4d5e-987f-91fd27ceb07a" xlink:to="loc_us-gaap_Liabilities_8b581986-a421-4b49-98c1-639096065438" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockholdersEquity_293f5f4d-bc5e-4558-8968-0c841c5cd922" 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_cc79188e-5da6-4d5e-987f-91fd27ceb07a" xlink:to="loc_us-gaap_StockholdersEquity_293f5f4d-bc5e-4558-8968-0c841c5cd922" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Liabilities_035f0f3c-04a4-474e-a288-43b88f8c03ec" 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_AccountsPayableAndAccruedLiabilitiesCurrentAndNoncurrent_5f68356b-d30a-4133-917c-70b5523e6935" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AccountsPayableAndAccruedLiabilitiesCurrentAndNoncurrent"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Liabilities_035f0f3c-04a4-474e-a288-43b88f8c03ec" xlink:to="loc_us-gaap_AccountsPayableAndAccruedLiabilitiesCurrentAndNoncurrent_5f68356b-d30a-4133-917c-70b5523e6935" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SecuredDebt_44c68c58-09fd-428e-9bb8-623ecab4e0d1" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_SecuredDebt"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Liabilities_035f0f3c-04a4-474e-a288-43b88f8c03ec" xlink:to="loc_us-gaap_SecuredDebt_44c68c58-09fd-428e-9bb8-623ecab4e0d1" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherLiabilities_badf0a24-9ad6-4064-a87d-f3cf581d450c" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_OtherLiabilities"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Liabilities_035f0f3c-04a4-474e-a288-43b88f8c03ec" xlink:to="loc_us-gaap_OtherLiabilities_badf0a24-9ad6-4064-a87d-f3cf581d450c" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_UnearnedPremiums_0f85a6e6-41b3-4e7a-b98e-69d30719df96" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_UnearnedPremiums"/>
    <link:calculationArc order="4" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Liabilities_035f0f3c-04a4-474e-a288-43b88f8c03ec" xlink:to="loc_us-gaap_UnearnedPremiums_0f85a6e6-41b3-4e7a-b98e-69d30719df96" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_WarrantsAndRightsOutstanding_96b1d757-1704-4ece-9dbb-09c34cd6998f" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_WarrantsAndRightsOutstanding"/>
    <link:calculationArc order="5" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Liabilities_035f0f3c-04a4-474e-a288-43b88f8c03ec" xlink:to="loc_us-gaap_WarrantsAndRightsOutstanding_96b1d757-1704-4ece-9dbb-09c34cd6998f" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredIncomeTaxLiabilitiesNet_ece04bb0-6ff0-45d3-94e3-9417a0f95c7c" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DeferredIncomeTaxLiabilitiesNet"/>
    <link:calculationArc order="6" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Liabilities_035f0f3c-04a4-474e-a288-43b88f8c03ec" xlink:to="loc_us-gaap_DeferredIncomeTaxLiabilitiesNet_ece04bb0-6ff0-45d3-94e3-9417a0f95c7c" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LiabilityForClaimsAndClaimsAdjustmentExpense_d5950091-fb5b-4fcf-a15f-a9aa199910f8" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_LiabilityForClaimsAndClaimsAdjustmentExpense"/>
    <link:calculationArc order="7" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Liabilities_035f0f3c-04a4-474e-a288-43b88f8c03ec" xlink:to="loc_us-gaap_LiabilityForClaimsAndClaimsAdjustmentExpense_d5950091-fb5b-4fcf-a15f-a9aa199910f8" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FundsHeldUnderReinsuranceAgreementsLiability_d71a0777-f360-4a8b-8344-7fa33e2c8d1b" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_FundsHeldUnderReinsuranceAgreementsLiability"/>
    <link:calculationArc order="8" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Liabilities_035f0f3c-04a4-474e-a288-43b88f8c03ec" xlink:to="loc_us-gaap_FundsHeldUnderReinsuranceAgreementsLiability_d71a0777-f360-4a8b-8344-7fa33e2c8d1b" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.nationalmi.com/role/CONDENSEDCONSOLIDATEDSTATEMENTSOFOPERATIONSANDCOMPREHENSIVEINCOMEUNAUDITED" xlink:type="simple" xlink:href="nmih-20210930.xsd#CONDENSEDCONSOLIDATEDSTATEMENTSOFOPERATIONSANDCOMPREHENSIVEINCOMEUNAUDITED"/>
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/CONDENSEDCONSOLIDATEDSTATEMENTSOFOPERATIONSANDCOMPREHENSIVEINCOMEUNAUDITED" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest_b7f000d1-35ff-4b34-ae07-0707d15fe9fa" 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_7e03211c-f5ea-4b2b-a605-df3c6c4c5b94" 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_b7f000d1-35ff-4b34-ae07-0707d15fe9fa" xlink:to="loc_us-gaap_Revenues_7e03211c-f5ea-4b2b-a605-df3c6c4c5b94" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CostsAndExpenses_b076faf8-6f5f-40fa-9e02-695c83efc42e" 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_b7f000d1-35ff-4b34-ae07-0707d15fe9fa" xlink:to="loc_us-gaap_CostsAndExpenses_b076faf8-6f5f-40fa-9e02-695c83efc42e" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetIncomeLoss_264c7001-ab40-4f0d-a1e5-c4f6d79ae544" 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_22a7c478-53c8-49c8-9eb4-9424367cd44e" 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_264c7001-ab40-4f0d-a1e5-c4f6d79ae544" xlink:to="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest_22a7c478-53c8-49c8-9eb4-9424367cd44e" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeTaxExpenseBenefit_2082e801-eda6-4349-b5ac-a1b6e5a1309a" 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_264c7001-ab40-4f0d-a1e5-c4f6d79ae544" xlink:to="loc_us-gaap_IncomeTaxExpenseBenefit_2082e801-eda6-4349-b5ac-a1b6e5a1309a" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ComprehensiveIncomeNetOfTax_e94fe881-ab0e-49bd-9114-1fac2b1407a3" 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_a777653b-33b3-481a-87b9-b14469eefae8" 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_e94fe881-ab0e-49bd-9114-1fac2b1407a3" xlink:to="loc_us-gaap_NetIncomeLoss_a777653b-33b3-481a-87b9-b14469eefae8" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent_be295ef1-ed22-4cdc-8c91-240b9c723f10" 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_e94fe881-ab0e-49bd-9114-1fac2b1407a3" xlink:to="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent_be295ef1-ed22-4cdc-8c91-240b9c723f10" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Revenues_858a8d53-1aa7-49eb-8bb1-2d2431db4675" 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_efa82c22-ef82-4a85-b18b-7b381566859f" 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_858a8d53-1aa7-49eb-8bb1-2d2431db4675" xlink:to="loc_us-gaap_PremiumsEarnedNet_efa82c22-ef82-4a85-b18b-7b381566859f" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetInvestmentIncome_fbec8fb1-74c4-47b7-9bcb-cf8bd85780c9" 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_858a8d53-1aa7-49eb-8bb1-2d2431db4675" xlink:to="loc_us-gaap_NetInvestmentIncome_fbec8fb1-74c4-47b7-9bcb-cf8bd85780c9" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_GainLossOnInvestments_91e0466f-c2ef-4f95-a416-672b841310ff" 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_858a8d53-1aa7-49eb-8bb1-2d2431db4675" xlink:to="loc_us-gaap_GainLossOnInvestments_91e0466f-c2ef-4f95-a416-672b841310ff" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherIncome_9acbc973-319d-4aae-bebb-9faa72c2792f" 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_858a8d53-1aa7-49eb-8bb1-2d2431db4675" xlink:to="loc_us-gaap_OtherIncome_9acbc973-319d-4aae-bebb-9faa72c2792f" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CostsAndExpenses_dd378922-4dd7-49aa-a212-dac1a726424b" 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_5862227c-f01d-4456-ab35-728e28b14017" 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_dd378922-4dd7-49aa-a212-dac1a726424b" xlink:to="loc_us-gaap_IncurredClaimsPropertyCasualtyAndLiability_5862227c-f01d-4456-ab35-728e28b14017" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherCostAndExpenseOperating_fb5e5bc4-33a0-4b86-b257-e88c08331789" 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_dd378922-4dd7-49aa-a212-dac1a726424b" xlink:to="loc_us-gaap_OtherCostAndExpenseOperating_fb5e5bc4-33a0-4b86-b257-e88c08331789" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherNonoperatingExpense_173795e6-7465-467d-b27d-3ed7ae1e1c24" 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_dd378922-4dd7-49aa-a212-dac1a726424b" xlink:to="loc_us-gaap_OtherNonoperatingExpense_173795e6-7465-467d-b27d-3ed7ae1e1c24" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InterestExpense_97a3fbbb-ec4f-4770-a164-29e3972a292b" 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_dd378922-4dd7-49aa-a212-dac1a726424b" xlink:to="loc_us-gaap_InterestExpense_97a3fbbb-ec4f-4770-a164-29e3972a292b" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_nmih_GainLossonChangeinFairValueofWarrantLiability_701a2b38-9376-4c8d-afe4-21fb23895f63" xlink:href="nmih-20210930.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_dd378922-4dd7-49aa-a212-dac1a726424b" xlink:to="loc_nmih_GainLossonChangeinFairValueofWarrantLiability_701a2b38-9376-4c8d-afe4-21fb23895f63" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent_ae045043-5cc4-4ea1-bcad-c4f2d0f08b21" 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_d013bc22-36ad-4068-bb1a-2e6afc04037e" 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_ae045043-5cc4-4ea1-bcad-c4f2d0f08b21" xlink:to="loc_us-gaap_OtherComprehensiveIncomeUnrealizedHoldingGainLossOnSecuritiesArisingDuringPeriodNetOfTax_d013bc22-36ad-4068-bb1a-2e6afc04037e" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherComprehensiveIncomeLossReclassificationAdjustmentFromAOCIForSaleOfSecuritiesNetOfTax_ec5fa6b9-a33b-4dbb-9bc5-2b04a82fcd34" 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_ae045043-5cc4-4ea1-bcad-c4f2d0f08b21" xlink:to="loc_us-gaap_OtherComprehensiveIncomeLossReclassificationAdjustmentFromAOCIForSaleOfSecuritiesNetOfTax_ec5fa6b9-a33b-4dbb-9bc5-2b04a82fcd34" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.nationalmi.com/role/CONDENSEDCONSOLIDATEDSTATEMENTSOFCASHFLOWSUNAUDITED" xlink:type="simple" xlink:href="nmih-20210930.xsd#CONDENSEDCONSOLIDATEDSTATEMENTSOFCASHFLOWSUNAUDITED"/>
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/CONDENSEDCONSOLIDATEDSTATEMENTSOFCASHFLOWSUNAUDITED" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_961a4385-4a18-43b0-b404-d60b8c003e9a" 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_ef4ecda7-bc69-4ed5-980d-5056eb1bf158" 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_961a4385-4a18-43b0-b404-d60b8c003e9a" xlink:to="loc_us-gaap_NetIncomeLoss_ef4ecda7-bc69-4ed5-980d-5056eb1bf158" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleRealizedGainLoss_6f817458-b4d3-4bd2-bec9-d9291251dd4e" 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_961a4385-4a18-43b0-b404-d60b8c003e9a" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleRealizedGainLoss_6f817458-b4d3-4bd2-bec9-d9291251dd4e" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FairValueAdjustmentOfWarrants_fa3d2ff7-0545-4ff6-bb16-48d9550aa226" 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_961a4385-4a18-43b0-b404-d60b8c003e9a" xlink:to="loc_us-gaap_FairValueAdjustmentOfWarrants_fa3d2ff7-0545-4ff6-bb16-48d9550aa226" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DepreciationAmortizationAndAccretionNet_7997c696-6e06-4b08-82f6-8d7e87f04f9b" 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_961a4385-4a18-43b0-b404-d60b8c003e9a" xlink:to="loc_us-gaap_DepreciationAmortizationAndAccretionNet_7997c696-6e06-4b08-82f6-8d7e87f04f9b" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccretionAmortizationOfDiscountsAndPremiumsInvestments_2554dce9-856d-48fd-aa9b-0fdbe3ed2950" 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_961a4385-4a18-43b0-b404-d60b8c003e9a" xlink:to="loc_us-gaap_AccretionAmortizationOfDiscountsAndPremiumsInvestments_2554dce9-856d-48fd-aa9b-0fdbe3ed2950" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AmortizationOfFinancingCostsAndDiscounts_20b9dc3d-e0aa-4c51-84bc-a5685e0a3760" 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_961a4385-4a18-43b0-b404-d60b8c003e9a" xlink:to="loc_us-gaap_AmortizationOfFinancingCostsAndDiscounts_20b9dc3d-e0aa-4c51-84bc-a5685e0a3760" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredIncomeTaxesAndTaxCredits_36022aae-abd5-4268-abd6-0cbe8073429c" 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_961a4385-4a18-43b0-b404-d60b8c003e9a" xlink:to="loc_us-gaap_DeferredIncomeTaxesAndTaxCredits_36022aae-abd5-4268-abd6-0cbe8073429c" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensation_95cc1e37-697f-48f9-a9ae-ef35196db6fe" 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_961a4385-4a18-43b0-b404-d60b8c003e9a" xlink:to="loc_us-gaap_ShareBasedCompensation_95cc1e37-697f-48f9-a9ae-ef35196db6fe" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInPremiumsReceivable_5cbb4f0e-12d3-4b1e-ab66-c0bada4c7cbb" 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_961a4385-4a18-43b0-b404-d60b8c003e9a" xlink:to="loc_us-gaap_IncreaseDecreaseInPremiumsReceivable_5cbb4f0e-12d3-4b1e-ab66-c0bada4c7cbb" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInAccruedInvestmentIncomeReceivable_06a40883-2127-4dd2-a5ff-f9ef22e38b00" 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_961a4385-4a18-43b0-b404-d60b8c003e9a" xlink:to="loc_us-gaap_IncreaseDecreaseInAccruedInvestmentIncomeReceivable_06a40883-2127-4dd2-a5ff-f9ef22e38b00" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInPrepaidExpense_9945746b-1907-481a-8964-333626e21175" 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_961a4385-4a18-43b0-b404-d60b8c003e9a" xlink:to="loc_us-gaap_IncreaseDecreaseInPrepaidExpense_9945746b-1907-481a-8964-333626e21175" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInDeferredPolicyAcquisitionCosts_df4c62d2-8dff-4c54-84bb-b879123d2c95" 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_961a4385-4a18-43b0-b404-d60b8c003e9a" xlink:to="loc_us-gaap_IncreaseDecreaseInDeferredPolicyAcquisitionCosts_df4c62d2-8dff-4c54-84bb-b879123d2c95" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInPrepaidDeferredExpenseAndOtherAssets_790cfff2-2a91-4442-a62a-cc71db40f571" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncreaseDecreaseInPrepaidDeferredExpenseAndOtherAssets"/>
    <link:calculationArc order="13" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_961a4385-4a18-43b0-b404-d60b8c003e9a" xlink:to="loc_us-gaap_IncreaseDecreaseInPrepaidDeferredExpenseAndOtherAssets_790cfff2-2a91-4442-a62a-cc71db40f571" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInUnearnedPremiums_d5fea292-f850-4979-bac9-8d07b66b0975" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncreaseDecreaseInUnearnedPremiums"/>
    <link:calculationArc order="14" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_961a4385-4a18-43b0-b404-d60b8c003e9a" xlink:to="loc_us-gaap_IncreaseDecreaseInUnearnedPremiums_d5fea292-f850-4979-bac9-8d07b66b0975" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInLiabilityForClaimsAndClaimsAdjustmentExpenseReserve_4300ef7b-961a-440a-a151-2369a6bc93ba" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncreaseDecreaseInLiabilityForClaimsAndClaimsAdjustmentExpenseReserve"/>
    <link:calculationArc order="15" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_961a4385-4a18-43b0-b404-d60b8c003e9a" xlink:to="loc_us-gaap_IncreaseDecreaseInLiabilityForClaimsAndClaimsAdjustmentExpenseReserve_4300ef7b-961a-440a-a151-2369a6bc93ba" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_nmih_IncreaseDecreaseinReinsuranceAssetsandLiabilities_a454de74-dfdb-4239-95b4-3bdbfd38c66d" xlink:href="nmih-20210930.xsd#nmih_IncreaseDecreaseinReinsuranceAssetsandLiabilities"/>
    <link:calculationArc order="16" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_961a4385-4a18-43b0-b404-d60b8c003e9a" xlink:to="loc_nmih_IncreaseDecreaseinReinsuranceAssetsandLiabilities_a454de74-dfdb-4239-95b4-3bdbfd38c66d" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInAccountsPayableAndAccruedLiabilities_f6af4587-e39c-4dd6-9c95-831053d2bf53" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncreaseDecreaseInAccountsPayableAndAccruedLiabilities"/>
    <link:calculationArc order="17" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_961a4385-4a18-43b0-b404-d60b8c003e9a" xlink:to="loc_us-gaap_IncreaseDecreaseInAccountsPayableAndAccruedLiabilities_f6af4587-e39c-4dd6-9c95-831053d2bf53" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInReinsuranceRecoverable_31c61eb0-cc19-4a34-b208-193a9d8d704c" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_IncreaseDecreaseInReinsuranceRecoverable"/>
    <link:calculationArc order="18" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_961a4385-4a18-43b0-b404-d60b8c003e9a" xlink:to="loc_us-gaap_IncreaseDecreaseInReinsuranceRecoverable_31c61eb0-cc19-4a34-b208-193a9d8d704c" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsPeriodIncreaseDecreaseIncludingExchangeRateEffect_be640e78-9cb7-4664-88a4-3f1751e20b99" 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_17b3c0de-ae9d-481b-a1ec-1de8b97df719" 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_be640e78-9cb7-4664-88a4-3f1751e20b99" xlink:to="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_17b3c0de-ae9d-481b-a1ec-1de8b97df719" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetCashProvidedByUsedInInvestingActivities_5a2d3fdb-3449-444a-83f5-f38281f22a2a" 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_be640e78-9cb7-4664-88a4-3f1751e20b99" xlink:to="loc_us-gaap_NetCashProvidedByUsedInInvestingActivities_5a2d3fdb-3449-444a-83f5-f38281f22a2a" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_30493115-7072-4c70-97a2-9244ca8a2d50" 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_be640e78-9cb7-4664-88a4-3f1751e20b99" xlink:to="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_30493115-7072-4c70-97a2-9244ca8a2d50" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_89d1270e-e037-46dd-8b95-077d4c5f7278" 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_ProceedsFromIssuanceOfSharesUnderIncentiveAndShareBasedCompensationPlansIncludingStockOptions_33f121ea-10ab-4e72-9102-b70698f61633" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ProceedsFromIssuanceOfSharesUnderIncentiveAndShareBasedCompensationPlansIncludingStockOptions"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_89d1270e-e037-46dd-8b95-077d4c5f7278" xlink:to="loc_us-gaap_ProceedsFromIssuanceOfSharesUnderIncentiveAndShareBasedCompensationPlansIncludingStockOptions_33f121ea-10ab-4e72-9102-b70698f61633" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ProceedsFromIssuanceOfCommonStock_6e3b827b-44c2-48f1-bb39-d04aee20ff57" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ProceedsFromIssuanceOfCommonStock"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_89d1270e-e037-46dd-8b95-077d4c5f7278" xlink:to="loc_us-gaap_ProceedsFromIssuanceOfCommonStock_6e3b827b-44c2-48f1-bb39-d04aee20ff57" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ProceedsFromIssuanceOfSeniorLongTermDebt_516cea25-ac29-439f-b115-4082bdcb4a86" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ProceedsFromIssuanceOfSeniorLongTermDebt"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_89d1270e-e037-46dd-8b95-077d4c5f7278" xlink:to="loc_us-gaap_ProceedsFromIssuanceOfSeniorLongTermDebt_516cea25-ac29-439f-b115-4082bdcb4a86" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RepaymentsOfSecuredDebt_3e95576c-4a61-4317-90f5-76fb525aa5a2" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_RepaymentsOfSecuredDebt"/>
    <link:calculationArc order="4" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_89d1270e-e037-46dd-8b95-077d4c5f7278" xlink:to="loc_us-gaap_RepaymentsOfSecuredDebt_3e95576c-4a61-4317-90f5-76fb525aa5a2" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PaymentsRelatedToTaxWithholdingForShareBasedCompensation_d5b37426-5a8e-4050-9632-26c6282e33ea" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_PaymentsRelatedToTaxWithholdingForShareBasedCompensation"/>
    <link:calculationArc order="5" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_89d1270e-e037-46dd-8b95-077d4c5f7278" xlink:to="loc_us-gaap_PaymentsRelatedToTaxWithholdingForShareBasedCompensation_d5b37426-5a8e-4050-9632-26c6282e33ea" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ProceedsFromWarrantExercises_64205491-3dd7-4b90-9fe6-de5a8ea462b6" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_ProceedsFromWarrantExercises"/>
    <link:calculationArc order="6" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_89d1270e-e037-46dd-8b95-077d4c5f7278" xlink:to="loc_us-gaap_ProceedsFromWarrantExercises_64205491-3dd7-4b90-9fe6-de5a8ea462b6" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PaymentsOfDebtIssuanceCosts_c155def2-3700-459b-bc88-2c8f0d2f9167" 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_89d1270e-e037-46dd-8b95-077d4c5f7278" xlink:to="loc_us-gaap_PaymentsOfDebtIssuanceCosts_c155def2-3700-459b-bc88-2c8f0d2f9167" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetCashProvidedByUsedInInvestingActivities_fc672452-94af-4bee-a9bb-706186cd41d8" 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_85f2f1d1-8c1c-4cda-84ae-3d78763972d5" 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_fc672452-94af-4bee-a9bb-706186cd41d8" xlink:to="loc_us-gaap_PaymentsToAcquireShortTermInvestments_85f2f1d1-8c1c-4cda-84ae-3d78763972d5" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PaymentsToAcquireAvailableForSaleSecuritiesDebt_011fdfa5-8297-477d-9d10-f4953d165045" 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_fc672452-94af-4bee-a9bb-706186cd41d8" xlink:to="loc_us-gaap_PaymentsToAcquireAvailableForSaleSecuritiesDebt_011fdfa5-8297-477d-9d10-f4953d165045" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ProceedsFromSaleOfShortTermInvestments_0913ad6c-0a26-4428-987b-38e1ec5378c6" 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_fc672452-94af-4bee-a9bb-706186cd41d8" xlink:to="loc_us-gaap_ProceedsFromSaleOfShortTermInvestments_0913ad6c-0a26-4428-987b-38e1ec5378c6" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ProceedsFromSaleAndMaturityOfAvailableForSaleSecurities_6c61ec92-7ccc-4d7e-b7ee-6523e5afbaa7" 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_fc672452-94af-4bee-a9bb-706186cd41d8" xlink:to="loc_us-gaap_ProceedsFromSaleAndMaturityOfAvailableForSaleSecurities_6c61ec92-7ccc-4d7e-b7ee-6523e5afbaa7" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PaymentsToAcquirePropertyPlantAndEquipment_ab2564e3-f5d6-462f-8f02-53ffc3d89317" 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_fc672452-94af-4bee-a9bb-706186cd41d8" xlink:to="loc_us-gaap_PaymentsToAcquirePropertyPlantAndEquipment_ab2564e3-f5d6-462f-8f02-53ffc3d89317" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.nationalmi.com/role/InvestmentsFairValuesandGrossUnrealizedGainsandLossesDetails" xlink:type="simple" xlink:href="nmih-20210930.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_e8bd7cc5-4c19-4581-93e2-defc942a5889" 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_AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedGainBeforeTax_8a593edb-7370-499c-a0c4-85605d46d924" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedGainBeforeTax"/>
    <link:calculationArc order="1" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AvailableForSaleDebtSecuritiesAmortizedCostBasis_e8bd7cc5-4c19-4581-93e2-defc942a5889" xlink:to="loc_us-gaap_AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedGainBeforeTax_8a593edb-7370-499c-a0c4-85605d46d924" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedLossBeforeTax_a21bd09b-5c6b-4daa-9c2f-7bedbedf826b" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedLossBeforeTax"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AvailableForSaleDebtSecuritiesAmortizedCostBasis_e8bd7cc5-4c19-4581-93e2-defc942a5889" xlink:to="loc_us-gaap_AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedLossBeforeTax_a21bd09b-5c6b-4daa-9c2f-7bedbedf826b" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtSecurities_9c123126-d066-4697-88ee-e95eba2ee969" 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_e8bd7cc5-4c19-4581-93e2-defc942a5889" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtSecurities_9c123126-d066-4697-88ee-e95eba2ee969" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.nationalmi.com/role/InvestmentsScheduledMaturitiesDetails" xlink:type="simple" xlink:href="nmih-20210930.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_AvailableForSaleSecuritiesDebtSecurities_41ecac39-76df-4926-adbe-1470f4c2857b" 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_AvailableForSaleSecuritiesDebtMaturitiesRollingYearSixThroughTenFairValue_2f8e69ac-6083-4a70-bbab-24e81e0a71c9" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AvailableForSaleSecuritiesDebtMaturitiesRollingYearSixThroughTenFairValue"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AvailableForSaleSecuritiesDebtSecurities_41ecac39-76df-4926-adbe-1470f4c2857b" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesRollingYearSixThroughTenFairValue_2f8e69ac-6083-4a70-bbab-24e81e0a71c9" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesNextRollingTwelveMonthsFairValue_6d9fa34a-b974-462f-9ca6-2f3f807600ed" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AvailableForSaleSecuritiesDebtMaturitiesNextRollingTwelveMonthsFairValue"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AvailableForSaleSecuritiesDebtSecurities_41ecac39-76df-4926-adbe-1470f4c2857b" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesNextRollingTwelveMonthsFairValue_6d9fa34a-b974-462f-9ca6-2f3f807600ed" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesRollingYearTwoThroughFiveFairValue_dcb0fc54-2863-458e-b7b8-dba16c4de0af" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AvailableForSaleSecuritiesDebtMaturitiesRollingYearTwoThroughFiveFairValue"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AvailableForSaleSecuritiesDebtSecurities_41ecac39-76df-4926-adbe-1470f4c2857b" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesRollingYearTwoThroughFiveFairValue_dcb0fc54-2863-458e-b7b8-dba16c4de0af" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesRollingAfterYearTenFairValue_c29c5181-def2-4548-bb3b-72b55b2974de" 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_41ecac39-76df-4926-adbe-1470f4c2857b" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesRollingAfterYearTenFairValue_c29c5181-def2-4548-bb3b-72b55b2974de" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesWithoutSingleMaturityDateFairValue_8a3be6ec-331a-48bd-89d6-b326705dd51d" 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_41ecac39-76df-4926-adbe-1470f4c2857b" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesWithoutSingleMaturityDateFairValue_8a3be6ec-331a-48bd-89d6-b326705dd51d" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleDebtSecuritiesAmortizedCostBasis_b14a8222-6e28-4c2a-95e2-7f58f9e4e194" 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_4dc602c9-3d76-4824-ae22-42daa4405cf2" 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_b14a8222-6e28-4c2a-95e2-7f58f9e4e194" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesNextRollingTwelveMonthsAmortizedCostBasis_4dc602c9-3d76-4824-ae22-42daa4405cf2" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesRollingYearSixThroughTenAmortizedCostBasis_95f31a4a-f4a2-4907-9e02-c5dcaf37108a" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AvailableForSaleSecuritiesDebtMaturitiesRollingYearSixThroughTenAmortizedCostBasis"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AvailableForSaleDebtSecuritiesAmortizedCostBasis_b14a8222-6e28-4c2a-95e2-7f58f9e4e194" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesRollingYearSixThroughTenAmortizedCostBasis_95f31a4a-f4a2-4907-9e02-c5dcaf37108a" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesWithoutSingleMaturityDateAmortizedCost_f929b3f5-b060-4d1e-8d0f-0f604f199ff9" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AvailableForSaleSecuritiesDebtMaturitiesWithoutSingleMaturityDateAmortizedCost"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AvailableForSaleDebtSecuritiesAmortizedCostBasis_b14a8222-6e28-4c2a-95e2-7f58f9e4e194" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesWithoutSingleMaturityDateAmortizedCost_f929b3f5-b060-4d1e-8d0f-0f604f199ff9" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesRollingYearTwoThroughFiveAmortizedCostBasis_91357ab1-e94d-40e8-a47d-653e8ad015d6" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AvailableForSaleSecuritiesDebtMaturitiesRollingYearTwoThroughFiveAmortizedCostBasis"/>
    <link:calculationArc order="4" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AvailableForSaleDebtSecuritiesAmortizedCostBasis_b14a8222-6e28-4c2a-95e2-7f58f9e4e194" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesRollingYearTwoThroughFiveAmortizedCostBasis_91357ab1-e94d-40e8-a47d-653e8ad015d6" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesRollingAfterYearTenAmortizedCostBasis_2de6a26e-ece2-40b5-ac29-e7dd7210f37b" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_AvailableForSaleSecuritiesDebtMaturitiesRollingAfterYearTenAmortizedCostBasis"/>
    <link:calculationArc order="5" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AvailableForSaleDebtSecuritiesAmortizedCostBasis_b14a8222-6e28-4c2a-95e2-7f58f9e4e194" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesRollingAfterYearTenAmortizedCostBasis_2de6a26e-ece2-40b5-ac29-e7dd7210f37b" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.nationalmi.com/role/InvestmentsAgingofUnrealizedLossesDetails" xlink:type="simple" xlink:href="nmih-20210930.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_72b08da5-aaec-4ea1-973b-b344c8e2e11f" 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_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionLessThan12MonthsNumberOfPositions_833055b1-1e78-48a7-baa6-5473bd54c831" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionLessThan12MonthsNumberOfPositions"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPositionNumberOfPositions_72b08da5-aaec-4ea1-973b-b344c8e2e11f" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionLessThan12MonthsNumberOfPositions_833055b1-1e78-48a7-baa6-5473bd54c831" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLongerNumberOfPositions_6f3e6abb-79e2-4ed4-8cba-669da6560dbf" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLongerNumberOfPositions"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPositionNumberOfPositions_72b08da5-aaec-4ea1-973b-b344c8e2e11f" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLongerNumberOfPositions_6f3e6abb-79e2-4ed4-8cba-669da6560dbf" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPositionAccumulatedLoss_b3f80e57-5553-4522-bd4e-aa0377f24d4a" 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_1944e407-235c-4420-bd48-f284031aa137" 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_b3f80e57-5553-4522-bd4e-aa0377f24d4a" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionLessThan12MonthsAccumulatedLoss_1944e407-235c-4420-bd48-f284031aa137" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLongerAccumulatedLoss_51db78db-b083-4e98-8e39-c4e482c1f56b" 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_b3f80e57-5553-4522-bd4e-aa0377f24d4a" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLongerAccumulatedLoss_51db78db-b083-4e98-8e39-c4e482c1f56b" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPosition_439f250d-0a8c-4716-95f9-72b379d471c7" 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_d6ee76ed-53db-4567-9a23-8bbefea054e9" 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_439f250d-0a8c-4716-95f9-72b379d471c7" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionLessThan12Months_d6ee76ed-53db-4567-9a23-8bbefea054e9" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLonger_e9b3a3b3-0f05-46fa-8b4f-b49b8b69f733" 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_439f250d-0a8c-4716-95f9-72b379d471c7" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLonger_e9b3a3b3-0f05-46fa-8b4f-b49b8b69f733" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.nationalmi.com/role/InvestmentsNetInvestmentIncomeDetails" xlink:type="simple" xlink:href="nmih-20210930.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_1bdab500-0a49-43af-80a3-1f3d811385df" 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_InvestmentIncomeInterestAndDividend_f05d781d-e76c-40ff-8f9a-296489f67fb6" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_InvestmentIncomeInterestAndDividend"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_InvestmentIncomeNet_1bdab500-0a49-43af-80a3-1f3d811385df" xlink:to="loc_us-gaap_InvestmentIncomeInterestAndDividend_f05d781d-e76c-40ff-8f9a-296489f67fb6" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InvestmentIncomeInvestmentExpense_3d4d7fbc-07e0-48f0-ae03-3ec7d591c67d" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_InvestmentIncomeInvestmentExpense"/>
    <link:calculationArc order="2" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_InvestmentIncomeNet_1bdab500-0a49-43af-80a3-1f3d811385df" xlink:to="loc_us-gaap_InvestmentIncomeInvestmentExpense_3d4d7fbc-07e0-48f0-ae03-3ec7d591c67d" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.nationalmi.com/role/InvestmentsNetRealizedInvestmentGainsLossesDetails" xlink:type="simple" xlink:href="nmih-20210930.xsd#InvestmentsNetRealizedInvestmentGainsLossesDetails"/>
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/InvestmentsNetRealizedInvestmentGainsLossesDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleRealizedGainLoss_aebdf4bb-7c55-438b-ac89-0d95cfe02a56" 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_7a35d6a9-d962-4b08-88a5-e61ff552518e" 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_aebdf4bb-7c55-438b-ac89-0d95cfe02a56" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleRealizedGain_7a35d6a9-d962-4b08-88a5-e61ff552518e" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleRealizedLoss_36ddbb19-b6d9-4a6a-997e-e0012eab1c91" 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_aebdf4bb-7c55-438b-ac89-0d95cfe02a56" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleRealizedLoss_36ddbb19-b6d9-4a6a-997e-e0012eab1c91" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.nationalmi.com/role/FairValueofFinancialInstrumentsAssetsandLiabilitiesatFairValueDetails" xlink:type="simple" xlink:href="nmih-20210930.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_AssetsFairValueDisclosure_a2d750ac-654d-409e-9e51-977bf2c23b0a" 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_c80af770-8fef-4d59-b428-ee8383543d2b" 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_a2d750ac-654d-409e-9e51-977bf2c23b0a" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtSecurities_c80af770-8fef-4d59-b428-ee8383543d2b" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CashAndCashEquivalentsFairValueDisclosure_34ffc366-c2d3-4070-98fa-fbaa9df507c1" 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_a2d750ac-654d-409e-9e51-977bf2c23b0a" xlink:to="loc_us-gaap_CashAndCashEquivalentsFairValueDisclosure_34ffc366-c2d3-4070-98fa-fbaa9df507c1" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LiabilitiesFairValueDisclosure_25621746-3b85-4bd8-90ba-85be893b2a12" 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_a3ccb513-b78f-44a8-aedf-c8d83bebcfda" xlink:href="nmih-20210930.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_25621746-3b85-4bd8-90ba-85be893b2a12" xlink:to="loc_nmih_WarrantLiability_a3ccb513-b78f-44a8-aedf-c8d83bebcfda" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.nationalmi.com/role/ReinsuranceEffectofReinsuranceAgreementsonPremiumsWrittenandEarnedDetails" xlink:type="simple" xlink:href="nmih-20210930.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_PremiumsWrittenNet_37ab05bd-3b1d-4edb-b4c7-ece5f4b29244" 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_5e6bf1ce-9c1e-42a1-89d8-3c108aa31001" 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_37ab05bd-3b1d-4edb-b4c7-ece5f4b29244" xlink:to="loc_us-gaap_DirectPremiumsWritten_5e6bf1ce-9c1e-42a1-89d8-3c108aa31001" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CededPremiumsWritten_0daec486-a285-4ef1-ae15-6e73f2009488" 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_37ab05bd-3b1d-4edb-b4c7-ece5f4b29244" xlink:to="loc_us-gaap_CededPremiumsWritten_0daec486-a285-4ef1-ae15-6e73f2009488" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PremiumsEarnedNet_ffa4db0b-8845-44a9-bbe8-92db11aafd11" 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_478d49fd-4534-479e-b2df-b520d11ecf30" 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_ffa4db0b-8845-44a9-bbe8-92db11aafd11" xlink:to="loc_us-gaap_DirectPremiumsEarned_478d49fd-4534-479e-b2df-b520d11ecf30" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CededPremiumsEarned_37fa8bb1-6ba7-4584-afe8-dd58f8b9b563" 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_ffa4db0b-8845-44a9-bbe8-92db11aafd11" xlink:to="loc_us-gaap_CededPremiumsEarned_37fa8bb1-6ba7-4584-afe8-dd58f8b9b563" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.nationalmi.com/role/ReservesforInsuranceClaimsandClaimExpensesReconciliationofReserveBalancesforInsuranceClaimsandClaimExpenseDetails" xlink:type="simple" xlink:href="nmih-20210930.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_LiabilityForUnpaidClaimsAndClaimsAdjustmentExpenseIncurredClaims1_9f314fb0-2960-45ea-9c58-d1105d69513c" 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_8bdea443-1704-4a2c-8fd1-ed7019404c79" 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_9f314fb0-2960-45ea-9c58-d1105d69513c" xlink:to="loc_us-gaap_SupplementalInformationForPropertyCasualtyInsuranceUnderwritersCurrentYearClaimsAndClaimsAdjustmentExpense_8bdea443-1704-4a2c-8fd1-ed7019404c79" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SupplementalInformationForPropertyCasualtyInsuranceUnderwritersPriorYearClaimsAndClaimsAdjustmentExpense_af276121-cdc5-43eb-8361-bf6ad9eee031" 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_9f314fb0-2960-45ea-9c58-d1105d69513c" xlink:to="loc_us-gaap_SupplementalInformationForPropertyCasualtyInsuranceUnderwritersPriorYearClaimsAndClaimsAdjustmentExpense_af276121-cdc5-43eb-8361-bf6ad9eee031" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LiabilityForUnpaidClaimsAndClaimsAdjustmentExpenseNet_3f416d17-0177-48f0-8526-2991b2a7537a" 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_69bf0809-b303-4112-9932-ad70efbb8ffd" 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_3f416d17-0177-48f0-8526-2991b2a7537a" xlink:to="loc_us-gaap_LiabilityForClaimsAndClaimsAdjustmentExpense_69bf0809-b303-4112-9932-ad70efbb8ffd" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ReinsuranceRecoverablesOnPaidAndUnpaidLosses_fff34716-b5f0-48c1-9470-8b1345ca0128" 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_3f416d17-0177-48f0-8526-2991b2a7537a" xlink:to="loc_us-gaap_ReinsuranceRecoverablesOnPaidAndUnpaidLosses_fff34716-b5f0-48c1-9470-8b1345ca0128" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PaymentsForLossesAndLossAdjustmentExpense_047c2671-1fb8-46f7-b733-758639851b2c" 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_6eb86ea0-51cd-41dd-9df3-5a8997dc9cfb" 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_047c2671-1fb8-46f7-b733-758639851b2c" xlink:to="loc_us-gaap_LiabilityForUnpaidClaimsAndClaimsAdjustmentExpenseClaimsPaidCurrentYear1_6eb86ea0-51cd-41dd-9df3-5a8997dc9cfb" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LiabilityForUnpaidClaimsAndClaimsAdjustmentExpenseClaimsPaidPriorYears1_c6c1a67d-e5e0-4fcf-b292-50ec86320226" 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_047c2671-1fb8-46f7-b733-758639851b2c" xlink:to="loc_us-gaap_LiabilityForUnpaidClaimsAndClaimsAdjustmentExpenseClaimsPaidPriorYears1_c6c1a67d-e5e0-4fcf-b292-50ec86320226" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.nationalmi.com/role/EarningsperShareEPSDetails" xlink:type="simple" xlink:href="nmih-20210930.xsd#EarningsperShareEPSDetails"/>
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/EarningsperShareEPSDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetIncomeLossAttributableToParentDiluted_1ad9cbfc-4198-4fe8-9c91-89414e14e6f4" 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_066a0105-49c1-405c-819c-c936fa2fb5fb" 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_1ad9cbfc-4198-4fe8-9c91-89414e14e6f4" xlink:to="loc_us-gaap_NetIncomeLoss_066a0105-49c1-405c-819c-c936fa2fb5fb" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_nmih_GainFromChangeInFairValueOfWarrantLiability_fe430f12-1412-4742-9177-ca407df4b0d3" xlink:href="nmih-20210930.xsd#nmih_GainFromChangeInFairValueOfWarrantLiability"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetIncomeLossAttributableToParentDiluted_1ad9cbfc-4198-4fe8-9c91-89414e14e6f4" xlink:to="loc_nmih_GainFromChangeInFairValueOfWarrantLiability_fe430f12-1412-4742-9177-ca407df4b0d3" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_WeightedAverageNumberOfDilutedSharesOutstanding_59a7adf3-00cf-49f2-a4ec-835f59ae879d" 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_69e37fa9-eed1-4615-ace5-da46669eab4c" 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_59a7adf3-00cf-49f2-a4ec-835f59ae879d" xlink:to="loc_us-gaap_WeightedAverageNumberOfSharesOutstandingBasic_69e37fa9-eed1-4615-ace5-da46669eab4c" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_WeightedAverageNumberDilutedSharesOutstandingAdjustment_ced9df63-c860-44e1-8c09-1adb2592d5d2" 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_59a7adf3-00cf-49f2-a4ec-835f59ae879d" xlink:to="loc_us-gaap_WeightedAverageNumberDilutedSharesOutstandingAdjustment_ced9df63-c860-44e1-8c09-1adb2592d5d2" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.nationalmi.com/role/RegulatoryInformationScheduleofCombinedStatutoryNetLossStatutorySurplusContingencyReserveandRTCRatiosDetails" xlink:type="simple" xlink:href="nmih-20210930.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_caf93df7-ade9-4313-b5e1-6feed5c80718" xlink:href="nmih-20210930.xsd#nmih_StatutoryAccountingPracticesStatutoryCapitalAndSurplusIncludingContingencyReserve"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatutoryAccountingPracticesStatutoryCapitalAndSurplusBalance_d98d00a4-314a-4051-b975-15ef7698441e" xlink:href="https://xbrl.fasb.org/us-gaap/2021/elts/us-gaap-2021-01-31.xsd#us-gaap_StatutoryAccountingPracticesStatutoryCapitalAndSurplusBalance"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_nmih_StatutoryAccountingPracticesStatutoryCapitalAndSurplusIncludingContingencyReserve_caf93df7-ade9-4313-b5e1-6feed5c80718" xlink:to="loc_us-gaap_StatutoryAccountingPracticesStatutoryCapitalAndSurplusBalance_d98d00a4-314a-4051-b975-15ef7698441e" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_nmih_StatutoryAccountingPracticesContingencyReserve_b4dd11e9-00aa-4f6f-bc0f-cfd0fd59c690" xlink:href="nmih-20210930.xsd#nmih_StatutoryAccountingPracticesContingencyReserve"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_nmih_StatutoryAccountingPracticesStatutoryCapitalAndSurplusIncludingContingencyReserve_caf93df7-ade9-4313-b5e1-6feed5c80718" xlink:to="loc_nmih_StatutoryAccountingPracticesContingencyReserve_b4dd11e9-00aa-4f6f-bc0f-cfd0fd59c690" xlink:type="arc"/>
  </link:calculationLink>
</link:linkbase>
