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

<!--XBRL Document Created with Wdesk from Workiva-->
<!--Copyright 2023 Workiva-->
<!--r:79c103f6-4e99-4c43-a68c-08839c37bace,g:faa22020-3e9e-4dcf-8cc7-c3c7117692da-->
<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-20230331.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_LiabilitiesAndStockholdersEquity_0e00f12f-f132-4d2e-9925-a0ef62cd858a" 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_5c2180c2-47c1-4944-9f4f-1aec2bc3e643" 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_0e00f12f-f132-4d2e-9925-a0ef62cd858a" xlink:to="loc_us-gaap_Liabilities_5c2180c2-47c1-4944-9f4f-1aec2bc3e643" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CommitmentsAndContingencies_a7039773-285b-4555-aab9-b7857e8068fb" 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_0e00f12f-f132-4d2e-9925-a0ef62cd858a" xlink:to="loc_us-gaap_CommitmentsAndContingencies_a7039773-285b-4555-aab9-b7857e8068fb" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockholdersEquity_4e2d0158-fba6-4f8d-b229-edfc109438bf" 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_0e00f12f-f132-4d2e-9925-a0ef62cd858a" xlink:to="loc_us-gaap_StockholdersEquity_4e2d0158-fba6-4f8d-b229-edfc109438bf" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StockholdersEquity_47155f67-7e4e-4583-b989-d68e9699de8a" 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_cea61330-f86b-4a34-8f62-191bbd92f22f" 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_47155f67-7e4e-4583-b989-d68e9699de8a" xlink:to="loc_us-gaap_CommonStockValueOutstanding_cea61330-f86b-4a34-8f62-191bbd92f22f" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AdditionalPaidInCapital_b6d6f36f-f6ce-4cf7-b1f7-3e2552bf1a7d" 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_47155f67-7e4e-4583-b989-d68e9699de8a" xlink:to="loc_us-gaap_AdditionalPaidInCapital_b6d6f36f-f6ce-4cf7-b1f7-3e2552bf1a7d" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_TreasuryStockCommonValue_4d4543d1-b7e8-41f8-8e67-2af1859cb11c" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_47155f67-7e4e-4583-b989-d68e9699de8a" xlink:to="loc_us-gaap_TreasuryStockCommonValue_4d4543d1-b7e8-41f8-8e67-2af1859cb11c" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccumulatedOtherComprehensiveIncomeLossNetOfTax_8a2faca6-4a82-4144-b378-365eb2fd09ef" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_47155f67-7e4e-4583-b989-d68e9699de8a" xlink:to="loc_us-gaap_AccumulatedOtherComprehensiveIncomeLossNetOfTax_8a2faca6-4a82-4144-b378-365eb2fd09ef" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_RetainedEarningsAccumulatedDeficit_f97cc77a-ac96-4fca-86a6-95ade822cf76" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_47155f67-7e4e-4583-b989-d68e9699de8a" xlink:to="loc_us-gaap_RetainedEarningsAccumulatedDeficit_f97cc77a-ac96-4fca-86a6-95ade822cf76" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Liabilities_5910b87d-e51c-4dc9-8e16-b15bee62fb7e" 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_SecuredDebt_662045d8-70a5-465a-8fbd-7f6437c313ee" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_5910b87d-e51c-4dc9-8e16-b15bee62fb7e" xlink:to="loc_us-gaap_SecuredDebt_662045d8-70a5-465a-8fbd-7f6437c313ee" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_UnearnedPremiums_8e7924f8-9ef2-4e36-93b8-65a315ec14b6" 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_5910b87d-e51c-4dc9-8e16-b15bee62fb7e" xlink:to="loc_us-gaap_UnearnedPremiums_8e7924f8-9ef2-4e36-93b8-65a315ec14b6" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccountsPayableAndAccruedLiabilitiesCurrentAndNoncurrent_9048a894-f6f0-4ac5-bfee-eead98e809af" 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_5910b87d-e51c-4dc9-8e16-b15bee62fb7e" xlink:to="loc_us-gaap_AccountsPayableAndAccruedLiabilitiesCurrentAndNoncurrent_9048a894-f6f0-4ac5-bfee-eead98e809af" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LiabilityForClaimsAndClaimsAdjustmentExpense_87610490-ae81-4a5c-b6d7-6d6a7430f24c" 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_5910b87d-e51c-4dc9-8e16-b15bee62fb7e" xlink:to="loc_us-gaap_LiabilityForClaimsAndClaimsAdjustmentExpense_87610490-ae81-4a5c-b6d7-6d6a7430f24c" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_FundsHeldUnderReinsuranceAgreementsLiability_52a472e4-8803-4f85-ac7a-aa33be6df9d5" 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_5910b87d-e51c-4dc9-8e16-b15bee62fb7e" xlink:to="loc_us-gaap_FundsHeldUnderReinsuranceAgreementsLiability_52a472e4-8803-4f85-ac7a-aa33be6df9d5" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredIncomeTaxLiabilitiesNet_e9cbb82b-48e1-45d5-a1df-f61e09ab1322" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_DeferredIncomeTaxLiabilitiesNet"/>
    <link:calculationArc order="6" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Liabilities_5910b87d-e51c-4dc9-8e16-b15bee62fb7e" xlink:to="loc_us-gaap_DeferredIncomeTaxLiabilitiesNet_e9cbb82b-48e1-45d5-a1df-f61e09ab1322" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherLiabilities_32135cef-39b8-4e4e-90ed-296cda0bd80e" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_OtherLiabilities"/>
    <link:calculationArc order="7" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Liabilities_5910b87d-e51c-4dc9-8e16-b15bee62fb7e" xlink:to="loc_us-gaap_OtherLiabilities_32135cef-39b8-4e4e-90ed-296cda0bd80e" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Assets_b99da4d4-f4f4-4392-81f9-d7dfc49f7613" 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_a184c9fd-410a-4a28-8bc4-408d25e3d47f" 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_b99da4d4-f4f4-4392-81f9-d7dfc49f7613" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtSecurities_a184c9fd-410a-4a28-8bc4-408d25e3d47f" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents_4829a3b7-5ef2-4640-8ba4-8aef7b2f44f5" 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_b99da4d4-f4f4-4392-81f9-d7dfc49f7613" xlink:to="loc_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents_4829a3b7-5ef2-4640-8ba4-8aef7b2f44f5" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PremiumsReceivableAtCarryingValue_ef5d7eeb-b96b-4ea8-99c6-4f6e65d3db47" 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_b99da4d4-f4f4-4392-81f9-d7dfc49f7613" xlink:to="loc_us-gaap_PremiumsReceivableAtCarryingValue_ef5d7eeb-b96b-4ea8-99c6-4f6e65d3db47" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccruedInvestmentIncomeReceivable_eb69408a-2ec4-4882-91a5-5754ad74f184" 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_b99da4d4-f4f4-4392-81f9-d7dfc49f7613" xlink:to="loc_us-gaap_AccruedInvestmentIncomeReceivable_eb69408a-2ec4-4882-91a5-5754ad74f184" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredPolicyAcquisitionCosts_ff10b558-8f33-4b1d-bc86-696c256e659b" 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_b99da4d4-f4f4-4392-81f9-d7dfc49f7613" xlink:to="loc_us-gaap_DeferredPolicyAcquisitionCosts_ff10b558-8f33-4b1d-bc86-696c256e659b" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PropertyPlantAndEquipmentNet_1a692848-05a2-463f-9d3e-5b1529c21d82" 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_b99da4d4-f4f4-4392-81f9-d7dfc49f7613" xlink:to="loc_us-gaap_PropertyPlantAndEquipmentNet_1a692848-05a2-463f-9d3e-5b1529c21d82" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IntangibleAssetsNetIncludingGoodwill_9bf1c0ac-130c-4e3f-ab15-dc178f9f7e20" 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_b99da4d4-f4f4-4392-81f9-d7dfc49f7613" xlink:to="loc_us-gaap_IntangibleAssetsNetIncludingGoodwill_9bf1c0ac-130c-4e3f-ab15-dc178f9f7e20" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ReinsuranceRecoverablesGross_d3d9cb03-73e8-4951-9d04-f75466049886" 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_b99da4d4-f4f4-4392-81f9-d7dfc49f7613" xlink:to="loc_us-gaap_ReinsuranceRecoverablesGross_d3d9cb03-73e8-4951-9d04-f75466049886" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_nmih_PrepaidFederalIncomeTaxes_96c1eab3-0ceb-4562-a6b3-75c7866b9ade" xlink:href="nmih-20230331.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_b99da4d4-f4f4-4392-81f9-d7dfc49f7613" xlink:to="loc_nmih_PrepaidFederalIncomeTaxes_96c1eab3-0ceb-4562-a6b3-75c7866b9ade" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherAssets_084065c2-6a35-461f-beda-acfe87db2c71" 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_b99da4d4-f4f4-4392-81f9-d7dfc49f7613" xlink:to="loc_us-gaap_OtherAssets_084065c2-6a35-461f-beda-acfe87db2c71" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.nationalmi.com/role/CONDENSEDCONSOLIDATEDSTATEMENTSOFOPERATIONSANDCOMPREHENSIVEINCOMELOSSUNAUDITED" xlink:type="simple" xlink:href="nmih-20230331.xsd#CONDENSEDCONSOLIDATEDSTATEMENTSOFOPERATIONSANDCOMPREHENSIVEINCOMELOSSUNAUDITED"/>
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/CONDENSEDCONSOLIDATEDSTATEMENTSOFOPERATIONSANDCOMPREHENSIVEINCOMELOSSUNAUDITED" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent_0a935f00-a1ef-449e-80e5-be2839f1805a" 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_70590222-48fa-416f-9ee8-5bcd27b0ab62" 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_0a935f00-a1ef-449e-80e5-be2839f1805a" xlink:to="loc_us-gaap_OtherComprehensiveIncomeUnrealizedHoldingGainLossOnSecuritiesArisingDuringPeriodNetOfTax_70590222-48fa-416f-9ee8-5bcd27b0ab62" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherComprehensiveIncomeLossReclassificationAdjustmentFromAOCIForSaleOfSecuritiesNetOfTax_f5ff1403-2a3d-41ec-861f-a67016b50042" 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_0a935f00-a1ef-449e-80e5-be2839f1805a" xlink:to="loc_us-gaap_OtherComprehensiveIncomeLossReclassificationAdjustmentFromAOCIForSaleOfSecuritiesNetOfTax_f5ff1403-2a3d-41ec-861f-a67016b50042" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetIncomeLoss_3b252ef9-51a5-488f-a3a3-ff722b3e325f" 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_c05a0eb7-e862-4dd5-98cb-eab325c25b09" 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_3b252ef9-51a5-488f-a3a3-ff722b3e325f" xlink:to="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest_c05a0eb7-e862-4dd5-98cb-eab325c25b09" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeTaxExpenseBenefit_449d22b0-7878-4e55-ac96-abc2b98af49c" 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_3b252ef9-51a5-488f-a3a3-ff722b3e325f" xlink:to="loc_us-gaap_IncomeTaxExpenseBenefit_449d22b0-7878-4e55-ac96-abc2b98af49c" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_Revenues_9685208d-0095-4e1b-a51d-988b02036ab0" 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_3cac2c34-11dc-4a66-b954-ea5d4729dcd6" 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_9685208d-0095-4e1b-a51d-988b02036ab0" xlink:to="loc_us-gaap_PremiumsEarnedNet_3cac2c34-11dc-4a66-b954-ea5d4729dcd6" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetInvestmentIncome_c467f672-b2c5-4b7b-9a29-22620388c887" 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_9685208d-0095-4e1b-a51d-988b02036ab0" xlink:to="loc_us-gaap_NetInvestmentIncome_c467f672-b2c5-4b7b-9a29-22620388c887" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_GainLossOnInvestments_0c415879-023c-4f70-b929-c55759b924d5" 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_9685208d-0095-4e1b-a51d-988b02036ab0" xlink:to="loc_us-gaap_GainLossOnInvestments_0c415879-023c-4f70-b929-c55759b924d5" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherIncome_9ecc9b98-233d-47d9-b8ac-a0199341e818" 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_9685208d-0095-4e1b-a51d-988b02036ab0" xlink:to="loc_us-gaap_OtherIncome_9ecc9b98-233d-47d9-b8ac-a0199341e818" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CostsAndExpenses_0712d321-1cbd-427d-b2c2-415cab006feb" 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_PolicyholderBenefitsAndClaimsIncurredNet_df4deb4e-b20d-4b19-9d53-11bdc1393114" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_0712d321-1cbd-427d-b2c2-415cab006feb" xlink:to="loc_us-gaap_PolicyholderBenefitsAndClaimsIncurredNet_df4deb4e-b20d-4b19-9d53-11bdc1393114" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherCostAndExpenseOperating_10a5e90c-c03e-4dae-8b8b-8b7093975300" 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_0712d321-1cbd-427d-b2c2-415cab006feb" xlink:to="loc_us-gaap_OtherCostAndExpenseOperating_10a5e90c-c03e-4dae-8b8b-8b7093975300" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherNonoperatingExpense_bb351421-6b7f-4775-b26c-bc9392d5c04e" 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_0712d321-1cbd-427d-b2c2-415cab006feb" xlink:to="loc_us-gaap_OtherNonoperatingExpense_bb351421-6b7f-4775-b26c-bc9392d5c04e" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InterestExpense_eb59f9d9-de45-43d0-b5cf-b8228e0c317b" 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_0712d321-1cbd-427d-b2c2-415cab006feb" xlink:to="loc_us-gaap_InterestExpense_eb59f9d9-de45-43d0-b5cf-b8228e0c317b" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_nmih_GainLossonChangeinFairValueofWarrantLiability_3cc361e8-87bf-4327-8758-d4376faff651" xlink:href="nmih-20230331.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_0712d321-1cbd-427d-b2c2-415cab006feb" xlink:to="loc_nmih_GainLossonChangeinFairValueofWarrantLiability_3cc361e8-87bf-4327-8758-d4376faff651" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ComprehensiveIncomeNetOfTax_aa3b9379-5544-469a-8640-94928976fa1e" 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_0890c0d9-02c2-4ae3-88f2-30df05d7eaee" 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_aa3b9379-5544-469a-8640-94928976fa1e" xlink:to="loc_us-gaap_NetIncomeLoss_0890c0d9-02c2-4ae3-88f2-30df05d7eaee" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent_7de8706c-2a46-4626-aef2-d69681c47818" 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_aa3b9379-5544-469a-8640-94928976fa1e" xlink:to="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent_7de8706c-2a46-4626-aef2-d69681c47818" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest_2c94fe1d-79d0-4d5c-ba3f-c349483df63f" 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_66062743-6bd5-4ae7-a5c7-7b6d7234e1a3" 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_2c94fe1d-79d0-4d5c-ba3f-c349483df63f" xlink:to="loc_us-gaap_Revenues_66062743-6bd5-4ae7-a5c7-7b6d7234e1a3" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CostsAndExpenses_cc8ded4a-77b6-4607-857b-1353406c202e" 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_2c94fe1d-79d0-4d5c-ba3f-c349483df63f" xlink:to="loc_us-gaap_CostsAndExpenses_cc8ded4a-77b6-4607-857b-1353406c202e" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.nationalmi.com/role/CONDENSEDCONSOLIDATEDSTATEMENTSOFCASHFLOWSUNAUDITED" xlink:type="simple" xlink:href="nmih-20230331.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_NetCashProvidedByUsedInFinancingActivities_fc563428-c60d-49ef-a252-92d430220106" 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_ProceedsFromIssuanceOfSharesUnderIncentiveAndShareBasedCompensationPlansIncludingStockOptions_71f3988e-5556-40f6-bc5e-1ae053badfec" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_fc563428-c60d-49ef-a252-92d430220106" xlink:to="loc_us-gaap_ProceedsFromIssuanceOfSharesUnderIncentiveAndShareBasedCompensationPlansIncludingStockOptions_71f3988e-5556-40f6-bc5e-1ae053badfec" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ProceedsFromWarrantExercises_0996497b-b949-41d0-8cbd-8e3d25eecaff" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_ProceedsFromWarrantExercises"/>
    <link:calculationArc order="2" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_fc563428-c60d-49ef-a252-92d430220106" xlink:to="loc_us-gaap_ProceedsFromWarrantExercises_0996497b-b949-41d0-8cbd-8e3d25eecaff" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PaymentsRelatedToTaxWithholdingForShareBasedCompensation_69b0b1e1-4553-4ffd-b5b0-70896ec5716c" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_PaymentsRelatedToTaxWithholdingForShareBasedCompensation"/>
    <link:calculationArc order="3" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_fc563428-c60d-49ef-a252-92d430220106" xlink:to="loc_us-gaap_PaymentsRelatedToTaxWithholdingForShareBasedCompensation_69b0b1e1-4553-4ffd-b5b0-70896ec5716c" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PaymentsForRepurchaseOfCommonStock_6580be57-5991-4e88-9b53-d5122c751a48" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_PaymentsForRepurchaseOfCommonStock"/>
    <link:calculationArc order="4" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_fc563428-c60d-49ef-a252-92d430220106" xlink:to="loc_us-gaap_PaymentsForRepurchaseOfCommonStock_6580be57-5991-4e88-9b53-d5122c751a48" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetCashProvidedByUsedInInvestingActivities_b213c6e1-7e88-48a8-b8fc-90370043be23" 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_2134c32a-b595-493f-813b-7f22bec41e29" 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_b213c6e1-7e88-48a8-b8fc-90370043be23" xlink:to="loc_us-gaap_PaymentsToAcquireShortTermInvestments_2134c32a-b595-493f-813b-7f22bec41e29" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PaymentsToAcquireAvailableForSaleSecuritiesDebt_f0611393-5d0c-4ab2-ad79-7b809889fde0" 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_b213c6e1-7e88-48a8-b8fc-90370043be23" xlink:to="loc_us-gaap_PaymentsToAcquireAvailableForSaleSecuritiesDebt_f0611393-5d0c-4ab2-ad79-7b809889fde0" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ProceedsFromSaleOfShortTermInvestments_0ca2f278-0cc6-4ed2-b8bd-d7b4e76a898d" 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_b213c6e1-7e88-48a8-b8fc-90370043be23" xlink:to="loc_us-gaap_ProceedsFromSaleOfShortTermInvestments_0ca2f278-0cc6-4ed2-b8bd-d7b4e76a898d" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ProceedsFromSaleAndMaturityOfAvailableForSaleSecurities_4532722f-147a-4b2f-9b56-7ab40a32dac5" 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_b213c6e1-7e88-48a8-b8fc-90370043be23" xlink:to="loc_us-gaap_ProceedsFromSaleAndMaturityOfAvailableForSaleSecurities_4532722f-147a-4b2f-9b56-7ab40a32dac5" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PaymentsToAcquirePropertyPlantAndEquipment_ed2b2a5e-b7cd-4018-833b-be21d128de48" 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_b213c6e1-7e88-48a8-b8fc-90370043be23" xlink:to="loc_us-gaap_PaymentsToAcquirePropertyPlantAndEquipment_ed2b2a5e-b7cd-4018-833b-be21d128de48" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_9b1fb565-3141-4557-8d4e-facf29ef5a85" 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_375f60b2-d205-4d21-925e-52e6e3cec037" 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_9b1fb565-3141-4557-8d4e-facf29ef5a85" xlink:to="loc_us-gaap_NetIncomeLoss_375f60b2-d205-4d21-925e-52e6e3cec037" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleRealizedGainLoss_b6edcbf8-8021-4b4f-8fb7-8b70f942ba0c" 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_9b1fb565-3141-4557-8d4e-facf29ef5a85" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleRealizedGainLoss_b6edcbf8-8021-4b4f-8fb7-8b70f942ba0c" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_nmih_GainLossonChangeinFairValueofWarrantLiability_886918b5-a38e-4992-a306-5508434af30d" xlink:href="nmih-20230331.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_9b1fb565-3141-4557-8d4e-facf29ef5a85" xlink:to="loc_nmih_GainLossonChangeinFairValueofWarrantLiability_886918b5-a38e-4992-a306-5508434af30d" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DepreciationAmortizationAndAccretionNet_1cffdff9-61bc-4c4d-9dff-79181d2bb34f" 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_9b1fb565-3141-4557-8d4e-facf29ef5a85" xlink:to="loc_us-gaap_DepreciationAmortizationAndAccretionNet_1cffdff9-61bc-4c4d-9dff-79181d2bb34f" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AccretionAmortizationOfDiscountsAndPremiumsInvestments_f9a6248d-851d-454d-9814-191e672f9251" 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_9b1fb565-3141-4557-8d4e-facf29ef5a85" xlink:to="loc_us-gaap_AccretionAmortizationOfDiscountsAndPremiumsInvestments_f9a6248d-851d-454d-9814-191e672f9251" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AmortizationOfFinancingCostsAndDiscounts_1887f858-233f-446a-8c89-4e1f4de68a0e" 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_9b1fb565-3141-4557-8d4e-facf29ef5a85" xlink:to="loc_us-gaap_AmortizationOfFinancingCostsAndDiscounts_1887f858-233f-446a-8c89-4e1f4de68a0e" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DeferredIncomeTaxesAndTaxCredits_33319b0f-dfa9-43bc-b6e6-fa8f4e9ca0b7" 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_9b1fb565-3141-4557-8d4e-facf29ef5a85" xlink:to="loc_us-gaap_DeferredIncomeTaxesAndTaxCredits_33319b0f-dfa9-43bc-b6e6-fa8f4e9ca0b7" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ShareBasedCompensation_ee091f80-8c51-4489-b2e5-39b563348372" 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_9b1fb565-3141-4557-8d4e-facf29ef5a85" xlink:to="loc_us-gaap_ShareBasedCompensation_ee091f80-8c51-4489-b2e5-39b563348372" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInPremiumsReceivable_e9c5bf57-2964-4cb1-be3f-2a5500d0f2ff" 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_9b1fb565-3141-4557-8d4e-facf29ef5a85" xlink:to="loc_us-gaap_IncreaseDecreaseInPremiumsReceivable_e9c5bf57-2964-4cb1-be3f-2a5500d0f2ff" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInAccruedInvestmentIncomeReceivable_fe7ca0b1-b481-46fc-85ec-0177eea6453f" 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_9b1fb565-3141-4557-8d4e-facf29ef5a85" xlink:to="loc_us-gaap_IncreaseDecreaseInAccruedInvestmentIncomeReceivable_fe7ca0b1-b481-46fc-85ec-0177eea6453f" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInDeferredPolicyAcquisitionCosts_d413388d-0ba1-4b09-b7c4-8bf51f1facf6" 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_9b1fb565-3141-4557-8d4e-facf29ef5a85" xlink:to="loc_us-gaap_IncreaseDecreaseInDeferredPolicyAcquisitionCosts_d413388d-0ba1-4b09-b7c4-8bf51f1facf6" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInReinsuranceRecoverable_87451976-0096-45c6-b29c-73917b945f97" 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_9b1fb565-3141-4557-8d4e-facf29ef5a85" xlink:to="loc_us-gaap_IncreaseDecreaseInReinsuranceRecoverable_87451976-0096-45c6-b29c-73917b945f97" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInPrepaidDeferredExpenseAndOtherAssets_3826b00e-f713-487f-8761-82b49eb0decb" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_IncreaseDecreaseInPrepaidDeferredExpenseAndOtherAssets"/>
    <link:calculationArc order="13" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_9b1fb565-3141-4557-8d4e-facf29ef5a85" xlink:to="loc_us-gaap_IncreaseDecreaseInPrepaidDeferredExpenseAndOtherAssets_3826b00e-f713-487f-8761-82b49eb0decb" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInUnearnedPremiums_7d8fb8ce-5b9c-426d-a2dd-3d5df7f4d47b" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_IncreaseDecreaseInUnearnedPremiums"/>
    <link:calculationArc order="14" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_9b1fb565-3141-4557-8d4e-facf29ef5a85" xlink:to="loc_us-gaap_IncreaseDecreaseInUnearnedPremiums_7d8fb8ce-5b9c-426d-a2dd-3d5df7f4d47b" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInLiabilityForClaimsAndClaimsAdjustmentExpenseReserve_77b19ea5-24d5-4b14-ae2e-4ef0d7f51c31" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_IncreaseDecreaseInLiabilityForClaimsAndClaimsAdjustmentExpenseReserve"/>
    <link:calculationArc order="15" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_9b1fb565-3141-4557-8d4e-facf29ef5a85" xlink:to="loc_us-gaap_IncreaseDecreaseInLiabilityForClaimsAndClaimsAdjustmentExpenseReserve_77b19ea5-24d5-4b14-ae2e-4ef0d7f51c31" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_nmih_IncreaseDecreaseinReinsuranceAssetsandLiabilities_7a2b56e2-eaa3-4b8e-9ec5-74c8b1b06824" xlink:href="nmih-20230331.xsd#nmih_IncreaseDecreaseinReinsuranceAssetsandLiabilities"/>
    <link:calculationArc order="16" weight="-1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_9b1fb565-3141-4557-8d4e-facf29ef5a85" xlink:to="loc_nmih_IncreaseDecreaseinReinsuranceAssetsandLiabilities_7a2b56e2-eaa3-4b8e-9ec5-74c8b1b06824" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_IncreaseDecreaseInAccountsPayableAndAccruedLiabilities_041b7e57-fa48-4e85-9f9c-e7cbf2c63105" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.xsd#us-gaap_IncreaseDecreaseInAccountsPayableAndAccruedLiabilities"/>
    <link:calculationArc order="17" weight="1.0" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_9b1fb565-3141-4557-8d4e-facf29ef5a85" xlink:to="loc_us-gaap_IncreaseDecreaseInAccountsPayableAndAccruedLiabilities_041b7e57-fa48-4e85-9f9c-e7cbf2c63105" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsPeriodIncreaseDecreaseIncludingExchangeRateEffect_85489c60-220a-4602-bee0-2f2512845205" 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_bd69fd52-52be-48a4-a6ba-6b2b3d25558a" 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_85489c60-220a-4602-bee0-2f2512845205" xlink:to="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_bd69fd52-52be-48a4-a6ba-6b2b3d25558a" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetCashProvidedByUsedInInvestingActivities_2a47a522-dee6-434a-84a8-d8c9d898a2cb" 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_85489c60-220a-4602-bee0-2f2512845205" xlink:to="loc_us-gaap_NetCashProvidedByUsedInInvestingActivities_2a47a522-dee6-434a-84a8-d8c9d898a2cb" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_a0ce58d2-e909-4bf4-9980-40d438c8d22c" 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_85489c60-220a-4602-bee0-2f2512845205" xlink:to="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_a0ce58d2-e909-4bf4-9980-40d438c8d22c" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.nationalmi.com/role/InvestmentsScheduleofFairValuesandGrossUnrealizedGainsandLossesDetails" xlink:type="simple" xlink:href="nmih-20230331.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_4d83fb25-e08e-4524-b72d-aa6d734068b5" 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_AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedGainBeforeTax_9b365b9a-68ae-48cb-be2b-ba022801a5dc" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_4d83fb25-e08e-4524-b72d-aa6d734068b5" xlink:to="loc_us-gaap_AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedGainBeforeTax_9b365b9a-68ae-48cb-be2b-ba022801a5dc" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedLossBeforeTax_04207076-353f-4327-969f-9d64dd797a70" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_4d83fb25-e08e-4524-b72d-aa6d734068b5" xlink:to="loc_us-gaap_AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedLossBeforeTax_04207076-353f-4327-969f-9d64dd797a70" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtSecurities_012b58cb-07a8-4f36-990b-6dcafd8c239d" 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_4d83fb25-e08e-4524-b72d-aa6d734068b5" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtSecurities_012b58cb-07a8-4f36-990b-6dcafd8c239d" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.nationalmi.com/role/InvestmentsScheduleofScheduledMaturitiesDetails" xlink:type="simple" xlink:href="nmih-20230331.xsd#InvestmentsScheduleofScheduledMaturitiesDetails"/>
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/InvestmentsScheduleofScheduledMaturitiesDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtSecurities_f1a949be-cba5-4247-9e41-2bb9dce6d610" 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_9c5b6225-13d5-45d0-a0e4-dba85722593d" 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_f1a949be-cba5-4247-9e41-2bb9dce6d610" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesNextRollingTwelveMonthsFairValue_9c5b6225-13d5-45d0-a0e4-dba85722593d" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesRollingYearTwoThroughFiveFairValue_f5253545-d03e-4977-aeec-045d140bd09d" 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_f1a949be-cba5-4247-9e41-2bb9dce6d610" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesRollingYearTwoThroughFiveFairValue_f5253545-d03e-4977-aeec-045d140bd09d" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesRollingYearSixThroughTenFairValue_db6de7cc-3aea-4ae0-9194-e87b20b29a82" 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_f1a949be-cba5-4247-9e41-2bb9dce6d610" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesRollingYearSixThroughTenFairValue_db6de7cc-3aea-4ae0-9194-e87b20b29a82" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesRollingAfterYearTenFairValue_b63169bb-7b38-4d07-b578-40b5854319a5" 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_f1a949be-cba5-4247-9e41-2bb9dce6d610" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesRollingAfterYearTenFairValue_b63169bb-7b38-4d07-b578-40b5854319a5" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesWithoutSingleMaturityDateFairValue_4bb9946a-154d-4e73-a67b-2f608b606061" 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_f1a949be-cba5-4247-9e41-2bb9dce6d610" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesWithoutSingleMaturityDateFairValue_4bb9946a-154d-4e73-a67b-2f608b606061" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleDebtSecuritiesAmortizedCostBasis_ebc26064-e63e-4e5e-a9bf-9d1087f71262" 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_44042483-61bb-4958-832f-e9206a01f818" 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_ebc26064-e63e-4e5e-a9bf-9d1087f71262" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesNextRollingTwelveMonthsAmortizedCostBasis_44042483-61bb-4958-832f-e9206a01f818" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesRollingYearTwoThroughFiveAmortizedCostBasis_1139980d-ed76-49cf-9a8f-ca2915b5c5dc" 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_ebc26064-e63e-4e5e-a9bf-9d1087f71262" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesRollingYearTwoThroughFiveAmortizedCostBasis_1139980d-ed76-49cf-9a8f-ca2915b5c5dc" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesRollingYearSixThroughTenAmortizedCostBasis_031e07f4-abb9-4ac7-aecf-171a03790d39" 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_ebc26064-e63e-4e5e-a9bf-9d1087f71262" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesRollingYearSixThroughTenAmortizedCostBasis_031e07f4-abb9-4ac7-aecf-171a03790d39" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesRollingAfterYearTenAmortizedCostBasis_113124d7-4a45-42cf-a351-9d9d18f2e329" 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_ebc26064-e63e-4e5e-a9bf-9d1087f71262" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesRollingAfterYearTenAmortizedCostBasis_113124d7-4a45-42cf-a351-9d9d18f2e329" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesWithoutSingleMaturityDateAmortizedCost_15937bed-5f3d-49c2-9165-956397327618" 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_ebc26064-e63e-4e5e-a9bf-9d1087f71262" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesWithoutSingleMaturityDateAmortizedCost_15937bed-5f3d-49c2-9165-956397327618" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.nationalmi.com/role/InvestmentsScheduleofAgingofUnrealizedLossesDetails" xlink:type="simple" xlink:href="nmih-20230331.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_DebtSecuritiesAvailableForSaleUnrealizedLossPosition_9ab0cc02-a2c5-474c-816d-a02de3dbf593" 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_6b8f3329-aea5-4a11-93c3-e308cf50080c" 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_9ab0cc02-a2c5-474c-816d-a02de3dbf593" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionLessThan12Months_6b8f3329-aea5-4a11-93c3-e308cf50080c" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLonger_6649d632-8adc-410b-9d9d-5b5a89b6df36" 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_9ab0cc02-a2c5-474c-816d-a02de3dbf593" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLonger_6649d632-8adc-410b-9d9d-5b5a89b6df36" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPositionNumberOfPositions_a18c80e4-ba2f-43a6-952b-14a431d64074" 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_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionLessThan12MonthsNumberOfPositions_7d7166b6-95e8-4c37-acfe-3be368e29366" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_a18c80e4-ba2f-43a6-952b-14a431d64074" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionLessThan12MonthsNumberOfPositions_7d7166b6-95e8-4c37-acfe-3be368e29366" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLongerNumberOfPositions_c43a9292-ade0-405a-97eb-6606fe497ec4" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_a18c80e4-ba2f-43a6-952b-14a431d64074" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLongerNumberOfPositions_c43a9292-ade0-405a-97eb-6606fe497ec4" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPositionAccumulatedLoss_3db718e1-8ea4-4271-aca9-bc3f789d598a" 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_fbcb67b6-96ca-4039-8703-f5e55b1e76f0" 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_3db718e1-8ea4-4271-aca9-bc3f789d598a" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionLessThan12MonthsAccumulatedLoss_fbcb67b6-96ca-4039-8703-f5e55b1e76f0" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLongerAccumulatedLoss_add84f55-bf66-4035-a216-680adbd9e593" 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_3db718e1-8ea4-4271-aca9-bc3f789d598a" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLongerAccumulatedLoss_add84f55-bf66-4035-a216-680adbd9e593" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.nationalmi.com/role/InvestmentsScheduleofNetInvestmentIncomeDetails" xlink:type="simple" xlink:href="nmih-20230331.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_ab6ab664-0469-474c-b63d-fde4a48db0bf" 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_InvestmentIncomeInterestAndDividend_db51d5ed-b3f5-46a9-b044-eea60db7fa24" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_ab6ab664-0469-474c-b63d-fde4a48db0bf" xlink:to="loc_us-gaap_InvestmentIncomeInterestAndDividend_db51d5ed-b3f5-46a9-b044-eea60db7fa24" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_InvestmentIncomeInvestmentExpense_574429c0-2bbf-49dc-897d-448925bd7f6b" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_ab6ab664-0469-474c-b63d-fde4a48db0bf" xlink:to="loc_us-gaap_InvestmentIncomeInvestmentExpense_574429c0-2bbf-49dc-897d-448925bd7f6b" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.nationalmi.com/role/InvestmentsScheduleofNetRealizedInvestmentGainsLossesDetails" xlink:type="simple" xlink:href="nmih-20230331.xsd#InvestmentsScheduleofNetRealizedInvestmentGainsLossesDetails"/>
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/InvestmentsScheduleofNetRealizedInvestmentGainsLossesDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleRealizedGainLoss_dfbc034f-959d-4e8e-89bc-42de0c09f65b" 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_3111235e-1a2b-4a22-af7f-6bf58e6cd9a7" 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_dfbc034f-959d-4e8e-89bc-42de0c09f65b" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleRealizedGain_3111235e-1a2b-4a22-af7f-6bf58e6cd9a7" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleRealizedLoss_6921a890-4966-4ca5-8cc8-8dcf762954bc" 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_dfbc034f-959d-4e8e-89bc-42de0c09f65b" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleRealizedLoss_6921a890-4966-4ca5-8cc8-8dcf762954bc" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.nationalmi.com/role/FairValueofFinancialInstrumentsScheduleofFairValueMeasurementsofFinancialInstrumentsDetails" xlink:type="simple" xlink:href="nmih-20230331.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_844068d1-906b-4c57-9102-c2f4d58aa156" 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_2d044712-1fd7-4147-a8a7-f9e419018655" 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_844068d1-906b-4c57-9102-c2f4d58aa156" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtSecurities_2d044712-1fd7-4147-a8a7-f9e419018655" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CashAndCashEquivalentsFairValueDisclosure_a6cdb142-9bba-4360-a9a6-6abda631d42b" 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_844068d1-906b-4c57-9102-c2f4d58aa156" xlink:to="loc_us-gaap_CashAndCashEquivalentsFairValueDisclosure_a6cdb142-9bba-4360-a9a6-6abda631d42b" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.nationalmi.com/role/ReinsuranceScheduleofEffectofReinsuranceAgreementsonPremiumsWrittenandEarnedDetails" xlink:type="simple" xlink:href="nmih-20230331.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_1293808c-be11-4e46-ac4d-eb02e2bcb38e" 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_5f67f6b2-c157-4ba7-a521-b84d2a6ec26e" 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_1293808c-be11-4e46-ac4d-eb02e2bcb38e" xlink:to="loc_us-gaap_DirectPremiumsWritten_5f67f6b2-c157-4ba7-a521-b84d2a6ec26e" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CededPremiumsWritten_4d9c46fc-84c3-492d-8634-69b9bbf6aa12" 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_1293808c-be11-4e46-ac4d-eb02e2bcb38e" xlink:to="loc_us-gaap_CededPremiumsWritten_4d9c46fc-84c3-492d-8634-69b9bbf6aa12" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PremiumsEarnedNet_a63f60f5-ae5a-401e-82bb-f52fa564f57d" 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_8d7104f0-541b-4a89-99a2-65e32ee7eb7b" 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_a63f60f5-ae5a-401e-82bb-f52fa564f57d" xlink:to="loc_us-gaap_DirectPremiumsEarned_8d7104f0-541b-4a89-99a2-65e32ee7eb7b" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_CededPremiumsEarned_b034255f-db0c-42b7-87f6-f9c59c0730ee" 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_a63f60f5-ae5a-401e-82bb-f52fa564f57d" xlink:to="loc_us-gaap_CededPremiumsEarned_b034255f-db0c-42b7-87f6-f9c59c0730ee" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.nationalmi.com/role/ReservesforInsuranceClaimsandClaimBenefitsExpensesScheduleofReconciliationofReserveBalancesforInsuranceClaimsandClaimExpenseDetails" xlink:type="simple" xlink:href="nmih-20230331.xsd#ReservesforInsuranceClaimsandClaimBenefitsExpensesScheduleofReconciliationofReserveBalancesforInsuranceClaimsandClaimExpenseDetails"/>
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/ReservesforInsuranceClaimsandClaimBenefitsExpensesScheduleofReconciliationofReserveBalancesforInsuranceClaimsandClaimExpenseDetails" xlink:type="extended">
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LiabilityForUnpaidClaimsAndClaimsAdjustmentExpenseIncurredClaims1_b65cc8e1-9fc3-4593-8a31-c63ba61298ea" 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_ad66b432-8998-4b7d-8810-427f91db7965" 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_b65cc8e1-9fc3-4593-8a31-c63ba61298ea" xlink:to="loc_us-gaap_SupplementalInformationForPropertyCasualtyInsuranceUnderwritersCurrentYearClaimsAndClaimsAdjustmentExpense_ad66b432-8998-4b7d-8810-427f91db7965" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_SupplementalInformationForPropertyCasualtyInsuranceUnderwritersPriorYearClaimsAndClaimsAdjustmentExpense_5c8a2788-9f7a-4fcc-bb0c-d78ed2fa901d" 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_b65cc8e1-9fc3-4593-8a31-c63ba61298ea" xlink:to="loc_us-gaap_SupplementalInformationForPropertyCasualtyInsuranceUnderwritersPriorYearClaimsAndClaimsAdjustmentExpense_5c8a2788-9f7a-4fcc-bb0c-d78ed2fa901d" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_PaymentsForLossesAndLossAdjustmentExpense_6a3935b9-1501-4f2d-ac98-68f850914fce" 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_7e7ed60b-bd46-4968-8984-b8663b8b8dbd" 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_6a3935b9-1501-4f2d-ac98-68f850914fce" xlink:to="loc_us-gaap_LiabilityForUnpaidClaimsAndClaimsAdjustmentExpenseClaimsPaidCurrentYear1_7e7ed60b-bd46-4968-8984-b8663b8b8dbd" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LiabilityForUnpaidClaimsAndClaimsAdjustmentExpenseClaimsPaidPriorYears1_eb9e0021-3afa-43ef-a884-dcd49f03b356" 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_6a3935b9-1501-4f2d-ac98-68f850914fce" xlink:to="loc_us-gaap_LiabilityForUnpaidClaimsAndClaimsAdjustmentExpenseClaimsPaidPriorYears1_eb9e0021-3afa-43ef-a884-dcd49f03b356" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_LiabilityForUnpaidClaimsAndClaimsAdjustmentExpenseNet_88b3b1d3-fd24-462b-b520-b242a1655b1e" 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_e8c6bd72-470c-44d3-b901-da510b7d8131" 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_88b3b1d3-fd24-462b-b520-b242a1655b1e" xlink:to="loc_us-gaap_LiabilityForClaimsAndClaimsAdjustmentExpense_e8c6bd72-470c-44d3-b901-da510b7d8131" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_ReinsuranceRecoverablesOnPaidAndUnpaidLosses_4e5d9a26-b804-4f13-9456-8a52c8a82f58" 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_88b3b1d3-fd24-462b-b520-b242a1655b1e" xlink:to="loc_us-gaap_ReinsuranceRecoverablesOnPaidAndUnpaidLosses_4e5d9a26-b804-4f13-9456-8a52c8a82f58" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.nationalmi.com/role/EarningsperShareEPSScheduleofEarningsPerShareBasicandDilutedDetails" xlink:type="simple" xlink:href="nmih-20230331.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_659532f6-9fb6-4578-8e91-9879260307d9" 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_03456af3-6fc1-437e-8a37-8d61ec87b196" 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_659532f6-9fb6-4578-8e91-9879260307d9" xlink:to="loc_us-gaap_WeightedAverageNumberOfSharesOutstandingBasic_03456af3-6fc1-437e-8a37-8d61ec87b196" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_WeightedAverageNumberDilutedSharesOutstandingAdjustment_05bb5b20-8714-441b-b5f2-cad84af92435" 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_659532f6-9fb6-4578-8e91-9879260307d9" xlink:to="loc_us-gaap_WeightedAverageNumberDilutedSharesOutstandingAdjustment_05bb5b20-8714-441b-b5f2-cad84af92435" xlink:type="arc"/>
  </link:calculationLink>
  <link:roleRef roleURI="http://www.nationalmi.com/role/RegulatoryInformationScheduleofCombinedStatutoryNetLossStatutorySurplusContingencyReserveandRTCRatiosDetails" xlink:type="simple" xlink:href="nmih-20230331.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_28a9b465-aad8-404c-b8b9-c1a0171fe819" xlink:href="nmih-20230331.xsd#nmih_StatutoryAccountingPracticesStatutoryCapitalAndSurplusIncludingContingencyReserve"/>
    <link:loc xlink:type="locator" xlink:label="loc_us-gaap_StatutoryAccountingPracticesStatutoryCapitalAndSurplusBalance_2d96167f-3374-4caa-8e8b-d1140588d454" xlink:href="https://xbrl.fasb.org/us-gaap/2022/elts/us-gaap-2022.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_28a9b465-aad8-404c-b8b9-c1a0171fe819" xlink:to="loc_us-gaap_StatutoryAccountingPracticesStatutoryCapitalAndSurplusBalance_2d96167f-3374-4caa-8e8b-d1140588d454" xlink:type="arc"/>
    <link:loc xlink:type="locator" xlink:label="loc_nmih_StatutoryAccountingPracticesContingencyReserve_238d17a8-1761-4ac4-87ec-e3a53c2d6d0c" xlink:href="nmih-20230331.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_28a9b465-aad8-404c-b8b9-c1a0171fe819" xlink:to="loc_nmih_StatutoryAccountingPracticesContingencyReserve_238d17a8-1761-4ac4-87ec-e3a53c2d6d0c" xlink:type="arc"/>
  </link:calculationLink>
</link:linkbase>
