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

<!--XBRL Document Created with Wdesk from Workiva-->
<!--Copyright 2023 Workiva-->
<!--r:0e828ab6-f094-4f2c-aef2-87a05ea95218,g:77a5ff77-9fd7-4af4-a2be-79d4a0ad228e-->
<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-20221231.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_511a64b6-763c-4e68-ac9c-aaedc1fe1165" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_Assets"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtSecurities_059fd1c2-279b-4214-bd0f-56fb4ece605f" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_511a64b6-763c-4e68-ac9c-aaedc1fe1165" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtSecurities_059fd1c2-279b-4214-bd0f-56fb4ece605f" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents_60032f5d-bb14-4217-bb82-666849b02f04" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_511a64b6-763c-4e68-ac9c-aaedc1fe1165" xlink:to="loc_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents_60032f5d-bb14-4217-bb82-666849b02f04" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PremiumsReceivableAtCarryingValue_db119f69-c317-44a7-80a5-63e87b649f1a" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_511a64b6-763c-4e68-ac9c-aaedc1fe1165" xlink:to="loc_us-gaap_PremiumsReceivableAtCarryingValue_db119f69-c317-44a7-80a5-63e87b649f1a" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccruedInvestmentIncomeReceivable_0e2855d2-aea4-4f2d-9921-047000c6dd58" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_511a64b6-763c-4e68-ac9c-aaedc1fe1165" xlink:to="loc_us-gaap_AccruedInvestmentIncomeReceivable_0e2855d2-aea4-4f2d-9921-047000c6dd58" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredPolicyAcquisitionCosts_c831c636-ddaa-40ee-9bc6-c778d3fdd302" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DeferredPolicyAcquisitionCosts"/>
    <link:calculationArc order="5" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_511a64b6-763c-4e68-ac9c-aaedc1fe1165" xlink:to="loc_us-gaap_DeferredPolicyAcquisitionCosts_c831c636-ddaa-40ee-9bc6-c778d3fdd302" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PropertyPlantAndEquipmentNet_9e4734fe-ff1e-4687-8d22-38cc419112cd" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_PropertyPlantAndEquipmentNet"/>
    <link:calculationArc order="6" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_511a64b6-763c-4e68-ac9c-aaedc1fe1165" xlink:to="loc_us-gaap_PropertyPlantAndEquipmentNet_9e4734fe-ff1e-4687-8d22-38cc419112cd" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IntangibleAssetsNetIncludingGoodwill_43af7349-7fe3-4be6-8665-453c637cee44" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_IntangibleAssetsNetIncludingGoodwill"/>
    <link:calculationArc order="7" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_511a64b6-763c-4e68-ac9c-aaedc1fe1165" xlink:to="loc_us-gaap_IntangibleAssetsNetIncludingGoodwill_43af7349-7fe3-4be6-8665-453c637cee44" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ReinsuranceRecoverablesGross_8c4269ee-6412-42c8-a7e5-de79e4865ef1" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ReinsuranceRecoverablesGross"/>
    <link:calculationArc order="8" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_511a64b6-763c-4e68-ac9c-aaedc1fe1165" xlink:to="loc_us-gaap_ReinsuranceRecoverablesGross_8c4269ee-6412-42c8-a7e5-de79e4865ef1" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_nmih_PrepaidFederalIncomeTaxes_9b590424-4231-4f59-a1fb-3e32c0bb82d5" xlink:href="nmih-20221231.xsd#nmih_PrepaidFederalIncomeTaxes"/>
    <link:calculationArc order="9" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_511a64b6-763c-4e68-ac9c-aaedc1fe1165" xlink:to="loc_nmih_PrepaidFederalIncomeTaxes_9b590424-4231-4f59-a1fb-3e32c0bb82d5" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherAssets_66e5d7ed-e2b3-4c80-9dfd-06e116fc3295" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_OtherAssets"/>
    <link:calculationArc order="10" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_511a64b6-763c-4e68-ac9c-aaedc1fe1165" xlink:to="loc_us-gaap_OtherAssets_66e5d7ed-e2b3-4c80-9dfd-06e116fc3295" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockholdersEquity_3a940054-1a46-4914-a711-c9a905addbaa" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_StockholdersEquity"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonStockValueOutstanding_3d2b5ea5-0bec-4376-a15b-2b7b8ad0f8c2" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_3a940054-1a46-4914-a711-c9a905addbaa" xlink:to="loc_us-gaap_CommonStockValueOutstanding_3d2b5ea5-0bec-4376-a15b-2b7b8ad0f8c2" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AdditionalPaidInCapital_11f59213-a4b6-4468-a5e9-552613f77a21" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_3a940054-1a46-4914-a711-c9a905addbaa" xlink:to="loc_us-gaap_AdditionalPaidInCapital_11f59213-a4b6-4468-a5e9-552613f77a21" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccumulatedOtherComprehensiveIncomeLossNetOfTax_9f1e3cef-7176-4ae3-8f4f-a0af7e3d663d" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_3a940054-1a46-4914-a711-c9a905addbaa" xlink:to="loc_us-gaap_AccumulatedOtherComprehensiveIncomeLossNetOfTax_9f1e3cef-7176-4ae3-8f4f-a0af7e3d663d" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RetainedEarningsAccumulatedDeficit_2a312053-0e08-40fb-b15f-e06c137a32a1" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_3a940054-1a46-4914-a711-c9a905addbaa" xlink:to="loc_us-gaap_RetainedEarningsAccumulatedDeficit_2a312053-0e08-40fb-b15f-e06c137a32a1" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TreasuryStockCommonValue_9761d08b-7438-4cca-a2b4-a6926e09ce39" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_TreasuryStockCommonValue"/>
    <link:calculationArc order="5" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_StockholdersEquity_3a940054-1a46-4914-a711-c9a905addbaa" xlink:to="loc_us-gaap_TreasuryStockCommonValue_9761d08b-7438-4cca-a2b4-a6926e09ce39" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Liabilities_1851ab9a-6c8b-4bbc-9f46-da6bd88464bc" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_Liabilities"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LongTermDebt_6e0a98b4-5756-4e24-b3e5-06018beeb93d" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_1851ab9a-6c8b-4bbc-9f46-da6bd88464bc" xlink:to="loc_us-gaap_LongTermDebt_6e0a98b4-5756-4e24-b3e5-06018beeb93d" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_UnearnedPremiums_94c3b8cf-6a03-4dd8-85e7-4a10da6307f5" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_1851ab9a-6c8b-4bbc-9f46-da6bd88464bc" xlink:to="loc_us-gaap_UnearnedPremiums_94c3b8cf-6a03-4dd8-85e7-4a10da6307f5" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccountsPayableAndAccruedLiabilitiesCurrentAndNoncurrent_f3c5e73e-a5a7-4ff6-9cf4-076d593ef7a4" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_1851ab9a-6c8b-4bbc-9f46-da6bd88464bc" xlink:to="loc_us-gaap_AccountsPayableAndAccruedLiabilitiesCurrentAndNoncurrent_f3c5e73e-a5a7-4ff6-9cf4-076d593ef7a4" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LiabilityForClaimsAndClaimsAdjustmentExpense_c3b5914c-722e-48b6-9597-26d9059e18b1" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_1851ab9a-6c8b-4bbc-9f46-da6bd88464bc" xlink:to="loc_us-gaap_LiabilityForClaimsAndClaimsAdjustmentExpense_c3b5914c-722e-48b6-9597-26d9059e18b1" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FundsHeldUnderReinsuranceAgreementsLiability_fe0a642f-6bdf-4c99-8bc0-1c0ee783bb02" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_1851ab9a-6c8b-4bbc-9f46-da6bd88464bc" xlink:to="loc_us-gaap_FundsHeldUnderReinsuranceAgreementsLiability_fe0a642f-6bdf-4c99-8bc0-1c0ee783bb02" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_WarrantsAndRightsOutstanding_4e94a368-1529-4f44-a8ef-00cf411d8379" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_1851ab9a-6c8b-4bbc-9f46-da6bd88464bc" xlink:to="loc_us-gaap_WarrantsAndRightsOutstanding_4e94a368-1529-4f44-a8ef-00cf411d8379" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredIncomeTaxLiabilitiesNet_4682baa1-5ddc-4bf4-8a76-a56196115b1e" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_1851ab9a-6c8b-4bbc-9f46-da6bd88464bc" xlink:to="loc_us-gaap_DeferredIncomeTaxLiabilitiesNet_4682baa1-5ddc-4bf4-8a76-a56196115b1e" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherLiabilities_78fe0410-377f-4f4b-97b7-09ba8def8f3e" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_1851ab9a-6c8b-4bbc-9f46-da6bd88464bc" xlink:to="loc_us-gaap_OtherLiabilities_78fe0410-377f-4f4b-97b7-09ba8def8f3e" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LiabilitiesAndStockholdersEquity_5bd9b1b5-a83a-47ae-83e5-d2269252cc6c" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_LiabilitiesAndStockholdersEquity"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Liabilities_0fb4b5c4-bbb3-4f3b-b06f-6bbc6e868641" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_5bd9b1b5-a83a-47ae-83e5-d2269252cc6c" xlink:to="loc_us-gaap_Liabilities_0fb4b5c4-bbb3-4f3b-b06f-6bbc6e868641" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommitmentsAndContingencies_4ee503dd-8c4d-4592-b4f3-02245ba01100" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_5bd9b1b5-a83a-47ae-83e5-d2269252cc6c" xlink:to="loc_us-gaap_CommitmentsAndContingencies_4ee503dd-8c4d-4592-b4f3-02245ba01100" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockholdersEquity_34d82e6c-8e64-4356-b5d4-f6871c582c0b" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_5bd9b1b5-a83a-47ae-83e5-d2269252cc6c" xlink:to="loc_us-gaap_StockholdersEquity_34d82e6c-8e64-4356-b5d4-f6871c582c0b" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.nationalmi.com/role/CONSOLIDATEDSTATEMENTSOFOPERATIONSANDCOMPREHENSIVEINCOME" xlink:type="simple" xlink:href="nmih-20221231.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_NetIncomeLoss_0a465d38-8cf8-47a0-aff0-b5f26b0b61d0" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_NetIncomeLoss"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest_3ec617b6-d855-49db-a89b-5896afc30156" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_0a465d38-8cf8-47a0-aff0-b5f26b0b61d0" xlink:to="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest_3ec617b6-d855-49db-a89b-5896afc30156" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeTaxExpenseBenefit_42234086-3881-40f8-a69a-d31dc961840c" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_0a465d38-8cf8-47a0-aff0-b5f26b0b61d0" xlink:to="loc_us-gaap_IncomeTaxExpenseBenefit_42234086-3881-40f8-a69a-d31dc961840c" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ComprehensiveIncomeNetOfTax_c8776a6f-169c-4f75-a1ce-d16ee6336ac2" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ComprehensiveIncomeNetOfTax"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetIncomeLoss_3c37105a-f9b9-4b9b-80a6-c9fd1b5518e4" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_c8776a6f-169c-4f75-a1ce-d16ee6336ac2" xlink:to="loc_us-gaap_NetIncomeLoss_3c37105a-f9b9-4b9b-80a6-c9fd1b5518e4" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent_016e9e54-bd7f-4c56-8e53-f06f0673388f" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_c8776a6f-169c-4f75-a1ce-d16ee6336ac2" xlink:to="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent_016e9e54-bd7f-4c56-8e53-f06f0673388f" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CostsAndExpenses_2d93214b-08c3-4376-b99a-363469681392" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_CostsAndExpenses"/>
    <link:loc xlink:type="locator" xlink:label="loc_nmih_PolicyholderBenefitsAndClaimsNetPropertyCasualtyAndLiability_930fa5c7-107c-4a51-891f-023391b7af97" xlink:href="nmih-20221231.xsd#nmih_PolicyholderBenefitsAndClaimsNetPropertyCasualtyAndLiability"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_CostsAndExpenses_2d93214b-08c3-4376-b99a-363469681392" xlink:to="loc_nmih_PolicyholderBenefitsAndClaimsNetPropertyCasualtyAndLiability_930fa5c7-107c-4a51-891f-023391b7af97" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherCostAndExpenseOperating_7b792210-cae8-4ede-8df6-79a16b193055" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_2d93214b-08c3-4376-b99a-363469681392" xlink:to="loc_us-gaap_OtherCostAndExpenseOperating_7b792210-cae8-4ede-8df6-79a16b193055" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherNonoperatingExpense_dac4f25f-358c-4c4a-a588-6816bd88cc2d" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_2d93214b-08c3-4376-b99a-363469681392" xlink:to="loc_us-gaap_OtherNonoperatingExpense_dac4f25f-358c-4c4a-a588-6816bd88cc2d" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InterestExpense_4559e49d-0487-44f7-a6b4-9d9357062a93" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_2d93214b-08c3-4376-b99a-363469681392" xlink:to="loc_us-gaap_InterestExpense_4559e49d-0487-44f7-a6b4-9d9357062a93" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_nmih_GainLossonChangeinFairValueofWarrantLiability_c19d054b-7871-45ec-adaa-a67d69ecf2de" xlink:href="nmih-20221231.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_2d93214b-08c3-4376-b99a-363469681392" xlink:to="loc_nmih_GainLossonChangeinFairValueofWarrantLiability_c19d054b-7871-45ec-adaa-a67d69ecf2de" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Revenues_e040db43-3fb8-442a-b66c-f78e338aa491" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_Revenues"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PremiumsEarnedNet_b9896342-c048-4b7c-83f9-9af00c4590d8" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_e040db43-3fb8-442a-b66c-f78e338aa491" xlink:to="loc_us-gaap_PremiumsEarnedNet_b9896342-c048-4b7c-83f9-9af00c4590d8" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetInvestmentIncome_52400c02-c87d-4c8b-9ea5-d6b98a37c1a6" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_e040db43-3fb8-442a-b66c-f78e338aa491" xlink:to="loc_us-gaap_NetInvestmentIncome_52400c02-c87d-4c8b-9ea5-d6b98a37c1a6" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_GainLossOnInvestments_b3591a91-520a-4d71-b256-a8fd96c8bc99" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_e040db43-3fb8-442a-b66c-f78e338aa491" xlink:to="loc_us-gaap_GainLossOnInvestments_b3591a91-520a-4d71-b256-a8fd96c8bc99" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherIncome_ba6060ab-ab7b-41eb-8440-7eaddc51e38e" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_e040db43-3fb8-442a-b66c-f78e338aa491" xlink:to="loc_us-gaap_OtherIncome_ba6060ab-ab7b-41eb-8440-7eaddc51e38e" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.nationalmi.com/role/CONSOLIDATEDSTATEMENTSOFCASHFLOWS" xlink:type="simple" xlink:href="nmih-20221231.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_NetCashProvidedByUsedInInvestingActivities_d13bc8e4-0a39-4771-b752-0ed268ad847e" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_NetCashProvidedByUsedInInvestingActivities"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PaymentsToAcquireShortTermInvestments_42960ca3-26a3-4920-bd0a-6ebd175687bf" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_d13bc8e4-0a39-4771-b752-0ed268ad847e" xlink:to="loc_us-gaap_PaymentsToAcquireShortTermInvestments_42960ca3-26a3-4920-bd0a-6ebd175687bf" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PaymentsToAcquireAvailableForSaleSecuritiesDebt_54b9e0ea-7fae-4feb-94fd-d881c8c8f06e" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_d13bc8e4-0a39-4771-b752-0ed268ad847e" xlink:to="loc_us-gaap_PaymentsToAcquireAvailableForSaleSecuritiesDebt_54b9e0ea-7fae-4feb-94fd-d881c8c8f06e" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ProceedsFromSaleOfShortTermInvestments_e3a9444a-f288-418e-8707-f52782ea408a" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_d13bc8e4-0a39-4771-b752-0ed268ad847e" xlink:to="loc_us-gaap_ProceedsFromSaleOfShortTermInvestments_e3a9444a-f288-418e-8707-f52782ea408a" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ProceedsFromSaleAndMaturityOfAvailableForSaleSecurities_740433e7-2e15-4ee0-a332-eb5f620a2038" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_d13bc8e4-0a39-4771-b752-0ed268ad847e" xlink:to="loc_us-gaap_ProceedsFromSaleAndMaturityOfAvailableForSaleSecurities_740433e7-2e15-4ee0-a332-eb5f620a2038" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PaymentsToAcquirePropertyPlantAndEquipment_5af3edc5-7203-4cec-bddf-1286bf17f06b" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_d13bc8e4-0a39-4771-b752-0ed268ad847e" xlink:to="loc_us-gaap_PaymentsToAcquirePropertyPlantAndEquipment_5af3edc5-7203-4cec-bddf-1286bf17f06b" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PaymentsToAcquireInterestInSubsidiariesAndAffiliates_4be5e779-3027-425d-b38d-fe80ca1b63b0" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_d13bc8e4-0a39-4771-b752-0ed268ad847e" xlink:to="loc_us-gaap_PaymentsToAcquireInterestInSubsidiariesAndAffiliates_4be5e779-3027-425d-b38d-fe80ca1b63b0" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsPeriodIncreaseDecreaseIncludingExchangeRateEffect_e6828d6d-31ae-4e7c-bab4-04bb871f42c1" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsPeriodIncreaseDecreaseIncludingExchangeRateEffect"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_3b089c4d-f03b-486c-9b91-a66f7498c626" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_e6828d6d-31ae-4e7c-bab4-04bb871f42c1" xlink:to="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_3b089c4d-f03b-486c-9b91-a66f7498c626" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetCashProvidedByUsedInInvestingActivities_033c3929-a747-4463-8a33-8246422bee19" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_e6828d6d-31ae-4e7c-bab4-04bb871f42c1" xlink:to="loc_us-gaap_NetCashProvidedByUsedInInvestingActivities_033c3929-a747-4463-8a33-8246422bee19" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_3cf7513f-5f99-4b10-ba0a-47515a9113fc" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_e6828d6d-31ae-4e7c-bab4-04bb871f42c1" xlink:to="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_3cf7513f-5f99-4b10-ba0a-47515a9113fc" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_20fa3fde-7780-4da8-b179-e6f8b09f3d52" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_NetCashProvidedByUsedInOperatingActivities"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetIncomeLoss_3e21fac4-ca16-4a92-acca-a9fefde632d2" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_20fa3fde-7780-4da8-b179-e6f8b09f3d52" xlink:to="loc_us-gaap_NetIncomeLoss_3e21fac4-ca16-4a92-acca-a9fefde632d2" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleRealizedGainLoss_d3734017-fcc4-456d-8d73-9155a4b9c33d" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_20fa3fde-7780-4da8-b179-e6f8b09f3d52" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleRealizedGainLoss_d3734017-fcc4-456d-8d73-9155a4b9c33d" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_nmih_GainLossonChangeinFairValueofWarrantLiability_55cced13-87f9-4fd5-8fdb-d4c89e47d104" xlink:href="nmih-20221231.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_NetCashProvidedByUsedInOperatingActivities_20fa3fde-7780-4da8-b179-e6f8b09f3d52" xlink:to="loc_nmih_GainLossonChangeinFairValueofWarrantLiability_55cced13-87f9-4fd5-8fdb-d4c89e47d104" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DepreciationAmortizationAndAccretionNet_68f661a7-17e6-4254-a95b-46c7828df88a" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_20fa3fde-7780-4da8-b179-e6f8b09f3d52" xlink:to="loc_us-gaap_DepreciationAmortizationAndAccretionNet_68f661a7-17e6-4254-a95b-46c7828df88a" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccretionAmortizationOfDiscountsAndPremiumsInvestments_8cec96e4-d777-4fe9-9e39-fe8e2f894798" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_20fa3fde-7780-4da8-b179-e6f8b09f3d52" xlink:to="loc_us-gaap_AccretionAmortizationOfDiscountsAndPremiumsInvestments_8cec96e4-d777-4fe9-9e39-fe8e2f894798" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AmortizationOfFinancingCostsAndDiscounts_920b06ff-a51d-4ccc-8257-8a5156cf437d" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_20fa3fde-7780-4da8-b179-e6f8b09f3d52" xlink:to="loc_us-gaap_AmortizationOfFinancingCostsAndDiscounts_920b06ff-a51d-4ccc-8257-8a5156cf437d" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredIncomeTaxesAndTaxCredits_9a408b62-ac4e-4d93-903f-7625ba2fdfb9" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_20fa3fde-7780-4da8-b179-e6f8b09f3d52" xlink:to="loc_us-gaap_DeferredIncomeTaxesAndTaxCredits_9a408b62-ac4e-4d93-903f-7625ba2fdfb9" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensation_579e9732-9a24-477f-ae55-5c317a249d05" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_20fa3fde-7780-4da8-b179-e6f8b09f3d52" xlink:to="loc_us-gaap_ShareBasedCompensation_579e9732-9a24-477f-ae55-5c317a249d05" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInPremiumsReceivable_ead7af9e-1120-4bd4-b306-dc5aa15c63da" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_20fa3fde-7780-4da8-b179-e6f8b09f3d52" xlink:to="loc_us-gaap_IncreaseDecreaseInPremiumsReceivable_ead7af9e-1120-4bd4-b306-dc5aa15c63da" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInAccruedInvestmentIncomeReceivable_5ac85b63-c9a5-4c9a-af44-e903335fb3f0" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_20fa3fde-7780-4da8-b179-e6f8b09f3d52" xlink:to="loc_us-gaap_IncreaseDecreaseInAccruedInvestmentIncomeReceivable_5ac85b63-c9a5-4c9a-af44-e903335fb3f0" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInDeferredPolicyAcquisitionCosts_55efe3f7-6cb5-43ab-ba4e-b6614ab0ce76" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_IncreaseDecreaseInDeferredPolicyAcquisitionCosts"/>
    <link:calculationArc order="11" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_20fa3fde-7780-4da8-b179-e6f8b09f3d52" xlink:to="loc_us-gaap_IncreaseDecreaseInDeferredPolicyAcquisitionCosts_55efe3f7-6cb5-43ab-ba4e-b6614ab0ce76" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInReinsuranceRecoverable_8d5b0232-07cb-4c5e-983d-5f9e76571288" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_IncreaseDecreaseInReinsuranceRecoverable"/>
    <link:calculationArc order="12" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_20fa3fde-7780-4da8-b179-e6f8b09f3d52" xlink:to="loc_us-gaap_IncreaseDecreaseInReinsuranceRecoverable_8d5b0232-07cb-4c5e-983d-5f9e76571288" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInPrepaidTaxes_08547c4a-6f16-4db7-89e7-fa98dbd8dbbb" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_IncreaseDecreaseInPrepaidTaxes"/>
    <link:calculationArc order="13" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_20fa3fde-7780-4da8-b179-e6f8b09f3d52" xlink:to="loc_us-gaap_IncreaseDecreaseInPrepaidTaxes_08547c4a-6f16-4db7-89e7-fa98dbd8dbbb" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInPrepaidDeferredExpenseAndOtherAssets_b41c1200-dce0-4a47-8d8d-5425b4f379ab" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_20fa3fde-7780-4da8-b179-e6f8b09f3d52" xlink:to="loc_us-gaap_IncreaseDecreaseInPrepaidDeferredExpenseAndOtherAssets_b41c1200-dce0-4a47-8d8d-5425b4f379ab" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInUnearnedPremiums_4571c6de-1dc3-4bca-a882-debd7b8b75d8" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_20fa3fde-7780-4da8-b179-e6f8b09f3d52" xlink:to="loc_us-gaap_IncreaseDecreaseInUnearnedPremiums_4571c6de-1dc3-4bca-a882-debd7b8b75d8" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInLiabilityForClaimsAndClaimsAdjustmentExpenseReserve_77fc858e-a452-45a3-89f3-0a31f5f207bf" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_20fa3fde-7780-4da8-b179-e6f8b09f3d52" xlink:to="loc_us-gaap_IncreaseDecreaseInLiabilityForClaimsAndClaimsAdjustmentExpenseReserve_77fc858e-a452-45a3-89f3-0a31f5f207bf" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_nmih_IncreaseDecreaseinReinsuranceAssetsandLiabilities_ba228769-ab17-496f-800b-8c607740a82a" xlink:href="nmih-20221231.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_20fa3fde-7780-4da8-b179-e6f8b09f3d52" xlink:to="loc_nmih_IncreaseDecreaseinReinsuranceAssetsandLiabilities_ba228769-ab17-496f-800b-8c607740a82a" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInAccountsPayableAndAccruedLiabilities_c78ac773-5216-4876-b679-d54cb6c78630" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_20fa3fde-7780-4da8-b179-e6f8b09f3d52" xlink:to="loc_us-gaap_IncreaseDecreaseInAccountsPayableAndAccruedLiabilities_c78ac773-5216-4876-b679-d54cb6c78630" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_8c3bae25-673e-4361-afac-e1978084b9d2" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_NetCashProvidedByUsedInFinancingActivities"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ProceedsFromIssuanceOfCommonStock_e48a2a75-2a23-4c27-b94b-44b8ba69601f" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_8c3bae25-673e-4361-afac-e1978084b9d2" xlink:to="loc_us-gaap_ProceedsFromIssuanceOfCommonStock_e48a2a75-2a23-4c27-b94b-44b8ba69601f" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ProceedsFromIssuanceOfSharesUnderIncentiveAndShareBasedCompensationPlansIncludingStockOptions_a87e37d7-7069-4aa5-ac37-bc2870d4ea50" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_8c3bae25-673e-4361-afac-e1978084b9d2" xlink:to="loc_us-gaap_ProceedsFromIssuanceOfSharesUnderIncentiveAndShareBasedCompensationPlansIncludingStockOptions_a87e37d7-7069-4aa5-ac37-bc2870d4ea50" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ProceedsFromWarrantExercises_10a16b66-0aed-4883-b06d-b372c7d0f758" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_8c3bae25-673e-4361-afac-e1978084b9d2" xlink:to="loc_us-gaap_ProceedsFromWarrantExercises_10a16b66-0aed-4883-b06d-b372c7d0f758" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PaymentsOfDebtIssuanceCosts_f276a36e-77b9-4439-962f-70119c6b675d" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_PaymentsOfDebtIssuanceCosts"/>
    <link:calculationArc order="4" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_8c3bae25-673e-4361-afac-e1978084b9d2" xlink:to="loc_us-gaap_PaymentsOfDebtIssuanceCosts_f276a36e-77b9-4439-962f-70119c6b675d" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PaymentsRelatedToTaxWithholdingForShareBasedCompensation_e563d210-054b-47d2-8192-5152c3c2bce5" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_8c3bae25-673e-4361-afac-e1978084b9d2" xlink:to="loc_us-gaap_PaymentsRelatedToTaxWithholdingForShareBasedCompensation_e563d210-054b-47d2-8192-5152c3c2bce5" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RepaymentsOfLongTermDebt_9e823d66-b521-47ed-aa3b-eff0d7745945" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_RepaymentsOfLongTermDebt"/>
    <link:calculationArc order="6" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_8c3bae25-673e-4361-afac-e1978084b9d2" xlink:to="loc_us-gaap_RepaymentsOfLongTermDebt_9e823d66-b521-47ed-aa3b-eff0d7745945" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PaymentsForRepurchaseOfCommonStock_9c5a588e-0534-4e14-aee7-21be6dfecfb6" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_PaymentsForRepurchaseOfCommonStock"/>
    <link:calculationArc order="7" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_8c3bae25-673e-4361-afac-e1978084b9d2" xlink:to="loc_us-gaap_PaymentsForRepurchaseOfCommonStock_9c5a588e-0534-4e14-aee7-21be6dfecfb6" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ProceedsFromIssuanceOfLongTermDebt_8ebb2efa-0d9d-4760-94c1-f6351769c42b" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ProceedsFromIssuanceOfLongTermDebt"/>
    <link:calculationArc order="8" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_8c3bae25-673e-4361-afac-e1978084b9d2" xlink:to="loc_us-gaap_ProceedsFromIssuanceOfLongTermDebt_8ebb2efa-0d9d-4760-94c1-f6351769c42b" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.nationalmi.com/role/InvestmentsFairValuesandGrossUnrealizedGainsandLossesDetails" xlink:type="simple" xlink:href="nmih-20221231.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_4ca12f9a-a005-49b3-a90b-c00e436e11bb" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_AvailableForSaleDebtSecuritiesAmortizedCostBasis"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedLossBeforeTax_16f1c981-ec21-4e69-9d81-97e8987dac90" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_4ca12f9a-a005-49b3-a90b-c00e436e11bb" xlink:to="loc_us-gaap_AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedLossBeforeTax_16f1c981-ec21-4e69-9d81-97e8987dac90" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedGainBeforeTax_9a9ad4f5-e10d-42ed-a556-9dc84a08be05" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_4ca12f9a-a005-49b3-a90b-c00e436e11bb" xlink:to="loc_us-gaap_AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedGainBeforeTax_9a9ad4f5-e10d-42ed-a556-9dc84a08be05" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtSecurities_bd052100-d9f2-4b91-a57b-d6871d5c0aa6" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_4ca12f9a-a005-49b3-a90b-c00e436e11bb" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtSecurities_bd052100-d9f2-4b91-a57b-d6871d5c0aa6" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.nationalmi.com/role/InvestmentsScheduledMaturitiesDetails" xlink:type="simple" xlink:href="nmih-20221231.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_bc317279-8f95-4e45-9c4d-e79d2c7c3db3" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_AvailableForSaleDebtSecuritiesAmortizedCostBasis"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesNextRollingTwelveMonthsAmortizedCostBasis_4ebead03-a221-4b34-a7bf-fea54451fcb7" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_bc317279-8f95-4e45-9c4d-e79d2c7c3db3" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesNextRollingTwelveMonthsAmortizedCostBasis_4ebead03-a221-4b34-a7bf-fea54451fcb7" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesRollingYearTwoThroughFiveAmortizedCostBasis_370aea19-63a3-4aab-ba89-dca0d6987001" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_bc317279-8f95-4e45-9c4d-e79d2c7c3db3" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesRollingYearTwoThroughFiveAmortizedCostBasis_370aea19-63a3-4aab-ba89-dca0d6987001" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesRollingYearSixThroughTenAmortizedCostBasis_c811a83f-0cf2-440e-9a4a-1c5f21e14667" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_bc317279-8f95-4e45-9c4d-e79d2c7c3db3" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesRollingYearSixThroughTenAmortizedCostBasis_c811a83f-0cf2-440e-9a4a-1c5f21e14667" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesRollingAfterYearTenAmortizedCostBasis_6f8d5020-b2ff-41e9-925e-4895cf679dbe" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_bc317279-8f95-4e45-9c4d-e79d2c7c3db3" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesRollingAfterYearTenAmortizedCostBasis_6f8d5020-b2ff-41e9-925e-4895cf679dbe" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesWithoutSingleMaturityDateAmortizedCost_bd67b644-0fbc-45eb-adab-fedbceb5f331" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_bc317279-8f95-4e45-9c4d-e79d2c7c3db3" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesWithoutSingleMaturityDateAmortizedCost_bd67b644-0fbc-45eb-adab-fedbceb5f331" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtSecurities_0b92cbb1-9171-41f1-b9f8-9ad8909a5715" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_AvailableForSaleSecuritiesDebtSecurities"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesNextRollingTwelveMonthsFairValue_49045ed2-7bb3-45b3-a161-0eb6406032c7" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_0b92cbb1-9171-41f1-b9f8-9ad8909a5715" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesNextRollingTwelveMonthsFairValue_49045ed2-7bb3-45b3-a161-0eb6406032c7" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesRollingYearTwoThroughFiveFairValue_a0aebeb6-bd5c-497d-a5db-5fd2454cf72b" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_0b92cbb1-9171-41f1-b9f8-9ad8909a5715" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesRollingYearTwoThroughFiveFairValue_a0aebeb6-bd5c-497d-a5db-5fd2454cf72b" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesRollingYearSixThroughTenFairValue_2c4409dd-f2b3-462a-be5a-fc191e098bd0" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_0b92cbb1-9171-41f1-b9f8-9ad8909a5715" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesRollingYearSixThroughTenFairValue_2c4409dd-f2b3-462a-be5a-fc191e098bd0" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesRollingAfterYearTenFairValue_f66265fe-5ea8-43ea-a8ad-7f8ab6d8558c" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_0b92cbb1-9171-41f1-b9f8-9ad8909a5715" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesRollingAfterYearTenFairValue_f66265fe-5ea8-43ea-a8ad-7f8ab6d8558c" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesWithoutSingleMaturityDateFairValue_a402cdb6-05af-487f-b206-82f21552bcdd" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_0b92cbb1-9171-41f1-b9f8-9ad8909a5715" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesWithoutSingleMaturityDateFairValue_a402cdb6-05af-487f-b206-82f21552bcdd" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.nationalmi.com/role/InvestmentsAgingofUnrealizedLossesDetails" xlink:type="simple" xlink:href="nmih-20221231.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_e2428caf-5080-4810-aef8-0b7e5d2fbcf9" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPositionNumberOfPositions"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLongerNumberOfPositions_64e01582-9711-4b7d-a1c7-c16f892cbdd1" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_e2428caf-5080-4810-aef8-0b7e5d2fbcf9" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLongerNumberOfPositions_64e01582-9711-4b7d-a1c7-c16f892cbdd1" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionLessThan12MonthsNumberOfPositions_d758541c-83c9-47b8-999d-3ad9b6c55c07" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_e2428caf-5080-4810-aef8-0b7e5d2fbcf9" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionLessThan12MonthsNumberOfPositions_d758541c-83c9-47b8-999d-3ad9b6c55c07" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPositionAccumulatedLoss_f0763292-6b5d-4a66-9c07-849a1e84ebf4" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPositionAccumulatedLoss"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionLessThan12MonthsAccumulatedLoss_24a9ad01-83ee-48bf-8f83-f27e767bd3d8" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_f0763292-6b5d-4a66-9c07-849a1e84ebf4" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionLessThan12MonthsAccumulatedLoss_24a9ad01-83ee-48bf-8f83-f27e767bd3d8" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLongerAccumulatedLoss_90946007-8fe5-4811-9eda-c4b0c6cd4737" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_f0763292-6b5d-4a66-9c07-849a1e84ebf4" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLongerAccumulatedLoss_90946007-8fe5-4811-9eda-c4b0c6cd4737" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPosition_16d991aa-127a-4f53-9fb0-cb9941d5308c" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPosition"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionLessThan12Months_aca8bdc2-2cbb-4386-918a-8bbc61692e29" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_16d991aa-127a-4f53-9fb0-cb9941d5308c" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionLessThan12Months_aca8bdc2-2cbb-4386-918a-8bbc61692e29" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLonger_1c911885-9ead-4840-8b7e-622375c83af9" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_16d991aa-127a-4f53-9fb0-cb9941d5308c" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLonger_1c911885-9ead-4840-8b7e-622375c83af9" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.nationalmi.com/role/InvestmentsNetInvestmentIncomeDetails" xlink:type="simple" xlink:href="nmih-20221231.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_1081b077-10aa-466e-b5af-e941012501bf" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_InvestmentIncomeNet"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InvestmentIncomeInvestmentExpense_1edfd491-7d77-45aa-a53b-6b8917bf343c" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_1081b077-10aa-466e-b5af-e941012501bf" xlink:to="loc_us-gaap_InvestmentIncomeInvestmentExpense_1edfd491-7d77-45aa-a53b-6b8917bf343c" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InvestmentIncomeInterestAndDividend_faaa110e-81c4-40ac-bc44-52a04afd986d" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_1081b077-10aa-466e-b5af-e941012501bf" xlink:to="loc_us-gaap_InvestmentIncomeInterestAndDividend_faaa110e-81c4-40ac-bc44-52a04afd986d" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.nationalmi.com/role/InvestmentsNetRealizedInvestmentsGainsLossesDetails" xlink:type="simple" xlink:href="nmih-20221231.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_3d3b2667-bf0a-4802-918b-04dd7b7889ff" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DebtSecuritiesAvailableForSaleRealizedGainLoss"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleRealizedGain_12e30454-9f0e-4e6b-868b-3bf83ea9fce2" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_3d3b2667-bf0a-4802-918b-04dd7b7889ff" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleRealizedGain_12e30454-9f0e-4e6b-868b-3bf83ea9fce2" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleRealizedLoss_cbceb9bb-be8c-4b99-add1-e366ee7e6bca" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_3d3b2667-bf0a-4802-918b-04dd7b7889ff" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleRealizedLoss_cbceb9bb-be8c-4b99-add1-e366ee7e6bca" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.nationalmi.com/role/FairValueofFinancialInstrumentsAssetsandLiabilitiesatFairValueDetails" xlink:type="simple" xlink:href="nmih-20221231.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_30fbdc07-1d43-43d6-9d5c-afb7f7a75207" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_LiabilitiesFairValueDisclosure"/>
    <link:loc xlink:type="locator" xlink:label="loc_nmih_WarrantLiability_6d15fee5-e960-4e87-a343-9d7bdb40748e" xlink:href="nmih-20221231.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_30fbdc07-1d43-43d6-9d5c-afb7f7a75207" xlink:to="loc_nmih_WarrantLiability_6d15fee5-e960-4e87-a343-9d7bdb40748e" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AssetsFairValueDisclosure_5f03583b-e105-4107-9280-3483bf8d0455" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_AssetsFairValueDisclosure"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtSecurities_e30238bf-d521-41fd-b273-c3d98cbd72da" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_5f03583b-e105-4107-9280-3483bf8d0455" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtSecurities_e30238bf-d521-41fd-b273-c3d98cbd72da" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CashAndCashEquivalentsFairValueDisclosure_0d1d8dfe-ebd9-4b1a-beac-4efd5392cf5b" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_5f03583b-e105-4107-9280-3483bf8d0455" xlink:to="loc_us-gaap_CashAndCashEquivalentsFairValueDisclosure_0d1d8dfe-ebd9-4b1a-beac-4efd5392cf5b" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.nationalmi.com/role/ReinsuranceEffectofReinsuranceAgreementsonPremiumsWrittenandEarnedDetails" xlink:type="simple" xlink:href="nmih-20221231.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_cfdb298f-cb40-4a8f-ba67-914814b5dfd1" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_PremiumsWrittenNet"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DirectPremiumsWritten_fc777854-961b-4cc4-a8d4-ee0d82145668" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_cfdb298f-cb40-4a8f-ba67-914814b5dfd1" xlink:to="loc_us-gaap_DirectPremiumsWritten_fc777854-961b-4cc4-a8d4-ee0d82145668" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CededPremiumsWritten_0e3f7d19-4f88-459c-9dac-a98988a7e5e9" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_cfdb298f-cb40-4a8f-ba67-914814b5dfd1" xlink:to="loc_us-gaap_CededPremiumsWritten_0e3f7d19-4f88-459c-9dac-a98988a7e5e9" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PremiumsEarnedNet_07c75eb5-50a6-4f71-ba85-4a69ec17ca19" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_PremiumsEarnedNet"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DirectPremiumsEarned_421478ee-706a-448d-8ac1-91806ed81027" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_07c75eb5-50a6-4f71-ba85-4a69ec17ca19" xlink:to="loc_us-gaap_DirectPremiumsEarned_421478ee-706a-448d-8ac1-91806ed81027" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CededPremiumsEarned_4e5ef31a-f6a2-4b62-8d77-92e1c15a58f6" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_07c75eb5-50a6-4f71-ba85-4a69ec17ca19" xlink:to="loc_us-gaap_CededPremiumsEarned_4e5ef31a-f6a2-4b62-8d77-92e1c15a58f6" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.nationalmi.com/role/ReservesforInsuranceClaimsandClaimExpensesReconciliationofReserveBalancesforInsuranceClaimsandClaimExpenseDetails" xlink:type="simple" xlink:href="nmih-20221231.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_LiabilityForUnpaidClaimsAndClaimsAdjustmentExpenseNet_aa63de7c-2783-49bc-9e3b-cd37314f5575" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_LiabilityForUnpaidClaimsAndClaimsAdjustmentExpenseNet"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LiabilityForClaimsAndClaimsAdjustmentExpense_fa907d9f-6b1f-4747-93d0-ae4213445804" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_aa63de7c-2783-49bc-9e3b-cd37314f5575" xlink:to="loc_us-gaap_LiabilityForClaimsAndClaimsAdjustmentExpense_fa907d9f-6b1f-4747-93d0-ae4213445804" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ReinsuranceRecoverablesOnPaidAndUnpaidLosses_17464f32-b35b-4dbc-bfab-857ef0e545ce" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_aa63de7c-2783-49bc-9e3b-cd37314f5575" xlink:to="loc_us-gaap_ReinsuranceRecoverablesOnPaidAndUnpaidLosses_17464f32-b35b-4dbc-bfab-857ef0e545ce" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PaymentsForLossesAndLossAdjustmentExpense_15f4606c-9625-4a1d-8eb7-066969e5d652" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_PaymentsForLossesAndLossAdjustmentExpense"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LiabilityForUnpaidClaimsAndClaimsAdjustmentExpenseClaimsPaidCurrentYear1_3f74cbac-3427-4b66-9ce4-ab8c7ccca237" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_15f4606c-9625-4a1d-8eb7-066969e5d652" xlink:to="loc_us-gaap_LiabilityForUnpaidClaimsAndClaimsAdjustmentExpenseClaimsPaidCurrentYear1_3f74cbac-3427-4b66-9ce4-ab8c7ccca237" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LiabilityForUnpaidClaimsAndClaimsAdjustmentExpenseClaimsPaidPriorYears1_e2689263-33e8-4465-9b96-d15c39578954" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_15f4606c-9625-4a1d-8eb7-066969e5d652" xlink:to="loc_us-gaap_LiabilityForUnpaidClaimsAndClaimsAdjustmentExpenseClaimsPaidPriorYears1_e2689263-33e8-4465-9b96-d15c39578954" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LiabilityForUnpaidClaimsAndClaimsAdjustmentExpenseIncurredClaims1_399dede5-ad8c-490c-b167-68f61a690840" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_LiabilityForUnpaidClaimsAndClaimsAdjustmentExpenseIncurredClaims1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SupplementalInformationForPropertyCasualtyInsuranceUnderwritersCurrentYearClaimsAndClaimsAdjustmentExpense_cef75e73-ec1b-49d3-8691-24f2b6c2ac3e" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_399dede5-ad8c-490c-b167-68f61a690840" xlink:to="loc_us-gaap_SupplementalInformationForPropertyCasualtyInsuranceUnderwritersCurrentYearClaimsAndClaimsAdjustmentExpense_cef75e73-ec1b-49d3-8691-24f2b6c2ac3e" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SupplementalInformationForPropertyCasualtyInsuranceUnderwritersPriorYearClaimsAndClaimsAdjustmentExpense_fb108f38-cfca-45a3-b99f-d02e9078c431" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_399dede5-ad8c-490c-b167-68f61a690840" xlink:to="loc_us-gaap_SupplementalInformationForPropertyCasualtyInsuranceUnderwritersPriorYearClaimsAndClaimsAdjustmentExpense_fb108f38-cfca-45a3-b99f-d02e9078c431" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.nationalmi.com/role/ReservesforInsuranceClaimsandClaimExpensesReconciliationofDisclosureofIncurredandPaidClaimsDevelopmenttotheLiabilityforUnpaidClaimsandClaimsAdjustmentExpensesDetails" xlink:type="simple" xlink:href="nmih-20221231.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_ead53bda-a66b-4d4a-8ef4-71ea1bc09858" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ShortdurationInsuranceContractsLiabilityForUnpaidClaimsAndAllocatedClaimAdjustmentExpenseNet"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShortdurationInsuranceContractsIncurredClaimsAndAllocatedClaimAdjustmentExpenseNet_6a899ee4-c9af-41fb-b39d-4e8a0d0f637e" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_ead53bda-a66b-4d4a-8ef4-71ea1bc09858" xlink:to="loc_us-gaap_ShortdurationInsuranceContractsIncurredClaimsAndAllocatedClaimAdjustmentExpenseNet_6a899ee4-c9af-41fb-b39d-4e8a0d0f637e" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShortdurationInsuranceContractsCumulativePaidClaimsAndAllocatedClaimAdjustmentExpenseNet_8c1dba1b-3793-435c-a929-29d9d39d815b" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_ead53bda-a66b-4d4a-8ef4-71ea1bc09858" xlink:to="loc_us-gaap_ShortdurationInsuranceContractsCumulativePaidClaimsAndAllocatedClaimAdjustmentExpenseNet_8c1dba1b-3793-435c-a929-29d9d39d815b" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.nationalmi.com/role/EarningsperShareDetails" xlink:type="simple" xlink:href="nmih-20221231.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_NetIncomeLossAttributableToParentDiluted_bbbd244f-34ee-4c5d-9bb3-29eb3f0c3e96" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_NetIncomeLossAttributableToParentDiluted"/>
    <link:loc xlink:type="locator" xlink:label="loc_nmih_GainLossonChangeinFairValueofWarrantLiability_b6cc1996-7197-4592-97c1-a71238abf6c9" xlink:href="nmih-20221231.xsd#nmih_GainLossonChangeinFairValueofWarrantLiability"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetIncomeLossAttributableToParentDiluted_bbbd244f-34ee-4c5d-9bb3-29eb3f0c3e96" xlink:to="loc_nmih_GainLossonChangeinFairValueofWarrantLiability_b6cc1996-7197-4592-97c1-a71238abf6c9" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetIncomeLoss_c9bff787-c5b7-46c9-8335-33d1c543b2a2" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_NetIncomeLoss"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetIncomeLossAttributableToParentDiluted_bbbd244f-34ee-4c5d-9bb3-29eb3f0c3e96" xlink:to="loc_us-gaap_NetIncomeLoss_c9bff787-c5b7-46c9-8335-33d1c543b2a2" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_WeightedAverageNumberOfDilutedSharesOutstanding_e65c5055-7875-41a8-8472-2a01eac2b1db" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_WeightedAverageNumberOfDilutedSharesOutstanding"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_WeightedAverageNumberOfSharesOutstandingBasic_a32ed472-802a-4001-924d-f64be23845de" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_e65c5055-7875-41a8-8472-2a01eac2b1db" xlink:to="loc_us-gaap_WeightedAverageNumberOfSharesOutstandingBasic_a32ed472-802a-4001-924d-f64be23845de" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_WeightedAverageNumberDilutedSharesOutstandingAdjustment_d229216a-7537-44ef-b285-5281ff5bbfb3" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_e65c5055-7875-41a8-8472-2a01eac2b1db" xlink:to="loc_us-gaap_WeightedAverageNumberDilutedSharesOutstandingAdjustment_d229216a-7537-44ef-b285-5281ff5bbfb3" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.nationalmi.com/role/IncomeTaxesComponentsofIncomeTaxExpenseBenefitDetails" xlink:type="simple" xlink:href="nmih-20221231.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_7ea5e0d5-8e88-46de-a2ac-e06ead3ae976" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_IncomeTaxExpenseBenefit"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CurrentIncomeTaxExpenseBenefit_9d0aa45e-62b1-4c12-b7dd-46134571c8a3" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_7ea5e0d5-8e88-46de-a2ac-e06ead3ae976" xlink:to="loc_us-gaap_CurrentIncomeTaxExpenseBenefit_9d0aa45e-62b1-4c12-b7dd-46134571c8a3" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredIncomeTaxExpenseBenefit_999400a7-c48b-4118-a1cc-1096496480e0" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_7ea5e0d5-8e88-46de-a2ac-e06ead3ae976" xlink:to="loc_us-gaap_DeferredIncomeTaxExpenseBenefit_999400a7-c48b-4118-a1cc-1096496480e0" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.nationalmi.com/role/IncomeTaxesEffectiveIncomeTaxRateReconciliationDetails" xlink:type="simple" xlink:href="nmih-20221231.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_42cc31c8-2e6d-4df7-90be-862fdedb75b9" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_EffectiveIncomeTaxRateContinuingOperations"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EffectiveIncomeTaxRateReconciliationAtFederalStatutoryIncomeTaxRate_b5b1cd86-fcca-48b6-a9a3-eaaf8f62cb48" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_42cc31c8-2e6d-4df7-90be-862fdedb75b9" xlink:to="loc_us-gaap_EffectiveIncomeTaxRateReconciliationAtFederalStatutoryIncomeTaxRate_b5b1cd86-fcca-48b6-a9a3-eaaf8f62cb48" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EffectiveIncomeTaxRateReconciliationStateAndLocalIncomeTaxes_9f580a80-f598-4563-b31d-01391d5db35b" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_42cc31c8-2e6d-4df7-90be-862fdedb75b9" xlink:to="loc_us-gaap_EffectiveIncomeTaxRateReconciliationStateAndLocalIncomeTaxes_9f580a80-f598-4563-b31d-01391d5db35b" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_nmih_EffectiveIncomeTaxRateReconciliationCompensationShareBasedAndOtherPercent_390d9465-b407-44ea-bb73-ffa0f1399224" xlink:href="nmih-20221231.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_42cc31c8-2e6d-4df7-90be-862fdedb75b9" xlink:to="loc_nmih_EffectiveIncomeTaxRateReconciliationCompensationShareBasedAndOtherPercent_390d9465-b407-44ea-bb73-ffa0f1399224" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_nmih_EffectiveIncomeTaxRateReconciliationWarrantGainLossPercent_a0c4a378-c2d9-47d7-a29f-a3be78b65d55" xlink:href="nmih-20221231.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_42cc31c8-2e6d-4df7-90be-862fdedb75b9" xlink:to="loc_nmih_EffectiveIncomeTaxRateReconciliationWarrantGainLossPercent_a0c4a378-c2d9-47d7-a29f-a3be78b65d55" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_EffectiveIncomeTaxRateReconciliationOtherAdjustments_e224bcc0-1d41-41be-9eb2-49f579baea2e" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_42cc31c8-2e6d-4df7-90be-862fdedb75b9" xlink:to="loc_us-gaap_EffectiveIncomeTaxRateReconciliationOtherAdjustments_e224bcc0-1d41-41be-9eb2-49f579baea2e" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.nationalmi.com/role/IncomeTaxesDeferredTaxAssetandLiabilitiesDetails" xlink:type="simple" xlink:href="nmih-20221231.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_DeferredTaxLiabilities_6569330b-3d12-46d8-8600-b4a28623deae" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DeferredTaxLiabilities"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredIncomeTaxLiabilities_eb96fea2-e20d-42b3-b820-e85cb81f840a" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_6569330b-3d12-46d8-8600-b4a28623deae" xlink:to="loc_us-gaap_DeferredIncomeTaxLiabilities_eb96fea2-e20d-42b3-b820-e85cb81f840a" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredTaxAssetsNet_5f917713-4b7f-4d40-86b1-48c34aa0b211" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_6569330b-3d12-46d8-8600-b4a28623deae" xlink:to="loc_us-gaap_DeferredTaxAssetsNet_5f917713-4b7f-4d40-86b1-48c34aa0b211" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredIncomeTaxLiabilities_d908a602-927d-460b-b607-77f1ceae5e2e" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DeferredIncomeTaxLiabilities"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredTaxLiabilitiesDeferredExpenseReservesAndAccruals_ec863b85-0bed-4160-9871-a2b19f3c59a7" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_d908a602-927d-460b-b607-77f1ceae5e2e" xlink:to="loc_us-gaap_DeferredTaxLiabilitiesDeferredExpenseReservesAndAccruals_ec863b85-0bed-4160-9871-a2b19f3c59a7" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredTaxLiabilitiesDeferredExpenseDeferredPolicyAcquisitionCost_e783ac71-9712-4ca5-b638-f579ba267bf7" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_d908a602-927d-460b-b607-77f1ceae5e2e" xlink:to="loc_us-gaap_DeferredTaxLiabilitiesDeferredExpenseDeferredPolicyAcquisitionCost_e783ac71-9712-4ca5-b638-f579ba267bf7" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredTaxLiabilitiesDeferredExpenseCapitalizedSoftware_ca51c999-a828-465e-9979-00636011da99" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_d908a602-927d-460b-b607-77f1ceae5e2e" xlink:to="loc_us-gaap_DeferredTaxLiabilitiesDeferredExpenseCapitalizedSoftware_ca51c999-a828-465e-9979-00636011da99" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredTaxLiabilitiesInvestments_6125b933-41c9-4463-b58c-56b74226310e" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_d908a602-927d-460b-b607-77f1ceae5e2e" xlink:to="loc_us-gaap_DeferredTaxLiabilitiesInvestments_6125b933-41c9-4463-b58c-56b74226310e" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredTaxLiabilitiesOther_fdda5170-3781-4757-9f63-6c913df9bb9a" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_d908a602-927d-460b-b607-77f1ceae5e2e" xlink:to="loc_us-gaap_DeferredTaxLiabilitiesOther_fdda5170-3781-4757-9f63-6c913df9bb9a" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredTaxAssetsNet_b59988a7-69fb-4a94-b0fb-6a498edfffd0" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DeferredTaxAssetsNet"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredTaxAssetsGross_0bef289e-590e-4936-b7d0-e30669f2b9bc" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_b59988a7-69fb-4a94-b0fb-6a498edfffd0" xlink:to="loc_us-gaap_DeferredTaxAssetsGross_0bef289e-590e-4936-b7d0-e30669f2b9bc" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredTaxAssetsValuationAllowance_22a51248-29e0-41cb-b019-968654b3a166" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_b59988a7-69fb-4a94-b0fb-6a498edfffd0" xlink:to="loc_us-gaap_DeferredTaxAssetsValuationAllowance_22a51248-29e0-41cb-b019-968654b3a166" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredTaxAssetsGross_f3451af7-93ff-4cb3-8bef-8b21770d6f54" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DeferredTaxAssetsGross"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredTaxAssetsOperatingLossCarryforwards_bf38e056-f0cf-4299-80cc-931191ce2ff1" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_f3451af7-93ff-4cb3-8bef-8b21770d6f54" xlink:to="loc_us-gaap_DeferredTaxAssetsOperatingLossCarryforwards_bf38e056-f0cf-4299-80cc-931191ce2ff1" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredTaxAssetsTaxDeferredExpenseCompensationAndBenefitsShareBasedCompensationCost_a9c87743-d041-4a11-a2d9-616ff4b9e18a" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_f3451af7-93ff-4cb3-8bef-8b21770d6f54" xlink:to="loc_us-gaap_DeferredTaxAssetsTaxDeferredExpenseCompensationAndBenefitsShareBasedCompensationCost_a9c87743-d041-4a11-a2d9-616ff4b9e18a" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredTaxAssetsTaxDeferredExpenseReservesAndAccrualsUnearnedPremiumsReserve_90d1aa6a-af42-4acc-b5be-1ce33fd35c98" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_f3451af7-93ff-4cb3-8bef-8b21770d6f54" xlink:to="loc_us-gaap_DeferredTaxAssetsTaxDeferredExpenseReservesAndAccrualsUnearnedPremiumsReserve_90d1aa6a-af42-4acc-b5be-1ce33fd35c98" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredTaxAssetsTaxDeferredExpenseReservesAndAccrualsOther_72021f7c-633d-4bd3-9f9f-29688d3c05a0" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_f3451af7-93ff-4cb3-8bef-8b21770d6f54" xlink:to="loc_us-gaap_DeferredTaxAssetsTaxDeferredExpenseReservesAndAccrualsOther_72021f7c-633d-4bd3-9f9f-29688d3c05a0" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredTaxAssetsOther_3daf468a-7828-4c03-b9cc-1481f7cacc4a" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_f3451af7-93ff-4cb3-8bef-8b21770d6f54" xlink:to="loc_us-gaap_DeferredTaxAssetsOther_3daf468a-7828-4c03-b9cc-1481f7cacc4a" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredTaxAssetsUnrealizedLossesOnTradingSecurities_ab41ab85-c3ab-43f1-b346-da044d1d1273" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DeferredTaxAssetsUnrealizedLossesOnTradingSecurities"/>
    <link:calculationArc order="6" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_DeferredTaxAssetsGross_f3451af7-93ff-4cb3-8bef-8b21770d6f54" xlink:to="loc_us-gaap_DeferredTaxAssetsUnrealizedLossesOnTradingSecurities_ab41ab85-c3ab-43f1-b346-da044d1d1273" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.nationalmi.com/role/SoftwareandEquipmentNetBalancesDetails" xlink:type="simple" xlink:href="nmih-20221231.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_68c5a10b-830f-4f83-9086-0e0256fb8598" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_PropertyPlantAndEquipmentNet"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PropertyPlantAndEquipmentGross_a1f88cc1-f7f2-4380-a3ee-dc837caecf5a" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_68c5a10b-830f-4f83-9086-0e0256fb8598" xlink:to="loc_us-gaap_PropertyPlantAndEquipmentGross_a1f88cc1-f7f2-4380-a3ee-dc837caecf5a" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccumulatedDepreciationDepletionAndAmortizationPropertyPlantAndEquipment_3dd873f6-5773-4208-9e2c-c69b133f8400" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_68c5a10b-830f-4f83-9086-0e0256fb8598" xlink:to="loc_us-gaap_AccumulatedDepreciationDepletionAndAmortizationPropertyPlantAndEquipment_3dd873f6-5773-4208-9e2c-c69b133f8400" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.nationalmi.com/role/IntangibleAssetsandGoodwillDetails" xlink:type="simple" xlink:href="nmih-20221231.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_6f75c5af-4229-4b07-aa55-ab3b3e5fce0a" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_IntangibleAssetsNetIncludingGoodwill"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Goodwill_7a5e4e2a-8b97-44cc-89f7-7dda4401422d" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_6f75c5af-4229-4b07-aa55-ab3b3e5fce0a" xlink:to="loc_us-gaap_Goodwill_7a5e4e2a-8b97-44cc-89f7-7dda4401422d" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IndefiniteLivedIntangibleAssetsExcludingGoodwill_451adf88-ee82-43aa-8bb8-5e4a273e42fa" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_6f75c5af-4229-4b07-aa55-ab3b3e5fce0a" xlink:to="loc_us-gaap_IndefiniteLivedIntangibleAssetsExcludingGoodwill_451adf88-ee82-43aa-8bb8-5e4a273e42fa" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.nationalmi.com/role/CommitmentsandContingenciesFuturePaymentDueUnderOperatingLeasesDetails" xlink:type="simple" xlink:href="nmih-20221231.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_59e8b5ce-6d2b-4bdc-949c-1201b1a480ff" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OperatingLeaseLiability_f388a101-a9d8-42b6-b359-9126df35a310" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_OperatingLeaseLiability"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue_59e8b5ce-6d2b-4bdc-949c-1201b1a480ff" xlink:to="loc_us-gaap_OperatingLeaseLiability_f388a101-a9d8-42b6-b359-9126df35a310" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LesseeOperatingLeaseLiabilityUndiscountedExcessAmount_622f3dde-f3ca-41d6-a6ab-b6177358d733" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_LesseeOperatingLeaseLiabilityUndiscountedExcessAmount"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue_59e8b5ce-6d2b-4bdc-949c-1201b1a480ff" xlink:to="loc_us-gaap_LesseeOperatingLeaseLiabilityUndiscountedExcessAmount_622f3dde-f3ca-41d6-a6ab-b6177358d733" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.nationalmi.com/role/CommitmentsandContingenciesFuturePaymentDueUnderOperatingLeasesDetails_1" xlink:type="simple" xlink:href="nmih-20221231.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_6ff92a0a-a7ea-4b09-8c94-b8b8582623fa" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueNextTwelveMonths_3401dab6-7831-491c-a9fc-d7df6e60ee39" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_6ff92a0a-a7ea-4b09-8c94-b8b8582623fa" xlink:to="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueNextTwelveMonths_3401dab6-7831-491c-a9fc-d7df6e60ee39" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearTwo_0734d790-b6eb-4dc0-9b8d-9fbfaf261abf" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_6ff92a0a-a7ea-4b09-8c94-b8b8582623fa" xlink:to="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearTwo_0734d790-b6eb-4dc0-9b8d-9fbfaf261abf" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearThree_f0d7ae7a-864c-44b1-94a2-aa681fbb2eae" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearThree"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue_6ff92a0a-a7ea-4b09-8c94-b8b8582623fa" xlink:to="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearThree_f0d7ae7a-864c-44b1-94a2-aa681fbb2eae" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearFour_8ac1dbe4-2145-47b1-9e11-c1cf3d39b8ba" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearFour"/>
    <link:calculationArc order="4" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue_6ff92a0a-a7ea-4b09-8c94-b8b8582623fa" xlink:to="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearFour_8ac1dbe4-2145-47b1-9e11-c1cf3d39b8ba" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearFive_1289e602-a3d6-45e6-a711-4dbc419ce834" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearFive"/>
    <link:calculationArc order="5" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue_6ff92a0a-a7ea-4b09-8c94-b8b8582623fa" xlink:to="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueYearFive_1289e602-a3d6-45e6-a711-4dbc419ce834" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueAfterYearFive_a3d9358a-ea97-41a9-9673-1fd11c35bb0e" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueAfterYearFive"/>
    <link:calculationArc order="6" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDue_6ff92a0a-a7ea-4b09-8c94-b8b8582623fa" xlink:to="loc_us-gaap_LesseeOperatingLeaseLiabilityPaymentsDueAfterYearFive_a3d9358a-ea97-41a9-9673-1fd11c35bb0e" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.nationalmi.com/role/RegulatoryInformationScheduleofCombinedStatutoryNetLossStatutorySurplusContingencyReserveandRTCRatiosDetails" xlink:type="simple" xlink:href="nmih-20221231.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_0f78e54a-34d0-4895-a348-c9421dc26aea" xlink:href="nmih-20221231.xsd#nmih_StatutoryAccountingPracticesStatutoryCapitalAndSurplusIncludingContingencyReserve"/>
    <link:loc xlink:type="locator" xlink:label="loc_nmih_StatutoryAccountingPracticesContingencyReserve_db0b9306-b9a2-49af-888e-f818c7644aaa" xlink:href="nmih-20221231.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_0f78e54a-34d0-4895-a348-c9421dc26aea" xlink:to="loc_nmih_StatutoryAccountingPracticesContingencyReserve_db0b9306-b9a2-49af-888e-f818c7644aaa" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatutoryAccountingPracticesStatutoryCapitalAndSurplusBalance_031e6357-5d7c-46e6-b149-97cffed871ab" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_0f78e54a-34d0-4895-a348-c9421dc26aea" xlink:to="loc_us-gaap_StatutoryAccountingPracticesStatutoryCapitalAndSurplusBalance_031e6357-5d7c-46e6-b149-97cffed871ab" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.nationalmi.com/role/SCHEDULEIIFINANCIALINFORMATIONOFREGISTRANTPARENTCOMPANYONLYBalanceSheetsParentCompanyOnlyDetails" xlink:type="simple" xlink:href="nmih-20221231.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_9406e2e6-25d2-44f1-992b-9fcfce9db26d" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_Assets"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtSecurities_6c9c5ea3-f357-46fe-8ba1-0ae8936bf007" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_9406e2e6-25d2-44f1-992b-9fcfce9db26d" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtSecurities_6c9c5ea3-f357-46fe-8ba1-0ae8936bf007" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents_9590be54-fd14-4820-94b1-09ad7a24e162" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_9406e2e6-25d2-44f1-992b-9fcfce9db26d" xlink:to="loc_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents_9590be54-fd14-4820-94b1-09ad7a24e162" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InvestmentsInAffiliatesSubsidiariesAssociatesAndJointVentures_7dee5c42-abe8-4a3a-8a8b-e4d3ae828bd6" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_9406e2e6-25d2-44f1-992b-9fcfce9db26d" xlink:to="loc_us-gaap_InvestmentsInAffiliatesSubsidiariesAssociatesAndJointVentures_7dee5c42-abe8-4a3a-8a8b-e4d3ae828bd6" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccruedInvestmentIncomeReceivable_f40ebbf0-c138-45a4-b163-7f5025adfd95" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_9406e2e6-25d2-44f1-992b-9fcfce9db26d" xlink:to="loc_us-gaap_AccruedInvestmentIncomeReceivable_f40ebbf0-c138-45a4-b163-7f5025adfd95" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DueFromAffiliates_94731d6e-62cd-4c95-bda8-e4b08e016603" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DueFromAffiliates"/>
    <link:calculationArc order="5" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_9406e2e6-25d2-44f1-992b-9fcfce9db26d" xlink:to="loc_us-gaap_DueFromAffiliates_94731d6e-62cd-4c95-bda8-e4b08e016603" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PropertyPlantAndEquipmentNet_159b3da4-090b-40b2-ba84-ebc67d1b73ba" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_PropertyPlantAndEquipmentNet"/>
    <link:calculationArc order="6" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_9406e2e6-25d2-44f1-992b-9fcfce9db26d" xlink:to="loc_us-gaap_PropertyPlantAndEquipmentNet_159b3da4-090b-40b2-ba84-ebc67d1b73ba" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherAssets_c3202c44-553f-4310-bbc3-3b6693d4c346" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_OtherAssets"/>
    <link:calculationArc order="7" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_9406e2e6-25d2-44f1-992b-9fcfce9db26d" xlink:to="loc_us-gaap_OtherAssets_c3202c44-553f-4310-bbc3-3b6693d4c346" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.nationalmi.com/role/SCHEDULEIIFINANCIALINFORMATIONOFREGISTRANTPARENTCOMPANYONLYStatementofOperationsParentCompanyOnlyDetails" xlink:type="simple" xlink:href="nmih-20221231.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_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest_9a0698ff-4056-4d93-96a9-dedd9edb371a" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Revenues_7eab7897-d5d3-4e42-b198-fd381915dc00" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_9a0698ff-4056-4d93-96a9-dedd9edb371a" xlink:to="loc_us-gaap_Revenues_7eab7897-d5d3-4e42-b198-fd381915dc00" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CostsAndExpenses_17acd997-0689-4df6-a7bb-d463fc31d7eb" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_9a0698ff-4056-4d93-96a9-dedd9edb371a" xlink:to="loc_us-gaap_CostsAndExpenses_17acd997-0689-4df6-a7bb-d463fc31d7eb" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeLossFromEquityMethodInvestments_19f90d1a-81e4-487a-ad39-e779df60ed90" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_9a0698ff-4056-4d93-96a9-dedd9edb371a" xlink:to="loc_us-gaap_IncomeLossFromEquityMethodInvestments_19f90d1a-81e4-487a-ad39-e779df60ed90" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CostsAndExpenses_b43e39c8-b002-497d-88e8-097494fa5834" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_CostsAndExpenses"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherExpenses_95a96794-2acd-4b7e-aae5-5b3e41b13c2c" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_b43e39c8-b002-497d-88e8-097494fa5834" xlink:to="loc_us-gaap_OtherExpenses_95a96794-2acd-4b7e-aae5-5b3e41b13c2c" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InterestExpense_5ecdecff-ecd9-4c1f-b089-1683c27e869f" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_b43e39c8-b002-497d-88e8-097494fa5834" xlink:to="loc_us-gaap_InterestExpense_5ecdecff-ecd9-4c1f-b089-1683c27e869f" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_nmih_GainLossonChangeinFairValueofWarrantLiability_88507530-4390-4d12-9764-13519e428ba6" xlink:href="nmih-20221231.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_b43e39c8-b002-497d-88e8-097494fa5834" xlink:to="loc_nmih_GainLossonChangeinFairValueofWarrantLiability_88507530-4390-4d12-9764-13519e428ba6" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent_870a466f-5a57-471e-b549-f49003e50cd3" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherComprehensiveIncomeUnrealizedHoldingGainLossOnSecuritiesArisingDuringPeriodNetOfTax_43bd144a-0017-4f81-9a65-1ddaea6dc79e" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_870a466f-5a57-471e-b549-f49003e50cd3" xlink:to="loc_us-gaap_OtherComprehensiveIncomeUnrealizedHoldingGainLossOnSecuritiesArisingDuringPeriodNetOfTax_43bd144a-0017-4f81-9a65-1ddaea6dc79e" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherComprehensiveIncomeLossReclassificationAdjustmentFromAOCIForSaleOfSecuritiesNetOfTax_07686ca7-3007-4253-9b0d-ec162876a6fa" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_870a466f-5a57-471e-b549-f49003e50cd3" xlink:to="loc_us-gaap_OtherComprehensiveIncomeLossReclassificationAdjustmentFromAOCIForSaleOfSecuritiesNetOfTax_07686ca7-3007-4253-9b0d-ec162876a6fa" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_nmih_OtherComprehensiveIncomeLossNetofTaxPortionAttributabletoSubsidiary_60e1ef25-b88d-4473-ad22-736996817df0" xlink:href="nmih-20221231.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_870a466f-5a57-471e-b549-f49003e50cd3" xlink:to="loc_nmih_OtherComprehensiveIncomeLossNetofTaxPortionAttributabletoSubsidiary_60e1ef25-b88d-4473-ad22-736996817df0" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.nationalmi.com/role/SCHEDULEIVFINANCIALINFORMATIONOFREGISTRANTREINSURANCEDetails" xlink:type="simple" xlink:href="nmih-20221231.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_836a90fa-e56a-409e-a517-1c9c2c92a9f2" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_PremiumsEarnedNet"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DirectPremiumsEarned_85c60c2d-971f-403c-97b0-948d8abfb806" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_836a90fa-e56a-409e-a517-1c9c2c92a9f2" xlink:to="loc_us-gaap_DirectPremiumsEarned_85c60c2d-971f-403c-97b0-948d8abfb806" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CededPremiumsEarned_6a32522d-68fb-43d2-8d19-59064d14d73f" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_836a90fa-e56a-409e-a517-1c9c2c92a9f2" xlink:to="loc_us-gaap_CededPremiumsEarned_6a32522d-68fb-43d2-8d19-59064d14d73f" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AssumedPremiumsEarned_0a73548b-cbab-41c2-8a84-3d5fab0a0c40" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_836a90fa-e56a-409e-a517-1c9c2c92a9f2" xlink:to="loc_us-gaap_AssumedPremiumsEarned_0a73548b-cbab-41c2-8a84-3d5fab0a0c40" xlink:type="arc"/>
  </link:calculationLink>
</link:linkbase>
