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

<!--XBRL Document Created with the Workiva Platform-->
<!--Copyright 2024 Workiva-->
<!--r:0a96d5b2-730f-48c5-91aa-5c86a796981d,g:8b577ee9-29a3-4d22-ad6a-b71ce3e46736-->
<link:linkbase xmlns:link="http://www.xbrl.org/2003/linkbase" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.xbrl.org/2003/linkbase http://www.xbrl.org/2003/xbrl-linkbase-2003-12-31.xsd">
  <link:roleRef roleURI="http://www.nationalmi.com/role/CONDENSEDCONSOLIDATEDBALANCESHEETSUNAUDITED" xlink:type="simple" xlink:href="nmih-20240630.xsd#CONDENSEDCONSOLIDATEDBALANCESHEETSUNAUDITED"/>
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/CONDENSEDCONSOLIDATEDBALANCESHEETSUNAUDITED" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockholdersEquity_674184dc-11aa-4f61-a219-87abb3fea6c4" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StockholdersEquity"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommonStockValueOutstanding_6be14134-74b7-4d71-9ce8-7885e5ecd5b9" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.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_674184dc-11aa-4f61-a219-87abb3fea6c4" xlink:to="loc_us-gaap_CommonStockValueOutstanding_6be14134-74b7-4d71-9ce8-7885e5ecd5b9" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AdditionalPaidInCapital_e612cbdd-810e-4acc-9ee1-138bf2b7dd7b" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.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_674184dc-11aa-4f61-a219-87abb3fea6c4" xlink:to="loc_us-gaap_AdditionalPaidInCapital_e612cbdd-810e-4acc-9ee1-138bf2b7dd7b" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TreasuryStockCommonValue_11f92c7c-b149-4c09-af7e-b9d539607edd" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_TreasuryStockCommonValue"/>
    <link:calculationArc order="3" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_StockholdersEquity_674184dc-11aa-4f61-a219-87abb3fea6c4" xlink:to="loc_us-gaap_TreasuryStockCommonValue_11f92c7c-b149-4c09-af7e-b9d539607edd" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccumulatedOtherComprehensiveIncomeLossNetOfTax_14d4095e-fc93-4366-be97-7801d6908337" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AccumulatedOtherComprehensiveIncomeLossNetOfTax"/>
    <link:calculationArc order="4" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_StockholdersEquity_674184dc-11aa-4f61-a219-87abb3fea6c4" xlink:to="loc_us-gaap_AccumulatedOtherComprehensiveIncomeLossNetOfTax_14d4095e-fc93-4366-be97-7801d6908337" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RetainedEarningsAccumulatedDeficit_8a5afc99-95c5-4859-9bd8-e3e5160207dc" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_RetainedEarningsAccumulatedDeficit"/>
    <link:calculationArc order="5" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_StockholdersEquity_674184dc-11aa-4f61-a219-87abb3fea6c4" xlink:to="loc_us-gaap_RetainedEarningsAccumulatedDeficit_8a5afc99-95c5-4859-9bd8-e3e5160207dc" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LiabilitiesAndStockholdersEquity_22d3b50a-74ec-4e39-ad7c-2a04381f7995" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LiabilitiesAndStockholdersEquity"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Liabilities_0fb0c632-4c52-46e7-8a66-3bf56286ac9b" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.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_22d3b50a-74ec-4e39-ad7c-2a04381f7995" xlink:to="loc_us-gaap_Liabilities_0fb0c632-4c52-46e7-8a66-3bf56286ac9b" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommitmentsAndContingencies_6d269f11-b6eb-4f80-9b07-7b35ac64ddf2" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.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_22d3b50a-74ec-4e39-ad7c-2a04381f7995" xlink:to="loc_us-gaap_CommitmentsAndContingencies_6d269f11-b6eb-4f80-9b07-7b35ac64ddf2" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockholdersEquity_3cace10c-fcb7-4d64-b20c-350b2226c5d7" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.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_22d3b50a-74ec-4e39-ad7c-2a04381f7995" xlink:to="loc_us-gaap_StockholdersEquity_3cace10c-fcb7-4d64-b20c-350b2226c5d7" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Liabilities_03f5d2ae-946d-4011-a2e6-85c4f43e96ae" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_Liabilities"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SecuredDebt_893cb768-98ea-42f9-b524-440cf4a3f68e" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_SecuredDebt"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Liabilities_03f5d2ae-946d-4011-a2e6-85c4f43e96ae" xlink:to="loc_us-gaap_SecuredDebt_893cb768-98ea-42f9-b524-440cf4a3f68e" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_UnearnedPremiums_3341f524-05e2-4de2-bba3-8603e5ff4c5f" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.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_03f5d2ae-946d-4011-a2e6-85c4f43e96ae" xlink:to="loc_us-gaap_UnearnedPremiums_3341f524-05e2-4de2-bba3-8603e5ff4c5f" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccountsPayableAndAccruedLiabilitiesCurrentAndNoncurrent_ba72db7f-5e4a-4572-9efa-001ca838b30e" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.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_03f5d2ae-946d-4011-a2e6-85c4f43e96ae" xlink:to="loc_us-gaap_AccountsPayableAndAccruedLiabilitiesCurrentAndNoncurrent_ba72db7f-5e4a-4572-9efa-001ca838b30e" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LiabilityForClaimsAndClaimsAdjustmentExpense_4d1756c1-9e02-4cb2-a04a-89e2becfc6f5" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.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_03f5d2ae-946d-4011-a2e6-85c4f43e96ae" xlink:to="loc_us-gaap_LiabilityForClaimsAndClaimsAdjustmentExpense_4d1756c1-9e02-4cb2-a04a-89e2becfc6f5" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredIncomeTaxLiabilitiesNet_e782ba11-a4bc-4368-91e5-796c708954f1" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DeferredIncomeTaxLiabilitiesNet"/>
    <link:calculationArc order="5" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Liabilities_03f5d2ae-946d-4011-a2e6-85c4f43e96ae" xlink:to="loc_us-gaap_DeferredIncomeTaxLiabilitiesNet_e782ba11-a4bc-4368-91e5-796c708954f1" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherLiabilities_4c860c87-b6fc-4766-9365-1d99bb9651fb" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_OtherLiabilities"/>
    <link:calculationArc order="6" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Liabilities_03f5d2ae-946d-4011-a2e6-85c4f43e96ae" xlink:to="loc_us-gaap_OtherLiabilities_4c860c87-b6fc-4766-9365-1d99bb9651fb" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Assets_306350d7-1202-4ce3-a71f-143b67f1bc62" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_Assets"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtSecurities_62a83c2d-cd6a-4757-8d0a-0703c6e1390c" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.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_306350d7-1202-4ce3-a71f-143b67f1bc62" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtSecurities_62a83c2d-cd6a-4757-8d0a-0703c6e1390c" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents_b0d4ccda-e539-46f8-90d7-249f6113d6ac" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.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_306350d7-1202-4ce3-a71f-143b67f1bc62" xlink:to="loc_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents_b0d4ccda-e539-46f8-90d7-249f6113d6ac" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PremiumsReceivableAtCarryingValue_751afb8c-4623-457d-9e50-444222d05786" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.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_306350d7-1202-4ce3-a71f-143b67f1bc62" xlink:to="loc_us-gaap_PremiumsReceivableAtCarryingValue_751afb8c-4623-457d-9e50-444222d05786" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccruedInvestmentIncomeReceivable_174c8c2a-be8d-4651-ad77-bde3aac35379" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.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_306350d7-1202-4ce3-a71f-143b67f1bc62" xlink:to="loc_us-gaap_AccruedInvestmentIncomeReceivable_174c8c2a-be8d-4651-ad77-bde3aac35379" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredPolicyAcquisitionCosts_d90f560a-3731-4ba0-8bde-2705df5e97b5" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.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_306350d7-1202-4ce3-a71f-143b67f1bc62" xlink:to="loc_us-gaap_DeferredPolicyAcquisitionCosts_d90f560a-3731-4ba0-8bde-2705df5e97b5" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PropertyPlantAndEquipmentNet_f9576d4d-ce88-4125-bc06-1cac311e7af8" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.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_306350d7-1202-4ce3-a71f-143b67f1bc62" xlink:to="loc_us-gaap_PropertyPlantAndEquipmentNet_f9576d4d-ce88-4125-bc06-1cac311e7af8" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IntangibleAssetsNetIncludingGoodwill_bb2a222c-2cf5-4cae-a25b-65386d52a683" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.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_306350d7-1202-4ce3-a71f-143b67f1bc62" xlink:to="loc_us-gaap_IntangibleAssetsNetIncludingGoodwill_bb2a222c-2cf5-4cae-a25b-65386d52a683" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ReinsuranceRecoverablesGross_67948470-a612-4c0f-8396-e4818d0658b5" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.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_306350d7-1202-4ce3-a71f-143b67f1bc62" xlink:to="loc_us-gaap_ReinsuranceRecoverablesGross_67948470-a612-4c0f-8396-e4818d0658b5" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_nmih_PrepaidFederalIncomeTaxes_e5889162-39f0-4502-91be-51b4d5fd014d" xlink:href="nmih-20240630.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_306350d7-1202-4ce3-a71f-143b67f1bc62" xlink:to="loc_nmih_PrepaidFederalIncomeTaxes_e5889162-39f0-4502-91be-51b4d5fd014d" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherAssets_1c6bbb47-3010-410d-b68a-27ad42a9fdac" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.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_306350d7-1202-4ce3-a71f-143b67f1bc62" xlink:to="loc_us-gaap_OtherAssets_1c6bbb47-3010-410d-b68a-27ad42a9fdac" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.nationalmi.com/role/CONDENSEDCONSOLIDATEDSTATEMENTSOFOPERATIONSANDCOMPREHENSIVEINCOMEUNAUDITED" xlink:type="simple" xlink:href="nmih-20240630.xsd#CONDENSEDCONSOLIDATEDSTATEMENTSOFOPERATIONSANDCOMPREHENSIVEINCOMEUNAUDITED"/>
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/CONDENSEDCONSOLIDATEDSTATEMENTSOFOPERATIONSANDCOMPREHENSIVEINCOMEUNAUDITED" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Revenues_b0fbee48-9844-4246-a188-ab963e263a4d" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_Revenues"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PremiumsEarnedNet_8a13bc79-0b5e-43de-a1c0-72a607ae5c5b" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.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_b0fbee48-9844-4246-a188-ab963e263a4d" xlink:to="loc_us-gaap_PremiumsEarnedNet_8a13bc79-0b5e-43de-a1c0-72a607ae5c5b" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetInvestmentIncome_7c48615d-9f89-4d20-90bf-abeb0ce15b9b" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.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_b0fbee48-9844-4246-a188-ab963e263a4d" xlink:to="loc_us-gaap_NetInvestmentIncome_7c48615d-9f89-4d20-90bf-abeb0ce15b9b" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_GainLossOnInvestments_986521b3-56d6-485a-824d-5b294b7c3bb1" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.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_b0fbee48-9844-4246-a188-ab963e263a4d" xlink:to="loc_us-gaap_GainLossOnInvestments_986521b3-56d6-485a-824d-5b294b7c3bb1" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherIncome_fde17233-7b6c-4067-a517-f3ba17dbbbe5" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.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_b0fbee48-9844-4246-a188-ab963e263a4d" xlink:to="loc_us-gaap_OtherIncome_fde17233-7b6c-4067-a517-f3ba17dbbbe5" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest_e8505444-32f8-4b95-baab-4fdf6e01e375" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Revenues_50472b09-47f4-4e9f-b91c-67ff24d3292d" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.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_e8505444-32f8-4b95-baab-4fdf6e01e375" xlink:to="loc_us-gaap_Revenues_50472b09-47f4-4e9f-b91c-67ff24d3292d" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CostsAndExpenses_feb7f1a2-4556-48ed-981f-360eee1d29cd" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.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_e8505444-32f8-4b95-baab-4fdf6e01e375" xlink:to="loc_us-gaap_CostsAndExpenses_feb7f1a2-4556-48ed-981f-360eee1d29cd" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ComprehensiveIncomeNetOfTax_59831ef8-5095-428b-8b93-65a1d9aa2a07" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ComprehensiveIncomeNetOfTax"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetIncomeLoss_72f1638c-d791-4281-8767-0afe5364afdc" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.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_59831ef8-5095-428b-8b93-65a1d9aa2a07" xlink:to="loc_us-gaap_NetIncomeLoss_72f1638c-d791-4281-8767-0afe5364afdc" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent_5b2ebbb2-fc73-4e29-8cb0-996e216351ed" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.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_59831ef8-5095-428b-8b93-65a1d9aa2a07" xlink:to="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent_5b2ebbb2-fc73-4e29-8cb0-996e216351ed" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CostsAndExpenses_3d5e54de-035a-4075-a88a-abdb3122507c" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CostsAndExpenses"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PolicyholderBenefitsAndClaimsIncurredNet_c75fe9fb-7c45-4bd7-8068-5ef9781f51c0" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PolicyholderBenefitsAndClaimsIncurredNet"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_CostsAndExpenses_3d5e54de-035a-4075-a88a-abdb3122507c" xlink:to="loc_us-gaap_PolicyholderBenefitsAndClaimsIncurredNet_c75fe9fb-7c45-4bd7-8068-5ef9781f51c0" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherCostAndExpenseOperating_f02e34c0-3ec6-404b-9998-4e76772a65f5" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.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_3d5e54de-035a-4075-a88a-abdb3122507c" xlink:to="loc_us-gaap_OtherCostAndExpenseOperating_f02e34c0-3ec6-404b-9998-4e76772a65f5" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherNonoperatingExpense_94ea30e5-e49f-425c-8e3d-a274fb61b7fe" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.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_3d5e54de-035a-4075-a88a-abdb3122507c" xlink:to="loc_us-gaap_OtherNonoperatingExpense_94ea30e5-e49f-425c-8e3d-a274fb61b7fe" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InterestExpenseNonoperating_2451d4b0-152a-4395-87e1-78bc2031b1ab" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_InterestExpenseNonoperating"/>
    <link:calculationArc order="4" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_CostsAndExpenses_3d5e54de-035a-4075-a88a-abdb3122507c" xlink:to="loc_us-gaap_InterestExpenseNonoperating_2451d4b0-152a-4395-87e1-78bc2031b1ab" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent_53daf8d8-6299-45b8-a839-ccd32ab4cdb7" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherComprehensiveIncomeUnrealizedHoldingGainLossOnSecuritiesArisingDuringPeriodNetOfTax_db5ad92e-2cdf-4db1-a1f7-b27338ee4e8f" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.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_53daf8d8-6299-45b8-a839-ccd32ab4cdb7" xlink:to="loc_us-gaap_OtherComprehensiveIncomeUnrealizedHoldingGainLossOnSecuritiesArisingDuringPeriodNetOfTax_db5ad92e-2cdf-4db1-a1f7-b27338ee4e8f" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherComprehensiveIncomeLossReclassificationAdjustmentFromAOCIForSaleOfSecuritiesNetOfTax_7b416d37-e7c7-4c7e-ad10-05497305e4a0" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.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_53daf8d8-6299-45b8-a839-ccd32ab4cdb7" xlink:to="loc_us-gaap_OtherComprehensiveIncomeLossReclassificationAdjustmentFromAOCIForSaleOfSecuritiesNetOfTax_7b416d37-e7c7-4c7e-ad10-05497305e4a0" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetIncomeLoss_dd7c49e8-ca18-40d3-b008-7ba0db539840" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_NetIncomeLoss"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest_6d08fbaf-6998-4073-80fb-69725a395c44" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.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_dd7c49e8-ca18-40d3-b008-7ba0db539840" xlink:to="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest_6d08fbaf-6998-4073-80fb-69725a395c44" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeTaxExpenseBenefit_c410b792-1281-45f2-8a50-60a5291aee6d" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.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_dd7c49e8-ca18-40d3-b008-7ba0db539840" xlink:to="loc_us-gaap_IncomeTaxExpenseBenefit_c410b792-1281-45f2-8a50-60a5291aee6d" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.nationalmi.com/role/CONDENSEDCONSOLIDATEDSTATEMENTSOFCASHFLOWSUNAUDITED" xlink:type="simple" xlink:href="nmih-20240630.xsd#CONDENSEDCONSOLIDATEDSTATEMENTSOFCASHFLOWSUNAUDITED"/>
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/CONDENSEDCONSOLIDATEDSTATEMENTSOFCASHFLOWSUNAUDITED" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsPeriodIncreaseDecreaseIncludingExchangeRateEffect_e509ab5b-6e93-4a7a-ba6f-7dd8caa1b4db" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsPeriodIncreaseDecreaseIncludingExchangeRateEffect"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_a5497425-712b-4971-8f35-5c0a58e8f4b6" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.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_e509ab5b-6e93-4a7a-ba6f-7dd8caa1b4db" xlink:to="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_a5497425-712b-4971-8f35-5c0a58e8f4b6" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetCashProvidedByUsedInInvestingActivities_c04a960c-b16d-4ffb-b54e-7e75e9bf9d60" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.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_e509ab5b-6e93-4a7a-ba6f-7dd8caa1b4db" xlink:to="loc_us-gaap_NetCashProvidedByUsedInInvestingActivities_c04a960c-b16d-4ffb-b54e-7e75e9bf9d60" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_f0619178-01de-4587-a18d-f948176077ef" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.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_e509ab5b-6e93-4a7a-ba6f-7dd8caa1b4db" xlink:to="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_f0619178-01de-4587-a18d-f948176077ef" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_97bccd42-c44a-4c1e-9262-cfa242a00a2e" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_NetCashProvidedByUsedInOperatingActivities"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetIncomeLoss_db313df0-d5df-4f9a-ae32-f60de272b1e5" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.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_97bccd42-c44a-4c1e-9262-cfa242a00a2e" xlink:to="loc_us-gaap_NetIncomeLoss_db313df0-d5df-4f9a-ae32-f60de272b1e5" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleRealizedGainLoss_7400750f-b577-4861-8c7e-1d4240d5e90c" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.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_97bccd42-c44a-4c1e-9262-cfa242a00a2e" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleRealizedGainLoss_7400750f-b577-4861-8c7e-1d4240d5e90c" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DepreciationAmortizationAndAccretionNet_72f175e7-ff0d-418a-b641-a55c1a1ed1e0" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DepreciationAmortizationAndAccretionNet"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_97bccd42-c44a-4c1e-9262-cfa242a00a2e" xlink:to="loc_us-gaap_DepreciationAmortizationAndAccretionNet_72f175e7-ff0d-418a-b641-a55c1a1ed1e0" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccretionAmortizationOfDiscountsAndPremiumsInvestments_d33f3ea3-ecb8-440a-9de5-854c1c305bb0" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AccretionAmortizationOfDiscountsAndPremiumsInvestments"/>
    <link:calculationArc order="4" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_97bccd42-c44a-4c1e-9262-cfa242a00a2e" xlink:to="loc_us-gaap_AccretionAmortizationOfDiscountsAndPremiumsInvestments_d33f3ea3-ecb8-440a-9de5-854c1c305bb0" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AmortizationOfFinancingCostsAndDiscounts_a18f607a-a2f5-40bc-bc0b-1e71590e3ff8" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AmortizationOfFinancingCostsAndDiscounts"/>
    <link:calculationArc order="5" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_97bccd42-c44a-4c1e-9262-cfa242a00a2e" xlink:to="loc_us-gaap_AmortizationOfFinancingCostsAndDiscounts_a18f607a-a2f5-40bc-bc0b-1e71590e3ff8" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredIncomeTaxesAndTaxCredits_77f8ff15-4d52-411c-8a49-a3497d2b7f54" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DeferredIncomeTaxesAndTaxCredits"/>
    <link:calculationArc order="6" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_97bccd42-c44a-4c1e-9262-cfa242a00a2e" xlink:to="loc_us-gaap_DeferredIncomeTaxesAndTaxCredits_77f8ff15-4d52-411c-8a49-a3497d2b7f54" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensation_1dd26f6d-c85c-4ccd-ada1-85175c574381" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ShareBasedCompensation"/>
    <link:calculationArc order="7" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_97bccd42-c44a-4c1e-9262-cfa242a00a2e" xlink:to="loc_us-gaap_ShareBasedCompensation_1dd26f6d-c85c-4ccd-ada1-85175c574381" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInPremiumsReceivable_c8c36d63-b273-4217-8547-d398f945514f" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncreaseDecreaseInPremiumsReceivable"/>
    <link:calculationArc order="8" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_97bccd42-c44a-4c1e-9262-cfa242a00a2e" xlink:to="loc_us-gaap_IncreaseDecreaseInPremiumsReceivable_c8c36d63-b273-4217-8547-d398f945514f" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInAccruedInvestmentIncomeReceivable_6e1267ef-a2e8-4ce5-b6e8-ad48c5547a3f" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncreaseDecreaseInAccruedInvestmentIncomeReceivable"/>
    <link:calculationArc order="9" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_97bccd42-c44a-4c1e-9262-cfa242a00a2e" xlink:to="loc_us-gaap_IncreaseDecreaseInAccruedInvestmentIncomeReceivable_6e1267ef-a2e8-4ce5-b6e8-ad48c5547a3f" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInDeferredPolicyAcquisitionCosts_6e93668f-79e3-42ee-9815-b8c8540b4aaa" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncreaseDecreaseInDeferredPolicyAcquisitionCosts"/>
    <link:calculationArc order="10" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_97bccd42-c44a-4c1e-9262-cfa242a00a2e" xlink:to="loc_us-gaap_IncreaseDecreaseInDeferredPolicyAcquisitionCosts_6e93668f-79e3-42ee-9815-b8c8540b4aaa" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInReinsuranceRecoverable_29955651-86fe-435f-8e67-8ec4a8aeec0c" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncreaseDecreaseInReinsuranceRecoverable"/>
    <link:calculationArc order="11" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_97bccd42-c44a-4c1e-9262-cfa242a00a2e" xlink:to="loc_us-gaap_IncreaseDecreaseInReinsuranceRecoverable_29955651-86fe-435f-8e67-8ec4a8aeec0c" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInPrepaidDeferredExpenseAndOtherAssets_f5521659-78ee-42b6-ae33-3489e14bad63" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncreaseDecreaseInPrepaidDeferredExpenseAndOtherAssets"/>
    <link:calculationArc order="12" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_97bccd42-c44a-4c1e-9262-cfa242a00a2e" xlink:to="loc_us-gaap_IncreaseDecreaseInPrepaidDeferredExpenseAndOtherAssets_f5521659-78ee-42b6-ae33-3489e14bad63" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInUnearnedPremiums_c1319aec-bd13-4c85-8868-3e7fd2f598e9" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncreaseDecreaseInUnearnedPremiums"/>
    <link:calculationArc order="13" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_97bccd42-c44a-4c1e-9262-cfa242a00a2e" xlink:to="loc_us-gaap_IncreaseDecreaseInUnearnedPremiums_c1319aec-bd13-4c85-8868-3e7fd2f598e9" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInLiabilityForClaimsAndClaimsAdjustmentExpenseReserve_e0c1db08-9c18-429f-b3aa-0d6ac797dd8a" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncreaseDecreaseInLiabilityForClaimsAndClaimsAdjustmentExpenseReserve"/>
    <link:calculationArc order="14" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_97bccd42-c44a-4c1e-9262-cfa242a00a2e" xlink:to="loc_us-gaap_IncreaseDecreaseInLiabilityForClaimsAndClaimsAdjustmentExpenseReserve_e0c1db08-9c18-429f-b3aa-0d6ac797dd8a" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_nmih_IncreaseDecreaseinReinsuranceAssetsandLiabilities_1dc0a51a-e7d7-4a65-9d3b-a242ef331436" xlink:href="nmih-20240630.xsd#nmih_IncreaseDecreaseinReinsuranceAssetsandLiabilities"/>
    <link:calculationArc order="15" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_97bccd42-c44a-4c1e-9262-cfa242a00a2e" xlink:to="loc_nmih_IncreaseDecreaseinReinsuranceAssetsandLiabilities_1dc0a51a-e7d7-4a65-9d3b-a242ef331436" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInAccountsPayableAndAccruedLiabilities_3b9e62eb-4a15-4470-b2d0-bdc538ed6c9a" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_IncreaseDecreaseInAccountsPayableAndAccruedLiabilities"/>
    <link:calculationArc order="16" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_97bccd42-c44a-4c1e-9262-cfa242a00a2e" xlink:to="loc_us-gaap_IncreaseDecreaseInAccountsPayableAndAccruedLiabilities_3b9e62eb-4a15-4470-b2d0-bdc538ed6c9a" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_GainsLossesOnExtinguishmentOfDebt_63de033e-427b-46de-a1c3-7099c98ad589" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_GainsLossesOnExtinguishmentOfDebt"/>
    <link:calculationArc order="17" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_97bccd42-c44a-4c1e-9262-cfa242a00a2e" xlink:to="loc_us-gaap_GainsLossesOnExtinguishmentOfDebt_63de033e-427b-46de-a1c3-7099c98ad589" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_909813c1-f10b-41f1-9625-ac990ded997c" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_NetCashProvidedByUsedInFinancingActivities"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ProceedsFromIssuanceOfSharesUnderIncentiveAndShareBasedCompensationPlansIncludingStockOptions_83ec5566-947a-436a-b8fb-bc21705461e9" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ProceedsFromIssuanceOfSharesUnderIncentiveAndShareBasedCompensationPlansIncludingStockOptions"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_909813c1-f10b-41f1-9625-ac990ded997c" xlink:to="loc_us-gaap_ProceedsFromIssuanceOfSharesUnderIncentiveAndShareBasedCompensationPlansIncludingStockOptions_83ec5566-947a-436a-b8fb-bc21705461e9" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PaymentsRelatedToTaxWithholdingForShareBasedCompensation_da26180d-3482-4e55-87aa-b76c85615c86" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PaymentsRelatedToTaxWithholdingForShareBasedCompensation"/>
    <link:calculationArc order="2" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_909813c1-f10b-41f1-9625-ac990ded997c" xlink:to="loc_us-gaap_PaymentsRelatedToTaxWithholdingForShareBasedCompensation_da26180d-3482-4e55-87aa-b76c85615c86" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ProceedsFromIssuanceOfSeniorLongTermDebt_100a3d5f-2859-4d0f-bc1f-919fcf6b5bb5" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_ProceedsFromIssuanceOfSeniorLongTermDebt"/>
    <link:calculationArc order="3" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_909813c1-f10b-41f1-9625-ac990ded997c" xlink:to="loc_us-gaap_ProceedsFromIssuanceOfSeniorLongTermDebt_100a3d5f-2859-4d0f-bc1f-919fcf6b5bb5" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RepaymentsOfSeniorDebt_c8e1b8c9-f80e-4180-ab55-ff09194602a4" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_RepaymentsOfSeniorDebt"/>
    <link:calculationArc order="4" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_909813c1-f10b-41f1-9625-ac990ded997c" xlink:to="loc_us-gaap_RepaymentsOfSeniorDebt_c8e1b8c9-f80e-4180-ab55-ff09194602a4" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PaymentsOfDebtIssuanceCosts_4178c35a-9940-4d69-be43-2b0bd841420d" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PaymentsOfDebtIssuanceCosts"/>
    <link:calculationArc order="5" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_909813c1-f10b-41f1-9625-ac990ded997c" xlink:to="loc_us-gaap_PaymentsOfDebtIssuanceCosts_4178c35a-9940-4d69-be43-2b0bd841420d" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PaymentsForRepurchaseOfCommonStock_5d68456b-5204-4a64-a7a0-d601b1dbd3ae" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PaymentsForRepurchaseOfCommonStock"/>
    <link:calculationArc order="6" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_909813c1-f10b-41f1-9625-ac990ded997c" xlink:to="loc_us-gaap_PaymentsForRepurchaseOfCommonStock_5d68456b-5204-4a64-a7a0-d601b1dbd3ae" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetCashProvidedByUsedInInvestingActivities_d6c2297c-64ca-4c08-8f6d-f4460c076675" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_NetCashProvidedByUsedInInvestingActivities"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PaymentsToAcquireShortTermInvestments_5ac6b715-a137-4426-b500-0dfc84a076fc" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.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_d6c2297c-64ca-4c08-8f6d-f4460c076675" xlink:to="loc_us-gaap_PaymentsToAcquireShortTermInvestments_5ac6b715-a137-4426-b500-0dfc84a076fc" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PaymentsToAcquireAvailableForSaleSecuritiesDebt_9a7ec78f-e375-42f9-8182-e210f8ff6709" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.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_d6c2297c-64ca-4c08-8f6d-f4460c076675" xlink:to="loc_us-gaap_PaymentsToAcquireAvailableForSaleSecuritiesDebt_9a7ec78f-e375-42f9-8182-e210f8ff6709" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ProceedsFromSaleOfShortTermInvestments_4e0b20bf-8073-43a5-ad9c-d9238829248c" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.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_d6c2297c-64ca-4c08-8f6d-f4460c076675" xlink:to="loc_us-gaap_ProceedsFromSaleOfShortTermInvestments_4e0b20bf-8073-43a5-ad9c-d9238829248c" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ProceedsFromSaleAndMaturityOfAvailableForSaleSecurities_c89eeb3a-6e63-42c1-b24e-ab7b859a79f2" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.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_d6c2297c-64ca-4c08-8f6d-f4460c076675" xlink:to="loc_us-gaap_ProceedsFromSaleAndMaturityOfAvailableForSaleSecurities_c89eeb3a-6e63-42c1-b24e-ab7b859a79f2" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PaymentsToAcquirePropertyPlantAndEquipment_e246e7c3-64f4-485b-ab15-149543bf1709" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.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_d6c2297c-64ca-4c08-8f6d-f4460c076675" xlink:to="loc_us-gaap_PaymentsToAcquirePropertyPlantAndEquipment_e246e7c3-64f4-485b-ab15-149543bf1709" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.nationalmi.com/role/InvestmentsScheduleofFairValuesandGrossUnrealizedGainsandLossesDetails" xlink:type="simple" xlink:href="nmih-20240630.xsd#InvestmentsScheduleofFairValuesandGrossUnrealizedGainsandLossesDetails"/>
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/InvestmentsScheduleofFairValuesandGrossUnrealizedGainsandLossesDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleDebtSecuritiesAmortizedCostBasis_51bedb14-1fe1-48cd-8fc7-a3a1ff27bfba" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AvailableForSaleDebtSecuritiesAmortizedCostBasis"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedGainBeforeTax_bf519b0b-75f3-47f0-9c57-c817bf83b5ad" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedGainBeforeTax"/>
    <link:calculationArc order="1" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AvailableForSaleDebtSecuritiesAmortizedCostBasis_51bedb14-1fe1-48cd-8fc7-a3a1ff27bfba" xlink:to="loc_us-gaap_AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedGainBeforeTax_bf519b0b-75f3-47f0-9c57-c817bf83b5ad" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedLossBeforeTax_cadce1ae-764d-4599-9154-cda4d1f5e86f" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedLossBeforeTax"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AvailableForSaleDebtSecuritiesAmortizedCostBasis_51bedb14-1fe1-48cd-8fc7-a3a1ff27bfba" xlink:to="loc_us-gaap_AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedLossBeforeTax_cadce1ae-764d-4599-9154-cda4d1f5e86f" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtSecurities_7e1cf071-5035-40ce-b567-5f0c8259c9aa" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.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_51bedb14-1fe1-48cd-8fc7-a3a1ff27bfba" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtSecurities_7e1cf071-5035-40ce-b567-5f0c8259c9aa" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.nationalmi.com/role/InvestmentsScheduleofInvestmentsbyMaturityDetails" xlink:type="simple" xlink:href="nmih-20240630.xsd#InvestmentsScheduleofInvestmentsbyMaturityDetails"/>
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/InvestmentsScheduleofInvestmentsbyMaturityDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtSecurities_d5d1d21e-c2ce-4954-8da9-90d19949682e" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AvailableForSaleSecuritiesDebtSecurities"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesNextRollingTwelveMonthsFairValue_148d91dc-7bbc-4255-a07f-9b65152dea8d" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.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_d5d1d21e-c2ce-4954-8da9-90d19949682e" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesNextRollingTwelveMonthsFairValue_148d91dc-7bbc-4255-a07f-9b65152dea8d" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesRollingYearTwoThroughFiveFairValue_fd099da1-796a-4352-99c0-e6ca5afa09ad" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.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_d5d1d21e-c2ce-4954-8da9-90d19949682e" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesRollingYearTwoThroughFiveFairValue_fd099da1-796a-4352-99c0-e6ca5afa09ad" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesRollingYearSixThroughTenFairValue_b419065d-3cf9-4df7-acf6-de6ea981f981" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.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_d5d1d21e-c2ce-4954-8da9-90d19949682e" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesRollingYearSixThroughTenFairValue_b419065d-3cf9-4df7-acf6-de6ea981f981" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesRollingAfterYearTenFairValue_e1b74061-b074-42db-ba00-ddcc9e80fef1" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.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_d5d1d21e-c2ce-4954-8da9-90d19949682e" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesRollingAfterYearTenFairValue_e1b74061-b074-42db-ba00-ddcc9e80fef1" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesWithoutSingleMaturityDateFairValue_c916ece3-1849-4607-8df7-bb1b360fb6a0" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.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_d5d1d21e-c2ce-4954-8da9-90d19949682e" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesWithoutSingleMaturityDateFairValue_c916ece3-1849-4607-8df7-bb1b360fb6a0" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleDebtSecuritiesAmortizedCostBasis_e627a889-9801-480a-a5f2-60e7aaf5aa73" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AvailableForSaleDebtSecuritiesAmortizedCostBasis"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesNextRollingTwelveMonthsAmortizedCostBasis_a89cfa92-45ee-4ebf-936f-38a58c150d4b" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.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_e627a889-9801-480a-a5f2-60e7aaf5aa73" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesNextRollingTwelveMonthsAmortizedCostBasis_a89cfa92-45ee-4ebf-936f-38a58c150d4b" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesRollingYearTwoThroughFiveAmortizedCostBasis_67cc86ce-5e37-4233-946a-639db5cc8482" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.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_e627a889-9801-480a-a5f2-60e7aaf5aa73" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesRollingYearTwoThroughFiveAmortizedCostBasis_67cc86ce-5e37-4233-946a-639db5cc8482" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesRollingYearSixThroughTenAmortizedCostBasis_4016743b-05c3-4e7f-a6da-3bae858d83cd" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.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_e627a889-9801-480a-a5f2-60e7aaf5aa73" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesRollingYearSixThroughTenAmortizedCostBasis_4016743b-05c3-4e7f-a6da-3bae858d83cd" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesRollingAfterYearTenAmortizedCostBasis_db441796-ca11-483e-af71-f3ce7a64b883" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.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_e627a889-9801-480a-a5f2-60e7aaf5aa73" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesRollingAfterYearTenAmortizedCostBasis_db441796-ca11-483e-af71-f3ce7a64b883" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesWithoutSingleMaturityDateAmortizedCost_a4ab925f-8189-4a88-aed7-0f88aabcd302" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.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_e627a889-9801-480a-a5f2-60e7aaf5aa73" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesWithoutSingleMaturityDateAmortizedCost_a4ab925f-8189-4a88-aed7-0f88aabcd302" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.nationalmi.com/role/InvestmentsScheduleofAgingofUnrealizedLossesDetails" xlink:type="simple" xlink:href="nmih-20240630.xsd#InvestmentsScheduleofAgingofUnrealizedLossesDetails"/>
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/InvestmentsScheduleofAgingofUnrealizedLossesDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPositionAccumulatedLoss_0d9367dc-55bb-475a-84bb-3389602f0f9e" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPositionAccumulatedLoss"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionLessThan12MonthsAccumulatedLoss_802e4fef-940b-4045-93f8-2127e03ef048" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.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_0d9367dc-55bb-475a-84bb-3389602f0f9e" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionLessThan12MonthsAccumulatedLoss_802e4fef-940b-4045-93f8-2127e03ef048" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLongerAccumulatedLoss_a2724738-ff95-4f3f-94de-e6affd789d14" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.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_0d9367dc-55bb-475a-84bb-3389602f0f9e" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLongerAccumulatedLoss_a2724738-ff95-4f3f-94de-e6affd789d14" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPositionNumberOfPositions_9a0fd6bd-ce95-4b29-bff1-7d4f849174ac" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPositionNumberOfPositions"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionLessThan12MonthsNumberOfPositions_0f21bfd8-b645-470f-83cd-e5c91a522348" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionLessThan12MonthsNumberOfPositions"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPositionNumberOfPositions_9a0fd6bd-ce95-4b29-bff1-7d4f849174ac" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionLessThan12MonthsNumberOfPositions_0f21bfd8-b645-470f-83cd-e5c91a522348" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLongerNumberOfPositions_b9ba03ea-d666-4a4b-ac7a-b6666e659c0f" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLongerNumberOfPositions"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPositionNumberOfPositions_9a0fd6bd-ce95-4b29-bff1-7d4f849174ac" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLongerNumberOfPositions_b9ba03ea-d666-4a4b-ac7a-b6666e659c0f" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPosition_2a396610-bccc-47f6-a90f-fc129a9e2943" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPosition"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionLessThan12Months_f75773c7-47dd-4a8e-bf6a-5126f3b6aac8" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.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_2a396610-bccc-47f6-a90f-fc129a9e2943" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionLessThan12Months_f75773c7-47dd-4a8e-bf6a-5126f3b6aac8" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLonger_ef03eca9-8e01-4159-94a4-804b90309a96" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.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_2a396610-bccc-47f6-a90f-fc129a9e2943" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLonger_ef03eca9-8e01-4159-94a4-804b90309a96" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.nationalmi.com/role/InvestmentsScheduleofNetInvestmentIncomeDetails" xlink:type="simple" xlink:href="nmih-20240630.xsd#InvestmentsScheduleofNetInvestmentIncomeDetails"/>
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/InvestmentsScheduleofNetInvestmentIncomeDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InvestmentIncomeNet_b971c634-d0cc-4b5c-84b4-c731f010a707" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_InvestmentIncomeNet"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InvestmentIncomeInterestAndDividend_f6a28740-8ff5-4c76-9976-ba094729ff31" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_InvestmentIncomeInterestAndDividend"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_InvestmentIncomeNet_b971c634-d0cc-4b5c-84b4-c731f010a707" xlink:to="loc_us-gaap_InvestmentIncomeInterestAndDividend_f6a28740-8ff5-4c76-9976-ba094729ff31" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InvestmentIncomeInvestmentExpense_346a0602-d621-4f84-9f52-6e03f8291848" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_InvestmentIncomeInvestmentExpense"/>
    <link:calculationArc order="2" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_InvestmentIncomeNet_b971c634-d0cc-4b5c-84b4-c731f010a707" xlink:to="loc_us-gaap_InvestmentIncomeInvestmentExpense_346a0602-d621-4f84-9f52-6e03f8291848" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.nationalmi.com/role/InvestmentsScheduleofNetRealizedInvestmentLossesDetails" xlink:type="simple" xlink:href="nmih-20240630.xsd#InvestmentsScheduleofNetRealizedInvestmentLossesDetails"/>
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/InvestmentsScheduleofNetRealizedInvestmentLossesDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleRealizedGainLoss_2d09f0cd-c23f-4430-82e6-ce190bf22fc9" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_DebtSecuritiesAvailableForSaleRealizedGainLoss"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleRealizedGain_36d8091d-6c2f-4eed-8617-522dc4234a17" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.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_2d09f0cd-c23f-4430-82e6-ce190bf22fc9" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleRealizedGain_36d8091d-6c2f-4eed-8617-522dc4234a17" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleRealizedLoss_f323507e-eb92-47c2-951a-7b167dc2afe0" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.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_2d09f0cd-c23f-4430-82e6-ce190bf22fc9" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleRealizedLoss_f323507e-eb92-47c2-951a-7b167dc2afe0" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.nationalmi.com/role/FairValueofFinancialInstrumentsScheduleofFairValueMeasurementsofFinancialInstrumentsDetails" xlink:type="simple" xlink:href="nmih-20240630.xsd#FairValueofFinancialInstrumentsScheduleofFairValueMeasurementsofFinancialInstrumentsDetails"/>
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/FairValueofFinancialInstrumentsScheduleofFairValueMeasurementsofFinancialInstrumentsDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AssetsFairValueDisclosure_74a712ea-196f-4b45-a8b1-29bf5e2fec1d" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_AssetsFairValueDisclosure"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtSecurities_fcc8cc74-17be-4dc1-baae-653940691034" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.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_74a712ea-196f-4b45-a8b1-29bf5e2fec1d" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtSecurities_fcc8cc74-17be-4dc1-baae-653940691034" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CashAndCashEquivalentsFairValueDisclosure_81eba2bd-b04a-4079-a2e1-6171c34e3315" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.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_74a712ea-196f-4b45-a8b1-29bf5e2fec1d" xlink:to="loc_us-gaap_CashAndCashEquivalentsFairValueDisclosure_81eba2bd-b04a-4079-a2e1-6171c34e3315" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.nationalmi.com/role/ReinsuranceScheduleofEffectofReinsuranceAgreementsonPremiumsWrittenandEarnedDetails" xlink:type="simple" xlink:href="nmih-20240630.xsd#ReinsuranceScheduleofEffectofReinsuranceAgreementsonPremiumsWrittenandEarnedDetails"/>
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/ReinsuranceScheduleofEffectofReinsuranceAgreementsonPremiumsWrittenandEarnedDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PremiumsWrittenNet_c332424e-b607-441a-a4d7-2b40696ca121" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PremiumsWrittenNet"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DirectPremiumsWritten_e567e9c5-05f9-4ef5-8471-b2fadae725c6" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.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_c332424e-b607-441a-a4d7-2b40696ca121" xlink:to="loc_us-gaap_DirectPremiumsWritten_e567e9c5-05f9-4ef5-8471-b2fadae725c6" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CededPremiumsWritten_52e71ed0-09c8-4a70-a332-a15e320a9b52" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.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_c332424e-b607-441a-a4d7-2b40696ca121" xlink:to="loc_us-gaap_CededPremiumsWritten_52e71ed0-09c8-4a70-a332-a15e320a9b52" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PremiumsEarnedNet_8342f19f-1f9c-408d-8ca7-f4659d7ad78a" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PremiumsEarnedNet"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DirectPremiumsEarned_8db3449d-7abd-44b2-9c88-1f40856a0163" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.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_8342f19f-1f9c-408d-8ca7-f4659d7ad78a" xlink:to="loc_us-gaap_DirectPremiumsEarned_8db3449d-7abd-44b2-9c88-1f40856a0163" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CededPremiumsEarned_848214d8-6977-4af8-9bd1-3067b3e06cda" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.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_8342f19f-1f9c-408d-8ca7-f4659d7ad78a" xlink:to="loc_us-gaap_CededPremiumsEarned_848214d8-6977-4af8-9bd1-3067b3e06cda" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.nationalmi.com/role/ReservesforInsuranceClaimsandClaimExpensesReconciliationofReserveBalancesforInsuranceClaimsandClaimExpenseDetails" xlink:type="simple" xlink:href="nmih-20240630.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_77f0a4c6-1ae3-4061-a7fb-6ed6cf4ee7a3" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LiabilityForUnpaidClaimsAndClaimsAdjustmentExpenseNet"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LiabilityForClaimsAndClaimsAdjustmentExpense_e2ac8a14-d7be-4583-aff4-d79ab99018b7" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.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_77f0a4c6-1ae3-4061-a7fb-6ed6cf4ee7a3" xlink:to="loc_us-gaap_LiabilityForClaimsAndClaimsAdjustmentExpense_e2ac8a14-d7be-4583-aff4-d79ab99018b7" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ReinsuranceRecoverablesOnPaidAndUnpaidLosses_f8a9936e-9ea9-4c3e-a28b-8e8477f6e5a5" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.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_77f0a4c6-1ae3-4061-a7fb-6ed6cf4ee7a3" xlink:to="loc_us-gaap_ReinsuranceRecoverablesOnPaidAndUnpaidLosses_f8a9936e-9ea9-4c3e-a28b-8e8477f6e5a5" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PaymentsForLossesAndLossAdjustmentExpense_33f6c7bf-6b46-4a1e-b0f9-b3e3f48fdaea" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_PaymentsForLossesAndLossAdjustmentExpense"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LiabilityForUnpaidClaimsAndClaimsAdjustmentExpenseClaimsPaidCurrentYear1_158274f8-4dd2-41a3-8b24-d35254dfdedb" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.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_33f6c7bf-6b46-4a1e-b0f9-b3e3f48fdaea" xlink:to="loc_us-gaap_LiabilityForUnpaidClaimsAndClaimsAdjustmentExpenseClaimsPaidCurrentYear1_158274f8-4dd2-41a3-8b24-d35254dfdedb" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LiabilityForUnpaidClaimsAndClaimsAdjustmentExpenseClaimsPaidPriorYears1_d26a8179-497b-40e7-83ef-896b92c4a1f4" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.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_33f6c7bf-6b46-4a1e-b0f9-b3e3f48fdaea" xlink:to="loc_us-gaap_LiabilityForUnpaidClaimsAndClaimsAdjustmentExpenseClaimsPaidPriorYears1_d26a8179-497b-40e7-83ef-896b92c4a1f4" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LiabilityForUnpaidClaimsAndClaimsAdjustmentExpenseIncurredClaims1_1b4c51d2-ed77-42c3-8995-26a799fa7996" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_LiabilityForUnpaidClaimsAndClaimsAdjustmentExpenseIncurredClaims1"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SupplementalInformationForPropertyCasualtyInsuranceUnderwritersCurrentYearClaimsAndClaimsAdjustmentExpense_25a79010-4982-4c6b-9649-10a1b269e120" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.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_1b4c51d2-ed77-42c3-8995-26a799fa7996" xlink:to="loc_us-gaap_SupplementalInformationForPropertyCasualtyInsuranceUnderwritersCurrentYearClaimsAndClaimsAdjustmentExpense_25a79010-4982-4c6b-9649-10a1b269e120" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SupplementalInformationForPropertyCasualtyInsuranceUnderwritersPriorYearClaimsAndClaimsAdjustmentExpense_05f231a7-bdf8-41e2-b3af-cf3fe3de55eb" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.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_1b4c51d2-ed77-42c3-8995-26a799fa7996" xlink:to="loc_us-gaap_SupplementalInformationForPropertyCasualtyInsuranceUnderwritersPriorYearClaimsAndClaimsAdjustmentExpense_05f231a7-bdf8-41e2-b3af-cf3fe3de55eb" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.nationalmi.com/role/EarningsperShareEPSScheduleofEarningsPerShareBasicandDilutedDetails" xlink:type="simple" xlink:href="nmih-20240630.xsd#EarningsperShareEPSScheduleofEarningsPerShareBasicandDilutedDetails"/>
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/EarningsperShareEPSScheduleofEarningsPerShareBasicandDilutedDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_WeightedAverageNumberOfDilutedSharesOutstanding_00f81952-f926-4922-a4cd-ef50ad2b43eb" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_WeightedAverageNumberOfDilutedSharesOutstanding"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_WeightedAverageNumberOfSharesOutstandingBasic_872aac84-9523-49fa-a1ea-b1dd38dea1c7" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.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_00f81952-f926-4922-a4cd-ef50ad2b43eb" xlink:to="loc_us-gaap_WeightedAverageNumberOfSharesOutstandingBasic_872aac84-9523-49fa-a1ea-b1dd38dea1c7" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_WeightedAverageNumberDilutedSharesOutstandingAdjustment_f23c0679-c25e-49df-93e1-98f171e2a83d" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.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_00f81952-f926-4922-a4cd-ef50ad2b43eb" xlink:to="loc_us-gaap_WeightedAverageNumberDilutedSharesOutstandingAdjustment_f23c0679-c25e-49df-93e1-98f171e2a83d" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.nationalmi.com/role/RegulatoryInformationScheduleofStatutoryNetIncomelossSurplusContingencyReserveandRisktoCapitalRatioDetails" xlink:type="simple" xlink:href="nmih-20240630.xsd#RegulatoryInformationScheduleofStatutoryNetIncomelossSurplusContingencyReserveandRisktoCapitalRatioDetails"/>
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/RegulatoryInformationScheduleofStatutoryNetIncomelossSurplusContingencyReserveandRisktoCapitalRatioDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_nmih_StatutoryAccountingPracticesStatutoryCapitalAndSurplusIncludingContingencyReserve_8f7ce256-d6d5-4f2a-981e-593eb60d5724" xlink:href="nmih-20240630.xsd#nmih_StatutoryAccountingPracticesStatutoryCapitalAndSurplusIncludingContingencyReserve"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatutoryAccountingPracticesStatutoryCapitalAndSurplusBalance_0539c643-8725-4ede-8524-69b515f8b7b5" xlink:href="https://xbrl.fasb.org/us-gaap/2024/elts/us-gaap-2024.xsd#us-gaap_StatutoryAccountingPracticesStatutoryCapitalAndSurplusBalance"/>
    <link:calculationArc order="1" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_nmih_StatutoryAccountingPracticesStatutoryCapitalAndSurplusIncludingContingencyReserve_8f7ce256-d6d5-4f2a-981e-593eb60d5724" xlink:to="loc_us-gaap_StatutoryAccountingPracticesStatutoryCapitalAndSurplusBalance_0539c643-8725-4ede-8524-69b515f8b7b5" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_nmih_StatutoryAccountingPracticesContingencyReserve_f34b5d71-f28e-4c8e-a395-cdbcdbbd08fd" xlink:href="nmih-20240630.xsd#nmih_StatutoryAccountingPracticesContingencyReserve"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_nmih_StatutoryAccountingPracticesStatutoryCapitalAndSurplusIncludingContingencyReserve_8f7ce256-d6d5-4f2a-981e-593eb60d5724" xlink:to="loc_nmih_StatutoryAccountingPracticesContingencyReserve_f34b5d71-f28e-4c8e-a395-cdbcdbbd08fd" xlink:type="arc"/>
  </link:calculationLink>
</link:linkbase>
