<?xml version="1.0" encoding="US-ASCII"?>
<!--XBRL Document Created with Wdesk from Workiva-->
<!-- -->
<link:linkbase xsi:schemaLocation="http://www.xbrl.org/2003/linkbase http://www.xbrl.org/2003/xbrl-linkbase-2003-12-31.xsd" 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">
  <link:roleRef roleURI="http://www.nationalmi.com/role/CommitmentsAndContingencies" xlink:href="nmih-20171231.xsd#CommitmentsAndContingencies" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/CommitmentsAndContingenciesFutureMinimumLeasePaymentsDetails" xlink:href="nmih-20171231.xsd#CommitmentsAndContingenciesFutureMinimumLeasePaymentsDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/CommitmentsAndContingenciesNarrativeDetails" xlink:href="nmih-20171231.xsd#CommitmentsAndContingenciesNarrativeDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/CommitmentsAndContingenciesTables" xlink:href="nmih-20171231.xsd#CommitmentsAndContingenciesTables" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/ConsolidatedBalanceSheets" xlink:href="nmih-20171231.xsd#ConsolidatedBalanceSheets" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/ConsolidatedBalanceSheetsParenthetical" xlink:href="nmih-20171231.xsd#ConsolidatedBalanceSheetsParenthetical" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/ConsolidatedStatementsOfCashFlows" xlink:href="nmih-20171231.xsd#ConsolidatedStatementsOfCashFlows" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/ConsolidatedStatementsOfChangesInShareholdersEquity" xlink:href="nmih-20171231.xsd#ConsolidatedStatementsOfChangesInShareholdersEquity" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/ConsolidatedStatementsOfChangesInShareholdersEquityParenthetical" xlink:href="nmih-20171231.xsd#ConsolidatedStatementsOfChangesInShareholdersEquityParenthetical" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/ConsolidatedStatementsOfComprehensiveIncomeLoss" xlink:href="nmih-20171231.xsd#ConsolidatedStatementsOfComprehensiveIncomeLoss" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/ConsolidatedStatementsOfComprehensiveIncomeLossParenthetical" xlink:href="nmih-20171231.xsd#ConsolidatedStatementsOfComprehensiveIncomeLossParenthetical" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/DocumentAndEntityInformation" xlink:href="nmih-20171231.xsd#DocumentAndEntityInformation" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/EarningsLossPerShareEps" xlink:href="nmih-20171231.xsd#EarningsLossPerShareEps" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/EarningsLossPerShareEpsComputationOfBasicAndDilutedEarningsLossPerShareDetails" xlink:href="nmih-20171231.xsd#EarningsLossPerShareEpsComputationOfBasicAndDilutedEarningsLossPerShareDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/EarningsLossPerShareEpsTables" xlink:href="nmih-20171231.xsd#EarningsLossPerShareEpsTables" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/FairValueOfFinancialInstruments" xlink:href="nmih-20171231.xsd#FairValueOfFinancialInstruments" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/FairValueOfFinancialInstrumentsAssetsAndLiabilitiesAtFairValueDetails" xlink:href="nmih-20171231.xsd#FairValueOfFinancialInstrumentsAssetsAndLiabilitiesAtFairValueDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/FairValueOfFinancialInstrumentsRollFowardOfLevel3LiabilitiesMeasuredAtFairValueDetails" xlink:href="nmih-20171231.xsd#FairValueOfFinancialInstrumentsRollFowardOfLevel3LiabilitiesMeasuredAtFairValueDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/FairValueOfFinancialInstrumentsTables" xlink:href="nmih-20171231.xsd#FairValueOfFinancialInstrumentsTables" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/FairValueOfFinancialInstrumentsValuationAssumptionsForWarrantLiabilitiesDetails" xlink:href="nmih-20171231.xsd#FairValueOfFinancialInstrumentsValuationAssumptionsForWarrantLiabilitiesDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/IncomeTaxes" xlink:href="nmih-20171231.xsd#IncomeTaxes" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/IncomeTaxesComponentsOfProvisionForIncomeTaxesBenefitsDetails" xlink:href="nmih-20171231.xsd#IncomeTaxesComponentsOfProvisionForIncomeTaxesBenefitsDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/IncomeTaxesDeferredTaxAssetAndLiabilitiesDetails" xlink:href="nmih-20171231.xsd#IncomeTaxesDeferredTaxAssetAndLiabilitiesDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/IncomeTaxesIncomeTaxReconciliationDetails" xlink:href="nmih-20171231.xsd#IncomeTaxesIncomeTaxReconciliationDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/IncomeTaxesNarrativeDetails" xlink:href="nmih-20171231.xsd#IncomeTaxesNarrativeDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/IncomeTaxesTables" xlink:href="nmih-20171231.xsd#IncomeTaxesTables" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/IntangibleAssetsAndGoodwill" xlink:href="nmih-20171231.xsd#IntangibleAssetsAndGoodwill" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/IntangibleAssetsAndGoodwillBalancesDetails" xlink:href="nmih-20171231.xsd#IntangibleAssetsAndGoodwillBalancesDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/IntangibleAssetsAndGoodwillTables" xlink:href="nmih-20171231.xsd#IntangibleAssetsAndGoodwillTables" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/Investments" xlink:href="nmih-20171231.xsd#Investments" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/InvestmentsFairValuesAndGrossUnrealizedGainsAndLossesOnInvestmentsDetails" xlink:href="nmih-20171231.xsd#InvestmentsFairValuesAndGrossUnrealizedGainsAndLossesOnInvestmentsDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/InvestmentsNarrativeDetails" xlink:href="nmih-20171231.xsd#InvestmentsNarrativeDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/InvestmentsNetInvestmentIncomeDetails" xlink:href="nmih-20171231.xsd#InvestmentsNetInvestmentIncomeDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/InvestmentsNetRealizedInvestmentsGainsLossesDetails" xlink:href="nmih-20171231.xsd#InvestmentsNetRealizedInvestmentsGainsLossesDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/InvestmentsScheduledMaturitiesDetails" xlink:href="nmih-20171231.xsd#InvestmentsScheduledMaturitiesDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/InvestmentsTables" xlink:href="nmih-20171231.xsd#InvestmentsTables" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/InvestmentsUnrealizedLossesDetails" xlink:href="nmih-20171231.xsd#InvestmentsUnrealizedLossesDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/OrganizationAndBasisOfPresentation" xlink:href="nmih-20171231.xsd#OrganizationAndBasisOfPresentation" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/OrganizationAndBasisOfPresentationNarrativeDetails" xlink:href="nmih-20171231.xsd#OrganizationAndBasisOfPresentationNarrativeDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/QuarterlyFinancialDataUnaudited" xlink:href="nmih-20171231.xsd#QuarterlyFinancialDataUnaudited" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/QuarterlyFinancialDataUnauditedDetails" xlink:href="nmih-20171231.xsd#QuarterlyFinancialDataUnauditedDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/QuarterlyFinancialDataUnauditedTables" xlink:href="nmih-20171231.xsd#QuarterlyFinancialDataUnauditedTables" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/RegulatoryInformation" xlink:href="nmih-20171231.xsd#RegulatoryInformation" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/RegulatoryInformationNarrativeDetails" xlink:href="nmih-20171231.xsd#RegulatoryInformationNarrativeDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/RegulatoryInformationScheduleOfCombinedStatutoryNetLossStatutorySurplusContingencyReserveAndRtcRatiosDetails" xlink:href="nmih-20171231.xsd#RegulatoryInformationScheduleOfCombinedStatutoryNetLossStatutorySurplusContingencyReserveAndRtcRatiosDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/RegulatoryInformationTables" xlink:href="nmih-20171231.xsd#RegulatoryInformationTables" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/Reinsurance" xlink:href="nmih-20171231.xsd#Reinsurance" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/ReinsuranceAmountsCededRelatedTo2016QsrTransactionDetails" xlink:href="nmih-20171231.xsd#ReinsuranceAmountsCededRelatedTo2016QsrTransactionDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/ReinsuranceEffectOfReinsuranceOnNetPremiumsWrittenAndEarnedDetails" xlink:href="nmih-20171231.xsd#ReinsuranceEffectOfReinsuranceOnNetPremiumsWrittenAndEarnedDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/ReinsuranceNarrativeDetails" xlink:href="nmih-20171231.xsd#ReinsuranceNarrativeDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/ReinsuranceTables" xlink:href="nmih-20171231.xsd#ReinsuranceTables" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/ReserveForInsuranceClaimsAndClaimExpenses" xlink:href="nmih-20171231.xsd#ReserveForInsuranceClaimsAndClaimExpenses" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/ReservesForInsuranceClaimsAndClaimExpensesAverageAnnualPercentagePayoutOfIncurredClaimsByAgeNetOfReinsuranceDetails" xlink:href="nmih-20171231.xsd#ReservesForInsuranceClaimsAndClaimExpensesAverageAnnualPercentagePayoutOfIncurredClaimsByAgeNetOfReinsuranceDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/ReservesForInsuranceClaimsAndClaimExpensesClaimDevelopmentByAccidentYearAndReconciliationOfReserveForInsuranceClaimsAndClaimsExpenseDetails" xlink:href="nmih-20171231.xsd#ReservesForInsuranceClaimsAndClaimExpensesClaimDevelopmentByAccidentYearAndReconciliationOfReserveForInsuranceClaimsAndClaimsExpenseDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/ReservesForInsuranceClaimsAndClaimExpensesNarrativeDetails" xlink:href="nmih-20171231.xsd#ReservesForInsuranceClaimsAndClaimExpensesNarrativeDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/ReservesForInsuranceClaimsAndClaimExpensesReconciliationOfDisclosureOfIncurredAndPaidClaimsDevelopmentToLiabilityForUnpaidClaimsAndClaimsAdjustmentExpensesDetails" xlink:href="nmih-20171231.xsd#ReservesForInsuranceClaimsAndClaimExpensesReconciliationOfDisclosureOfIncurredAndPaidClaimsDevelopmentToLiabilityForUnpaidClaimsAndClaimsAdjustmentExpensesDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/ReservesForInsuranceClaimsAndClaimExpensesReconciliationOfReserveBalancesForInsuranceClaimsExpensesDetails" xlink:href="nmih-20171231.xsd#ReservesForInsuranceClaimsAndClaimExpensesReconciliationOfReserveBalancesForInsuranceClaimsExpensesDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/ReservesForInsuranceClaimsAndClaimExpensesTables" xlink:href="nmih-20171231.xsd#ReservesForInsuranceClaimsAndClaimExpensesTables" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/ScheduleISummaryOfInvestmentsOtherThanInvestmentsInRelatedParties" xlink:href="nmih-20171231.xsd#ScheduleISummaryOfInvestmentsOtherThanInvestmentsInRelatedParties" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/ScheduleISummaryOfInvestmentsOtherThanInvestmentsInRelatedPartiesDetails" xlink:href="nmih-20171231.xsd#ScheduleISummaryOfInvestmentsOtherThanInvestmentsInRelatedPartiesDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/ScheduleIiFinancialInformationOfRegistrantParentCompanyOnly" xlink:href="nmih-20171231.xsd#ScheduleIiFinancialInformationOfRegistrantParentCompanyOnly" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/ScheduleIiFinancialInformationOfRegistrantParentCompanyOnlyBalanceSheetAdditionalInformationDetails" xlink:href="nmih-20171231.xsd#ScheduleIiFinancialInformationOfRegistrantParentCompanyOnlyBalanceSheetAdditionalInformationDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/ScheduleIiFinancialInformationOfRegistrantParentCompanyOnlyBalanceSheetDetails" xlink:href="nmih-20171231.xsd#ScheduleIiFinancialInformationOfRegistrantParentCompanyOnlyBalanceSheetDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/ScheduleIiFinancialInformationOfRegistrantParentCompanyOnlyCashFlowStatementDetails" xlink:href="nmih-20171231.xsd#ScheduleIiFinancialInformationOfRegistrantParentCompanyOnlyCashFlowStatementDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/ScheduleIiFinancialInformationOfRegistrantParentCompanyOnlyIncomeStatementAdditionalInformationDetails" xlink:href="nmih-20171231.xsd#ScheduleIiFinancialInformationOfRegistrantParentCompanyOnlyIncomeStatementAdditionalInformationDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/ScheduleIiFinancialInformationOfRegistrantParentCompanyOnlyIncomeStatementDetails" xlink:href="nmih-20171231.xsd#ScheduleIiFinancialInformationOfRegistrantParentCompanyOnlyIncomeStatementDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/ScheduleIiFinancialInformationOfRegistrantParentCompanyOnlySupplementalNotesDetails" xlink:href="nmih-20171231.xsd#ScheduleIiFinancialInformationOfRegistrantParentCompanyOnlySupplementalNotesDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/ScheduleIvFinancialInformationOfRegistrantReinsuranceParentCompanyOnly" xlink:href="nmih-20171231.xsd#ScheduleIvFinancialInformationOfRegistrantReinsuranceParentCompanyOnly" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/ScheduleIvFinancialInformationOfRegistrantReinsuranceParentCompanyOnlyDetails" xlink:href="nmih-20171231.xsd#ScheduleIvFinancialInformationOfRegistrantReinsuranceParentCompanyOnlyDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/ShareBasedCompensation" xlink:href="nmih-20171231.xsd#ShareBasedCompensation" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/ShareBasedCompensationNarrativeDetails" xlink:href="nmih-20171231.xsd#ShareBasedCompensationNarrativeDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/ShareBasedCompensationRestrictedStockUnitsActivityDetails" xlink:href="nmih-20171231.xsd#ShareBasedCompensationRestrictedStockUnitsActivityDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/ShareBasedCompensationStockOptionActivityDetails" xlink:href="nmih-20171231.xsd#ShareBasedCompensationStockOptionActivityDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/ShareBasedCompensationStockOptionValuationAssumptionsDetails" xlink:href="nmih-20171231.xsd#ShareBasedCompensationStockOptionValuationAssumptionsDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/ShareBasedCompensationTables" xlink:href="nmih-20171231.xsd#ShareBasedCompensationTables" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/SoftwareAndEquipment" xlink:href="nmih-20171231.xsd#SoftwareAndEquipment" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/SoftwareAndEquipmentBalancesAndActivityDetails" xlink:href="nmih-20171231.xsd#SoftwareAndEquipmentBalancesAndActivityDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/SoftwareAndEquipmentNarrativeDetails" xlink:href="nmih-20171231.xsd#SoftwareAndEquipmentNarrativeDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/SoftwareAndEquipmentTables" xlink:href="nmih-20171231.xsd#SoftwareAndEquipmentTables" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/SummaryOfAccountingPolicies" xlink:href="nmih-20171231.xsd#SummaryOfAccountingPolicies" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/SummaryOfAccountingPoliciesNarrativeDetails" xlink:href="nmih-20171231.xsd#SummaryOfAccountingPoliciesNarrativeDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/SummaryOfAccountingPoliciesPolicies" xlink:href="nmih-20171231.xsd#SummaryOfAccountingPoliciesPolicies" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/SummaryOfAccountingPoliciesPriorPeriodAdjustmentsDetails" xlink:href="nmih-20171231.xsd#SummaryOfAccountingPoliciesPriorPeriodAdjustmentsDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/SummaryOfAccountingPoliciesSubsequentEventsDetails" xlink:href="nmih-20171231.xsd#SummaryOfAccountingPoliciesSubsequentEventsDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/SummaryOfAccountingPoliciesTables" xlink:href="nmih-20171231.xsd#SummaryOfAccountingPoliciesTables" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/TermLoan" xlink:href="nmih-20171231.xsd#TermLoan" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/TermLoanNarrativeDetails" xlink:href="nmih-20171231.xsd#TermLoanNarrativeDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/TermLoanScheduleOfFuturePrincipalPaymentsDetails" xlink:href="nmih-20171231.xsd#TermLoanScheduleOfFuturePrincipalPaymentsDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/TermLoanTables" xlink:href="nmih-20171231.xsd#TermLoanTables" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/Warrants" xlink:href="nmih-20171231.xsd#Warrants" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/WarrantsNarrativeDetails" xlink:href="nmih-20171231.xsd#WarrantsNarrativeDetails" xlink:type="simple" />
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/CommitmentsAndContingencies" xlink:type="extended" />
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/CommitmentsAndContingenciesFutureMinimumLeasePaymentsDetails" xlink:type="extended">
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_OperatingLeasesFutureMinimumPaymentsDue" xlink:label="loc_us-gaap_OperatingLeasesFutureMinimumPaymentsDue_e7ae0c4b-54d0-1d15-1541-1fb5329d750c" xlink:type="locator" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_OperatingLeasesFutureMinimumPaymentsDueCurrent" xlink:label="loc_us-gaap_OperatingLeasesFutureMinimumPaymentsDueCurrent_5046b63b-148e-eb12-dd52-2a1e8f1e69c0" xlink:type="locator" />
    <link:calculationArc order="1" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_OperatingLeasesFutureMinimumPaymentsDue_e7ae0c4b-54d0-1d15-1541-1fb5329d750c" xlink:to="loc_us-gaap_OperatingLeasesFutureMinimumPaymentsDueCurrent_5046b63b-148e-eb12-dd52-2a1e8f1e69c0" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_OperatingLeasesFutureMinimumPaymentsDueInTwoYears" xlink:label="loc_us-gaap_OperatingLeasesFutureMinimumPaymentsDueInTwoYears_483c5d20-89a2-da39-b56f-2ea722d97042" xlink:type="locator" />
    <link:calculationArc order="2" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_OperatingLeasesFutureMinimumPaymentsDue_e7ae0c4b-54d0-1d15-1541-1fb5329d750c" xlink:to="loc_us-gaap_OperatingLeasesFutureMinimumPaymentsDueInTwoYears_483c5d20-89a2-da39-b56f-2ea722d97042" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_OperatingLeasesFutureMinimumPaymentsDueInThreeYears" xlink:label="loc_us-gaap_OperatingLeasesFutureMinimumPaymentsDueInThreeYears_b5a3356e-f555-ddd5-297a-b04afe0bfd5c" xlink:type="locator" />
    <link:calculationArc order="3" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_OperatingLeasesFutureMinimumPaymentsDue_e7ae0c4b-54d0-1d15-1541-1fb5329d750c" xlink:to="loc_us-gaap_OperatingLeasesFutureMinimumPaymentsDueInThreeYears_b5a3356e-f555-ddd5-297a-b04afe0bfd5c" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_OperatingLeasesFutureMinimumPaymentsDueInFourYears" xlink:label="loc_us-gaap_OperatingLeasesFutureMinimumPaymentsDueInFourYears_6818de09-a032-5221-5ee6-896e1c2d0634" xlink:type="locator" />
    <link:calculationArc order="4" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_OperatingLeasesFutureMinimumPaymentsDue_e7ae0c4b-54d0-1d15-1541-1fb5329d750c" xlink:to="loc_us-gaap_OperatingLeasesFutureMinimumPaymentsDueInFourYears_6818de09-a032-5221-5ee6-896e1c2d0634" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_OperatingLeasesFutureMinimumPaymentsDueInFiveYears" xlink:label="loc_us-gaap_OperatingLeasesFutureMinimumPaymentsDueInFiveYears_56f89e4f-d247-3cf0-a749-00554ab475a6" xlink:type="locator" />
    <link:calculationArc order="5" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_OperatingLeasesFutureMinimumPaymentsDue_e7ae0c4b-54d0-1d15-1541-1fb5329d750c" xlink:to="loc_us-gaap_OperatingLeasesFutureMinimumPaymentsDueInFiveYears_56f89e4f-d247-3cf0-a749-00554ab475a6" xlink:type="arc" />
    <link:loc xlink:href="nmih-20171231.xsd#nmih_OperatingLeasesFutureMinimumPaymentsDueinSixYears" xlink:label="loc_nmih_OperatingLeasesFutureMinimumPaymentsDueinSixYears_5265af52-bce9-9a01-28be-b8501437ca20" xlink:type="locator" />
    <link:calculationArc order="6" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_OperatingLeasesFutureMinimumPaymentsDue_e7ae0c4b-54d0-1d15-1541-1fb5329d750c" xlink:to="loc_nmih_OperatingLeasesFutureMinimumPaymentsDueinSixYears_5265af52-bce9-9a01-28be-b8501437ca20" xlink:type="arc" />
  </link:calculationLink>
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/CommitmentsAndContingenciesNarrativeDetails" xlink:type="extended" />
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/CommitmentsAndContingenciesTables" xlink:type="extended" />
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/ConsolidatedBalanceSheets" xlink:type="extended">
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_LiabilitiesAndStockholdersEquity" xlink:label="loc_us-gaap_LiabilitiesAndStockholdersEquity_159dcb00-b17e-17db-7098-be4159799459" xlink:type="locator" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_Liabilities" xlink:label="loc_us-gaap_Liabilities_d8bb821f-d155-9d4e-1738-736b4bf4cb19" xlink:type="locator" />
    <link:calculationArc order="1" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_LiabilitiesAndStockholdersEquity_159dcb00-b17e-17db-7098-be4159799459" xlink:to="loc_us-gaap_Liabilities_d8bb821f-d155-9d4e-1738-736b4bf4cb19" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_LongTermDebt" xlink:label="loc_us-gaap_LongTermDebt_7e14882f-7ab9-8302-20ff-24c510ab8806" xlink:type="locator" />
    <link:calculationArc order="1" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Liabilities_d8bb821f-d155-9d4e-1738-736b4bf4cb19" xlink:to="loc_us-gaap_LongTermDebt_7e14882f-7ab9-8302-20ff-24c510ab8806" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_UnearnedPremiums" xlink:label="loc_us-gaap_UnearnedPremiums_072f4ee9-1456-a2ab-4929-fdd25609c0bc" xlink:type="locator" />
    <link:calculationArc order="2" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Liabilities_d8bb821f-d155-9d4e-1738-736b4bf4cb19" xlink:to="loc_us-gaap_UnearnedPremiums_072f4ee9-1456-a2ab-4929-fdd25609c0bc" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_AccountsPayableAndAccruedLiabilitiesCurrentAndNoncurrent" xlink:label="loc_us-gaap_AccountsPayableAndAccruedLiabilitiesCurrentAndNoncurrent_22209269-019a-b624-538b-4c592122e01f" xlink:type="locator" />
    <link:calculationArc order="3" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Liabilities_d8bb821f-d155-9d4e-1738-736b4bf4cb19" xlink:to="loc_us-gaap_AccountsPayableAndAccruedLiabilitiesCurrentAndNoncurrent_22209269-019a-b624-538b-4c592122e01f" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_LiabilityForClaimsAndClaimsAdjustmentExpense" xlink:label="loc_us-gaap_LiabilityForClaimsAndClaimsAdjustmentExpense_99d901f4-4cf9-4545-f608-844c08dd00c1" xlink:type="locator" />
    <link:calculationArc order="4" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Liabilities_d8bb821f-d155-9d4e-1738-736b4bf4cb19" xlink:to="loc_us-gaap_LiabilityForClaimsAndClaimsAdjustmentExpense_99d901f4-4cf9-4545-f608-844c08dd00c1" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_FundsHeldUnderReinsuranceAgreementsLiability" xlink:label="loc_us-gaap_FundsHeldUnderReinsuranceAgreementsLiability_f244d34f-5c3e-30b2-9c7a-c5e50ee7cd27" xlink:type="locator" />
    <link:calculationArc order="5" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Liabilities_d8bb821f-d155-9d4e-1738-736b4bf4cb19" xlink:to="loc_us-gaap_FundsHeldUnderReinsuranceAgreementsLiability_f244d34f-5c3e-30b2-9c7a-c5e50ee7cd27" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_DeferredRevenue" xlink:label="loc_us-gaap_DeferredRevenue_9a892e27-e80d-dc6f-5258-af2522cd72c3" xlink:type="locator" />
    <link:calculationArc order="6" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Liabilities_d8bb821f-d155-9d4e-1738-736b4bf4cb19" xlink:to="loc_us-gaap_DeferredRevenue_9a892e27-e80d-dc6f-5258-af2522cd72c3" xlink:type="arc" />
    <link:loc xlink:href="nmih-20171231.xsd#nmih_WarrantLiability" xlink:label="loc_nmih_WarrantLiability_da32994b-aa10-87ec-6ac0-ed48832cde69" xlink:type="locator" />
    <link:calculationArc order="7" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Liabilities_d8bb821f-d155-9d4e-1738-736b4bf4cb19" xlink:to="loc_nmih_WarrantLiability_da32994b-aa10-87ec-6ac0-ed48832cde69" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_CommitmentsAndContingencies" xlink:label="loc_us-gaap_CommitmentsAndContingencies_058e01e4-b9a1-623e-29f5-1b5c79bf095a" xlink:type="locator" />
    <link:calculationArc order="2" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_LiabilitiesAndStockholdersEquity_159dcb00-b17e-17db-7098-be4159799459" xlink:to="loc_us-gaap_CommitmentsAndContingencies_058e01e4-b9a1-623e-29f5-1b5c79bf095a" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_StockholdersEquity" xlink:label="loc_us-gaap_StockholdersEquity_4b158f76-5f04-5e4d-ead3-d80e1f9943db" xlink:type="locator" />
    <link:calculationArc order="3" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_LiabilitiesAndStockholdersEquity_159dcb00-b17e-17db-7098-be4159799459" xlink:to="loc_us-gaap_StockholdersEquity_4b158f76-5f04-5e4d-ead3-d80e1f9943db" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_CommonStockValueOutstanding" xlink:label="loc_us-gaap_CommonStockValueOutstanding_84f35893-355e-0c6f-c67d-2f363beeac9a" xlink:type="locator" />
    <link:calculationArc order="1" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_StockholdersEquity_4b158f76-5f04-5e4d-ead3-d80e1f9943db" xlink:to="loc_us-gaap_CommonStockValueOutstanding_84f35893-355e-0c6f-c67d-2f363beeac9a" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_AdditionalPaidInCapital" xlink:label="loc_us-gaap_AdditionalPaidInCapital_2d1b9d27-8b19-82d9-2843-5b3d292b7fbb" xlink:type="locator" />
    <link:calculationArc order="2" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_StockholdersEquity_4b158f76-5f04-5e4d-ead3-d80e1f9943db" xlink:to="loc_us-gaap_AdditionalPaidInCapital_2d1b9d27-8b19-82d9-2843-5b3d292b7fbb" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_AccumulatedOtherComprehensiveIncomeLossNetOfTax" xlink:label="loc_us-gaap_AccumulatedOtherComprehensiveIncomeLossNetOfTax_04f0961a-a0bc-88cf-6658-3f950da4a458" xlink:type="locator" />
    <link:calculationArc order="3" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_StockholdersEquity_4b158f76-5f04-5e4d-ead3-d80e1f9943db" xlink:to="loc_us-gaap_AccumulatedOtherComprehensiveIncomeLossNetOfTax_04f0961a-a0bc-88cf-6658-3f950da4a458" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_RetainedEarningsAccumulatedDeficit" xlink:label="loc_us-gaap_RetainedEarningsAccumulatedDeficit_065cb284-7fca-cc9b-5752-2feaf74d0011" xlink:type="locator" />
    <link:calculationArc order="4" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_StockholdersEquity_4b158f76-5f04-5e4d-ead3-d80e1f9943db" xlink:to="loc_us-gaap_RetainedEarningsAccumulatedDeficit_065cb284-7fca-cc9b-5752-2feaf74d0011" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_Assets" xlink:label="loc_us-gaap_Assets_c6057b1d-6685-8249-2051-6c57f3a16a9e" xlink:type="locator" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_AvailableForSaleSecuritiesDebtSecurities" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtSecurities_2c867d9b-5594-18ef-c82a-679b606d1bd3" xlink:type="locator" />
    <link:calculationArc order="1" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_c6057b1d-6685-8249-2051-6c57f3a16a9e" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtSecurities_2c867d9b-5594-18ef-c82a-679b606d1bd3" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_CashAndCashEquivalentsAtCarryingValue" xlink:label="loc_us-gaap_CashAndCashEquivalentsAtCarryingValue_07da1db4-2708-4446-4250-1fdd5956185e" xlink:type="locator" />
    <link:calculationArc order="2" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_c6057b1d-6685-8249-2051-6c57f3a16a9e" xlink:to="loc_us-gaap_CashAndCashEquivalentsAtCarryingValue_07da1db4-2708-4446-4250-1fdd5956185e" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_PremiumsReceivableAtCarryingValue" xlink:label="loc_us-gaap_PremiumsReceivableAtCarryingValue_be417020-091a-c263-d2a6-d955525abcb4" xlink:type="locator" />
    <link:calculationArc order="3" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_c6057b1d-6685-8249-2051-6c57f3a16a9e" xlink:to="loc_us-gaap_PremiumsReceivableAtCarryingValue_be417020-091a-c263-d2a6-d955525abcb4" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_AccruedInvestmentIncomeReceivable" xlink:label="loc_us-gaap_AccruedInvestmentIncomeReceivable_1d6b0581-e24d-9a5d-0503-a30115a080d6" xlink:type="locator" />
    <link:calculationArc order="4" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_c6057b1d-6685-8249-2051-6c57f3a16a9e" xlink:to="loc_us-gaap_AccruedInvestmentIncomeReceivable_1d6b0581-e24d-9a5d-0503-a30115a080d6" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_PrepaidExpenseCurrentAndNoncurrent" xlink:label="loc_us-gaap_PrepaidExpenseCurrentAndNoncurrent_d3cee2e8-8c30-6786-1a8c-f18071d15caf" xlink:type="locator" />
    <link:calculationArc order="5" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_c6057b1d-6685-8249-2051-6c57f3a16a9e" xlink:to="loc_us-gaap_PrepaidExpenseCurrentAndNoncurrent_d3cee2e8-8c30-6786-1a8c-f18071d15caf" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_DeferredPolicyAcquisitionCosts" xlink:label="loc_us-gaap_DeferredPolicyAcquisitionCosts_8e926a0d-ae3c-52a1-1b98-3257b68b1c70" xlink:type="locator" />
    <link:calculationArc order="6" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_c6057b1d-6685-8249-2051-6c57f3a16a9e" xlink:to="loc_us-gaap_DeferredPolicyAcquisitionCosts_8e926a0d-ae3c-52a1-1b98-3257b68b1c70" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_PropertyPlantAndEquipmentNet" xlink:label="loc_us-gaap_PropertyPlantAndEquipmentNet_1944a381-5c4e-ce3c-9111-13ccd1c639db" xlink:type="locator" />
    <link:calculationArc order="7" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_c6057b1d-6685-8249-2051-6c57f3a16a9e" xlink:to="loc_us-gaap_PropertyPlantAndEquipmentNet_1944a381-5c4e-ce3c-9111-13ccd1c639db" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_IntangibleAssetsNetIncludingGoodwill" xlink:label="loc_us-gaap_IntangibleAssetsNetIncludingGoodwill_c04dd71c-529e-62f9-136d-a0a478e6fbc1" xlink:type="locator" />
    <link:calculationArc order="8" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_c6057b1d-6685-8249-2051-6c57f3a16a9e" xlink:to="loc_us-gaap_IntangibleAssetsNetIncludingGoodwill_c04dd71c-529e-62f9-136d-a0a478e6fbc1" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_OtherAssets" xlink:label="loc_us-gaap_OtherAssets_cb56b01f-b9c5-ca9e-8988-e23b27fc7a20" xlink:type="locator" />
    <link:calculationArc order="9" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_c6057b1d-6685-8249-2051-6c57f3a16a9e" xlink:to="loc_us-gaap_OtherAssets_cb56b01f-b9c5-ca9e-8988-e23b27fc7a20" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_PrepaidReinsurancePremiums" xlink:label="loc_us-gaap_PrepaidReinsurancePremiums_8f6a0cec-336e-2218-06a1-14a2fb21b004" xlink:type="locator" />
    <link:calculationArc order="10" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_c6057b1d-6685-8249-2051-6c57f3a16a9e" xlink:to="loc_us-gaap_PrepaidReinsurancePremiums_8f6a0cec-336e-2218-06a1-14a2fb21b004" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_DeferredIncomeTaxAssetsNet" xlink:label="loc_us-gaap_DeferredIncomeTaxAssetsNet_0c301281-b140-dfcb-9991-ae503484f9da" xlink:type="locator" />
    <link:calculationArc order="11" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_c6057b1d-6685-8249-2051-6c57f3a16a9e" xlink:to="loc_us-gaap_DeferredIncomeTaxAssetsNet_0c301281-b140-dfcb-9991-ae503484f9da" xlink:type="arc" />
  </link:calculationLink>
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/ConsolidatedBalanceSheetsParenthetical" xlink:type="extended" />
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/ConsolidatedStatementsOfCashFlows" xlink:type="extended">
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_CashAndCashEquivalentsPeriodIncreaseDecrease" xlink:label="loc_us-gaap_CashAndCashEquivalentsPeriodIncreaseDecrease_dd2e9db6-10f9-d78a-ba84-b18268245a83" xlink:type="locator" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_NetCashProvidedByUsedInOperatingActivities" xlink:label="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_444b1ac7-f47a-4ce3-0caa-537f7e4ab8c3" xlink:type="locator" />
    <link:calculationArc order="1" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_CashAndCashEquivalentsPeriodIncreaseDecrease_dd2e9db6-10f9-d78a-ba84-b18268245a83" xlink:to="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_444b1ac7-f47a-4ce3-0caa-537f7e4ab8c3" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_NetIncomeLoss" xlink:label="loc_us-gaap_NetIncomeLoss_641b1cab-a2b3-2e0e-8389-1455ff3f8581" xlink:type="locator" />
    <link:calculationArc order="1" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_444b1ac7-f47a-4ce3-0caa-537f7e4ab8c3" xlink:to="loc_us-gaap_NetIncomeLoss_641b1cab-a2b3-2e0e-8389-1455ff3f8581" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_AvailableForSaleSecuritiesGrossRealizedGainLossNet" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesGrossRealizedGainLossNet_55f58d9b-a4cc-27e0-d4b9-b08916d106f9" xlink:type="locator" />
    <link:calculationArc order="2" weight="-1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_444b1ac7-f47a-4ce3-0caa-537f7e4ab8c3" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesGrossRealizedGainLossNet_55f58d9b-a4cc-27e0-d4b9-b08916d106f9" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_FairValueAdjustmentOfWarrants" xlink:label="loc_us-gaap_FairValueAdjustmentOfWarrants_a03c3c0d-252e-29bc-7cf3-bf2d2a4db702" xlink:type="locator" />
    <link:calculationArc order="3" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_444b1ac7-f47a-4ce3-0caa-537f7e4ab8c3" xlink:to="loc_us-gaap_FairValueAdjustmentOfWarrants_a03c3c0d-252e-29bc-7cf3-bf2d2a4db702" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_DepreciationAmortizationAndAccretionNet" xlink:label="loc_us-gaap_DepreciationAmortizationAndAccretionNet_9b039144-dc24-2381-1de5-20fa04e9b091" xlink:type="locator" />
    <link:calculationArc order="4" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_444b1ac7-f47a-4ce3-0caa-537f7e4ab8c3" xlink:to="loc_us-gaap_DepreciationAmortizationAndAccretionNet_9b039144-dc24-2381-1de5-20fa04e9b091" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_AccretionAmortizationOfDiscountsAndPremiumsInvestments" xlink:label="loc_us-gaap_AccretionAmortizationOfDiscountsAndPremiumsInvestments_ee12cc29-63c9-040c-19f2-17921f90c9bb" xlink:type="locator" />
    <link:calculationArc order="5" weight="-1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_444b1ac7-f47a-4ce3-0caa-537f7e4ab8c3" xlink:to="loc_us-gaap_AccretionAmortizationOfDiscountsAndPremiumsInvestments_ee12cc29-63c9-040c-19f2-17921f90c9bb" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_AmortizationOfFinancingCostsAndDiscounts" xlink:label="loc_us-gaap_AmortizationOfFinancingCostsAndDiscounts_e9a2cdf1-6f49-806b-7b55-b9320bcfa87f" xlink:type="locator" />
    <link:calculationArc order="6" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_444b1ac7-f47a-4ce3-0caa-537f7e4ab8c3" xlink:to="loc_us-gaap_AmortizationOfFinancingCostsAndDiscounts_e9a2cdf1-6f49-806b-7b55-b9320bcfa87f" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_DeferredIncomeTaxesAndTaxCredits" xlink:label="loc_us-gaap_DeferredIncomeTaxesAndTaxCredits_68e10ff8-b323-b033-86bb-bb6c9af3232f" xlink:type="locator" />
    <link:calculationArc order="7" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_444b1ac7-f47a-4ce3-0caa-537f7e4ab8c3" xlink:to="loc_us-gaap_DeferredIncomeTaxesAndTaxCredits_68e10ff8-b323-b033-86bb-bb6c9af3232f" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_ShareBasedCompensation" xlink:label="loc_us-gaap_ShareBasedCompensation_e3eecf87-b290-4567-8a59-5b0a8e27c85b" xlink:type="locator" />
    <link:calculationArc order="8" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_444b1ac7-f47a-4ce3-0caa-537f7e4ab8c3" xlink:to="loc_us-gaap_ShareBasedCompensation_e3eecf87-b290-4567-8a59-5b0a8e27c85b" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_IncreaseDecreaseInPremiumsReceivable" xlink:label="loc_us-gaap_IncreaseDecreaseInPremiumsReceivable_f48a1e38-4541-9f1d-c2d3-2cb5044729fc" xlink:type="locator" />
    <link:calculationArc order="9" weight="-1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_444b1ac7-f47a-4ce3-0caa-537f7e4ab8c3" xlink:to="loc_us-gaap_IncreaseDecreaseInPremiumsReceivable_f48a1e38-4541-9f1d-c2d3-2cb5044729fc" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_IncreaseDecreaseInAccruedInvestmentIncomeReceivable" xlink:label="loc_us-gaap_IncreaseDecreaseInAccruedInvestmentIncomeReceivable_d0ac35d1-6695-bbdc-e394-1c58dea12a0d" xlink:type="locator" />
    <link:calculationArc order="10" weight="-1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_444b1ac7-f47a-4ce3-0caa-537f7e4ab8c3" xlink:to="loc_us-gaap_IncreaseDecreaseInAccruedInvestmentIncomeReceivable_d0ac35d1-6695-bbdc-e394-1c58dea12a0d" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_IncreaseDecreaseInPrepaidExpense" xlink:label="loc_us-gaap_IncreaseDecreaseInPrepaidExpense_041c459c-7014-17e7-2bb4-75218378e2d8" xlink:type="locator" />
    <link:calculationArc order="11" weight="-1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_444b1ac7-f47a-4ce3-0caa-537f7e4ab8c3" xlink:to="loc_us-gaap_IncreaseDecreaseInPrepaidExpense_041c459c-7014-17e7-2bb4-75218378e2d8" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_IncreaseDecreaseInDeferredPolicyAcquisitionCosts" xlink:label="loc_us-gaap_IncreaseDecreaseInDeferredPolicyAcquisitionCosts_f59b6361-0b52-d1f5-6086-dfb9da7d9962" xlink:type="locator" />
    <link:calculationArc order="12" weight="-1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_444b1ac7-f47a-4ce3-0caa-537f7e4ab8c3" xlink:to="loc_us-gaap_IncreaseDecreaseInDeferredPolicyAcquisitionCosts_f59b6361-0b52-d1f5-6086-dfb9da7d9962" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_IncreaseDecreaseInPrepaidDeferredExpenseAndOtherAssets" xlink:label="loc_us-gaap_IncreaseDecreaseInPrepaidDeferredExpenseAndOtherAssets_c998cbd2-a633-c2ec-1932-e3bfedecbc9f" xlink:type="locator" />
    <link:calculationArc order="13" weight="-1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_444b1ac7-f47a-4ce3-0caa-537f7e4ab8c3" xlink:to="loc_us-gaap_IncreaseDecreaseInPrepaidDeferredExpenseAndOtherAssets_c998cbd2-a633-c2ec-1932-e3bfedecbc9f" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_IncreaseDecreaseInUnearnedPremiums" xlink:label="loc_us-gaap_IncreaseDecreaseInUnearnedPremiums_ecf97577-7819-1692-4035-4906cbae67c9" xlink:type="locator" />
    <link:calculationArc order="14" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_444b1ac7-f47a-4ce3-0caa-537f7e4ab8c3" xlink:to="loc_us-gaap_IncreaseDecreaseInUnearnedPremiums_ecf97577-7819-1692-4035-4906cbae67c9" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_IncreaseDecreaseInLiabilityForClaimsAndClaimsAdjustmentExpenseReserve" xlink:label="loc_us-gaap_IncreaseDecreaseInLiabilityForClaimsAndClaimsAdjustmentExpenseReserve_21d53f02-1f17-80b2-7ac9-351a0e030233" xlink:type="locator" />
    <link:calculationArc order="15" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_444b1ac7-f47a-4ce3-0caa-537f7e4ab8c3" xlink:to="loc_us-gaap_IncreaseDecreaseInLiabilityForClaimsAndClaimsAdjustmentExpenseReserve_21d53f02-1f17-80b2-7ac9-351a0e030233" xlink:type="arc" />
    <link:loc xlink:href="nmih-20171231.xsd#nmih_IncreaseDecreaseinReinsuranceAssetsandLiabilities" xlink:label="loc_nmih_IncreaseDecreaseinReinsuranceAssetsandLiabilities_a65a36d1-54fe-00db-3755-ed488331b2db" xlink:type="locator" />
    <link:calculationArc order="16" weight="-1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_444b1ac7-f47a-4ce3-0caa-537f7e4ab8c3" xlink:to="loc_nmih_IncreaseDecreaseinReinsuranceAssetsandLiabilities_a65a36d1-54fe-00db-3755-ed488331b2db" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_IncreaseDecreaseInAccountsPayableAndAccruedLiabilities" xlink:label="loc_us-gaap_IncreaseDecreaseInAccountsPayableAndAccruedLiabilities_73e959a8-32b6-697e-66b5-86ef5a29476e" xlink:type="locator" />
    <link:calculationArc order="17" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_444b1ac7-f47a-4ce3-0caa-537f7e4ab8c3" xlink:to="loc_us-gaap_IncreaseDecreaseInAccountsPayableAndAccruedLiabilities_73e959a8-32b6-697e-66b5-86ef5a29476e" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_NetCashProvidedByUsedInInvestingActivities" xlink:label="loc_us-gaap_NetCashProvidedByUsedInInvestingActivities_70319186-e7bd-7189-88d2-eba26fb93350" xlink:type="locator" />
    <link:calculationArc order="2" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_CashAndCashEquivalentsPeriodIncreaseDecrease_dd2e9db6-10f9-d78a-ba84-b18268245a83" xlink:to="loc_us-gaap_NetCashProvidedByUsedInInvestingActivities_70319186-e7bd-7189-88d2-eba26fb93350" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_NetCashProvidedByUsedInFinancingActivities" xlink:label="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_deb49b68-c030-7624-a39d-ea301caa5dbf" xlink:type="locator" />
    <link:calculationArc order="3" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_CashAndCashEquivalentsPeriodIncreaseDecrease_dd2e9db6-10f9-d78a-ba84-b18268245a83" xlink:to="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_deb49b68-c030-7624-a39d-ea301caa5dbf" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_PaymentsRelatedToTaxWithholdingForShareBasedCompensation" xlink:label="loc_us-gaap_PaymentsRelatedToTaxWithholdingForShareBasedCompensation_6d67f644-e190-e5ce-9449-e00a27ad7771" xlink:type="locator" />
    <link:calculationArc order="1" weight="-1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_deb49b68-c030-7624-a39d-ea301caa5dbf" xlink:to="loc_us-gaap_PaymentsRelatedToTaxWithholdingForShareBasedCompensation_6d67f644-e190-e5ce-9449-e00a27ad7771" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_ProceedsFromIssuanceOfSharesUnderIncentiveAndShareBasedCompensationPlansIncludingStockOptions" xlink:label="loc_us-gaap_ProceedsFromIssuanceOfSharesUnderIncentiveAndShareBasedCompensationPlansIncludingStockOptions_d59a921e-6301-0411-46e6-49b6a981f8a0" xlink:type="locator" />
    <link:calculationArc order="2" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_deb49b68-c030-7624-a39d-ea301caa5dbf" xlink:to="loc_us-gaap_ProceedsFromIssuanceOfSharesUnderIncentiveAndShareBasedCompensationPlansIncludingStockOptions_d59a921e-6301-0411-46e6-49b6a981f8a0" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_ProceedsFromIssuanceOfCommonStock" xlink:label="loc_us-gaap_ProceedsFromIssuanceOfCommonStock_dbbd5d91-eb58-fa81-2753-d9ddf4ada4c1" xlink:type="locator" />
    <link:calculationArc order="3" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_deb49b68-c030-7624-a39d-ea301caa5dbf" xlink:to="loc_us-gaap_ProceedsFromIssuanceOfCommonStock_dbbd5d91-eb58-fa81-2753-d9ddf4ada4c1" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_ProceedsFromIssuanceOfLongTermDebt" xlink:label="loc_us-gaap_ProceedsFromIssuanceOfLongTermDebt_e5f1c7a4-b42a-8461-2001-b1f20e51b257" xlink:type="locator" />
    <link:calculationArc order="4" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_deb49b68-c030-7624-a39d-ea301caa5dbf" xlink:to="loc_us-gaap_ProceedsFromIssuanceOfLongTermDebt_e5f1c7a4-b42a-8461-2001-b1f20e51b257" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_RepaymentsOfLongTermDebt" xlink:label="loc_us-gaap_RepaymentsOfLongTermDebt_2b72fe5f-3c0e-d5e0-8e5c-ad01818e58e5" xlink:type="locator" />
    <link:calculationArc order="5" weight="-1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_deb49b68-c030-7624-a39d-ea301caa5dbf" xlink:to="loc_us-gaap_RepaymentsOfLongTermDebt_2b72fe5f-3c0e-d5e0-8e5c-ad01818e58e5" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_PaymentsOfDebtIssuanceCosts" xlink:label="loc_us-gaap_PaymentsOfDebtIssuanceCosts_f19a6911-0ca9-0f7f-0ae8-f18c6d766244" xlink:type="locator" />
    <link:calculationArc order="6" weight="-1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_deb49b68-c030-7624-a39d-ea301caa5dbf" xlink:to="loc_us-gaap_PaymentsOfDebtIssuanceCosts_f19a6911-0ca9-0f7f-0ae8-f18c6d766244" xlink:type="arc" />
  </link:calculationLink>
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/ConsolidatedStatementsOfChangesInShareholdersEquity" xlink:type="extended" />
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/ConsolidatedStatementsOfChangesInShareholdersEquityParenthetical" xlink:type="extended" />
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/ConsolidatedStatementsOfComprehensiveIncomeLoss" xlink:type="extended">
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_Revenues" xlink:label="loc_us-gaap_Revenues_33f76b65-31cf-be04-0849-25af345446d5" xlink:type="locator" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_NetInvestmentIncome" xlink:label="loc_us-gaap_NetInvestmentIncome_243e39d2-c96c-5840-e3a4-fd18bdefd7e9" xlink:type="locator" />
    <link:calculationArc order="1" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Revenues_33f76b65-31cf-be04-0849-25af345446d5" xlink:to="loc_us-gaap_NetInvestmentIncome_243e39d2-c96c-5840-e3a4-fd18bdefd7e9" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_AvailableForSaleSecuritiesGrossRealizedGainLossNet" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesGrossRealizedGainLossNet_55f58d9b-a4cc-27e0-d4b9-b08916d106f9" xlink:type="locator" />
    <link:calculationArc order="2" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Revenues_33f76b65-31cf-be04-0849-25af345446d5" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesGrossRealizedGainLossNet_55f58d9b-a4cc-27e0-d4b9-b08916d106f9" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_OtherSalesRevenueNet" xlink:label="loc_us-gaap_OtherSalesRevenueNet_e7cc3a47-5261-0c18-da28-7de072dc978b" xlink:type="locator" />
    <link:calculationArc order="3" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Revenues_33f76b65-31cf-be04-0849-25af345446d5" xlink:to="loc_us-gaap_OtherSalesRevenueNet_e7cc3a47-5261-0c18-da28-7de072dc978b" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_PremiumsEarnedNet" xlink:label="loc_us-gaap_PremiumsEarnedNet_c064cba7-a0d7-dfb0-7513-652e64da6752" xlink:type="locator" />
    <link:calculationArc order="4" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Revenues_33f76b65-31cf-be04-0849-25af345446d5" xlink:to="loc_us-gaap_PremiumsEarnedNet_c064cba7-a0d7-dfb0-7513-652e64da6752" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_OtherNonoperatingIncomeExpense" xlink:label="loc_us-gaap_OtherNonoperatingIncomeExpense_250c3b2f-7db5-7088-68cc-1dd831a2c2d7" xlink:type="locator" />
    <link:loc xlink:href="nmih-20171231.xsd#nmih_GainLossonChangeinFairValueofWarrantLiability" xlink:label="loc_nmih_GainLossonChangeinFairValueofWarrantLiability_bfe22694-c47b-6c8b-192c-ed48833b37f5" xlink:type="locator" />
    <link:calculationArc order="1" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_OtherNonoperatingIncomeExpense_250c3b2f-7db5-7088-68cc-1dd831a2c2d7" xlink:to="loc_nmih_GainLossonChangeinFairValueofWarrantLiability_bfe22694-c47b-6c8b-192c-ed48833b37f5" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_InterestExpense" xlink:label="loc_us-gaap_InterestExpense_7c9599ab-2a77-022c-c720-63fecff6a62c" xlink:type="locator" />
    <link:calculationArc order="2" weight="-1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_OtherNonoperatingIncomeExpense_250c3b2f-7db5-7088-68cc-1dd831a2c2d7" xlink:to="loc_us-gaap_InterestExpense_7c9599ab-2a77-022c-c720-63fecff6a62c" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_CostsAndExpenses" xlink:label="loc_us-gaap_CostsAndExpenses_0d9ff7d0-e871-5bdf-adbd-21d7dbf57556" xlink:type="locator" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_IncurredClaimsPropertyCasualtyAndLiability" xlink:label="loc_us-gaap_IncurredClaimsPropertyCasualtyAndLiability_8bafbca5-1c3d-f2f2-4ee0-16128245fff8" xlink:type="locator" />
    <link:calculationArc order="1" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_CostsAndExpenses_0d9ff7d0-e871-5bdf-adbd-21d7dbf57556" xlink:to="loc_us-gaap_IncurredClaimsPropertyCasualtyAndLiability_8bafbca5-1c3d-f2f2-4ee0-16128245fff8" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_OtherCostAndExpenseOperating" xlink:label="loc_us-gaap_OtherCostAndExpenseOperating_b0184ecc-12ea-c485-85c0-5fa141798e88" xlink:type="locator" />
    <link:calculationArc order="2" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_CostsAndExpenses_0d9ff7d0-e871-5bdf-adbd-21d7dbf57556" xlink:to="loc_us-gaap_OtherCostAndExpenseOperating_b0184ecc-12ea-c485-85c0-5fa141798e88" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_ComprehensiveIncomeNetOfTax" xlink:label="loc_us-gaap_ComprehensiveIncomeNetOfTax_499015ce-2160-aed2-85a3-080e8c4c6cdf" xlink:type="locator" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_NetIncomeLoss" xlink:label="loc_us-gaap_NetIncomeLoss_641b1cab-a2b3-2e0e-8389-1455ff3f8581" xlink:type="locator" />
    <link:calculationArc order="1" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_ComprehensiveIncomeNetOfTax_499015ce-2160-aed2-85a3-080e8c4c6cdf" xlink:to="loc_us-gaap_NetIncomeLoss_641b1cab-a2b3-2e0e-8389-1455ff3f8581" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest" xlink:label="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest_a53f52a4-7a54-3283-f734-95683c76ebff" xlink:type="locator" />
    <link:calculationArc order="1" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetIncomeLoss_641b1cab-a2b3-2e0e-8389-1455ff3f8581" xlink:to="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest_a53f52a4-7a54-3283-f734-95683c76ebff" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_IncomeTaxExpenseBenefit" xlink:label="loc_us-gaap_IncomeTaxExpenseBenefit_78b7d85e-8366-fe6d-cb1f-faac5a041b79" xlink:type="locator" />
    <link:calculationArc order="2" weight="-1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetIncomeLoss_641b1cab-a2b3-2e0e-8389-1455ff3f8581" xlink:to="loc_us-gaap_IncomeTaxExpenseBenefit_78b7d85e-8366-fe6d-cb1f-faac5a041b79" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent" xlink:label="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent_72d12753-e25c-cdc0-88b6-98db8d7b7fae" xlink:type="locator" />
    <link:calculationArc order="2" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_ComprehensiveIncomeNetOfTax_499015ce-2160-aed2-85a3-080e8c4c6cdf" xlink:to="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent_72d12753-e25c-cdc0-88b6-98db8d7b7fae" xlink:type="arc" />
  </link:calculationLink>
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/ConsolidatedStatementsOfComprehensiveIncomeLossParenthetical" xlink:type="extended" />
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/DocumentAndEntityInformation" xlink:type="extended" />
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/EarningsLossPerShareEps" xlink:type="extended" />
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/EarningsLossPerShareEpsComputationOfBasicAndDilutedEarningsLossPerShareDetails" xlink:type="extended">
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_WeightedAverageNumberOfDilutedSharesOutstanding" xlink:label="loc_us-gaap_WeightedAverageNumberOfDilutedSharesOutstanding_223fd9c8-68e8-e433-7c40-f98b238e79de" xlink:type="locator" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_WeightedAverageNumberOfSharesOutstandingBasic" xlink:label="loc_us-gaap_WeightedAverageNumberOfSharesOutstandingBasic_86e61cf2-b7b2-e230-65f1-5a2b152f3a30" xlink:type="locator" />
    <link:calculationArc order="1" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_WeightedAverageNumberOfDilutedSharesOutstanding_223fd9c8-68e8-e433-7c40-f98b238e79de" xlink:to="loc_us-gaap_WeightedAverageNumberOfSharesOutstandingBasic_86e61cf2-b7b2-e230-65f1-5a2b152f3a30" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_WeightedAverageNumberDilutedSharesOutstandingAdjustment" xlink:label="loc_us-gaap_WeightedAverageNumberDilutedSharesOutstandingAdjustment_7b1369dd-f813-fe00-b292-96e275568f1b" xlink:type="locator" />
    <link:calculationArc order="2" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_WeightedAverageNumberOfDilutedSharesOutstanding_223fd9c8-68e8-e433-7c40-f98b238e79de" xlink:to="loc_us-gaap_WeightedAverageNumberDilutedSharesOutstandingAdjustment_7b1369dd-f813-fe00-b292-96e275568f1b" xlink:type="arc" />
  </link:calculationLink>
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/EarningsLossPerShareEpsTables" xlink:type="extended" />
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/FairValueOfFinancialInstruments" xlink:type="extended" />
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/FairValueOfFinancialInstrumentsAssetsAndLiabilitiesAtFairValueDetails" xlink:type="extended">
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_LiabilitiesFairValueDisclosure" xlink:label="loc_us-gaap_LiabilitiesFairValueDisclosure_61bb41c2-5e2c-2804-d184-f566af2acbb1" xlink:type="locator" />
    <link:loc xlink:href="nmih-20171231.xsd#nmih_WarrantLiability" xlink:label="loc_nmih_WarrantLiability_da32994b-aa10-87ec-6ac0-ed48832cde69" xlink:type="locator" />
    <link:calculationArc order="1" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_LiabilitiesFairValueDisclosure_61bb41c2-5e2c-2804-d184-f566af2acbb1" xlink:to="loc_nmih_WarrantLiability_da32994b-aa10-87ec-6ac0-ed48832cde69" xlink:type="arc" />
  </link:calculationLink>
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/FairValueOfFinancialInstrumentsRollFowardOfLevel3LiabilitiesMeasuredAtFairValueDetails" xlink:type="extended" />
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/FairValueOfFinancialInstrumentsTables" xlink:type="extended" />
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/FairValueOfFinancialInstrumentsValuationAssumptionsForWarrantLiabilitiesDetails" xlink:type="extended" />
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/IncomeTaxes" xlink:type="extended" />
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/IncomeTaxesComponentsOfProvisionForIncomeTaxesBenefitsDetails" xlink:type="extended">
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_IncomeTaxExpenseBenefit" xlink:label="loc_us-gaap_IncomeTaxExpenseBenefit_78b7d85e-8366-fe6d-cb1f-faac5a041b79" xlink:type="locator" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_CurrentIncomeTaxExpenseBenefit" xlink:label="loc_us-gaap_CurrentIncomeTaxExpenseBenefit_d2250640-c0ab-3b70-41b7-136d9a4aad78" xlink:type="locator" />
    <link:calculationArc order="1" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_IncomeTaxExpenseBenefit_78b7d85e-8366-fe6d-cb1f-faac5a041b79" xlink:to="loc_us-gaap_CurrentIncomeTaxExpenseBenefit_d2250640-c0ab-3b70-41b7-136d9a4aad78" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_DeferredIncomeTaxExpenseBenefit" xlink:label="loc_us-gaap_DeferredIncomeTaxExpenseBenefit_f75d01b7-d271-b07d-c4a7-6ae60293303d" xlink:type="locator" />
    <link:calculationArc order="2" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_IncomeTaxExpenseBenefit_78b7d85e-8366-fe6d-cb1f-faac5a041b79" xlink:to="loc_us-gaap_DeferredIncomeTaxExpenseBenefit_f75d01b7-d271-b07d-c4a7-6ae60293303d" xlink:type="arc" />
  </link:calculationLink>
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/IncomeTaxesDeferredTaxAssetAndLiabilitiesDetails" xlink:type="extended">
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_DeferredTaxAssetsLiabilitiesNet" xlink:label="loc_us-gaap_DeferredTaxAssetsLiabilitiesNet_b361a033-37cf-a2bc-6e1f-0297b90aa5a9" xlink:type="locator" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_DeferredTaxAssetsNet" xlink:label="loc_us-gaap_DeferredTaxAssetsNet_d74724c2-178d-7f3f-8e86-5f5ba690672c" xlink:type="locator" />
    <link:calculationArc order="1" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_DeferredTaxAssetsLiabilitiesNet_b361a033-37cf-a2bc-6e1f-0297b90aa5a9" xlink:to="loc_us-gaap_DeferredTaxAssetsNet_d74724c2-178d-7f3f-8e86-5f5ba690672c" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_DeferredTaxAssetsGross" xlink:label="loc_us-gaap_DeferredTaxAssetsGross_40f9cbe3-f1cd-d4d3-e7be-f62e64714b00" xlink:type="locator" />
    <link:calculationArc order="1" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_DeferredTaxAssetsNet_d74724c2-178d-7f3f-8e86-5f5ba690672c" xlink:to="loc_us-gaap_DeferredTaxAssetsGross_40f9cbe3-f1cd-d4d3-e7be-f62e64714b00" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_DeferredTaxAssetsOperatingLossCarryforwards" xlink:label="loc_us-gaap_DeferredTaxAssetsOperatingLossCarryforwards_3541201a-a025-b00d-aec1-2cb167bdef44" xlink:type="locator" />
    <link:calculationArc order="1" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_DeferredTaxAssetsGross_40f9cbe3-f1cd-d4d3-e7be-f62e64714b00" xlink:to="loc_us-gaap_DeferredTaxAssetsOperatingLossCarryforwards_3541201a-a025-b00d-aec1-2cb167bdef44" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_DeferredTaxAssetsTaxDeferredExpenseCompensationAndBenefitsShareBasedCompensationCost" xlink:label="loc_us-gaap_DeferredTaxAssetsTaxDeferredExpenseCompensationAndBenefitsShareBasedCompensationCost_f7e9e6da-5d57-5f97-5d33-52f319506ef0" xlink:type="locator" />
    <link:calculationArc order="2" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_DeferredTaxAssetsGross_40f9cbe3-f1cd-d4d3-e7be-f62e64714b00" xlink:to="loc_us-gaap_DeferredTaxAssetsTaxDeferredExpenseCompensationAndBenefitsShareBasedCompensationCost_f7e9e6da-5d57-5f97-5d33-52f319506ef0" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_DeferredTaxAssetsTaxDeferredExpenseReservesAndAccrualsUnearnedPremiumsReserve" xlink:label="loc_us-gaap_DeferredTaxAssetsTaxDeferredExpenseReservesAndAccrualsUnearnedPremiumsReserve_0e61eb3c-39a4-7b0f-5dab-0a89394cdc26" xlink:type="locator" />
    <link:calculationArc order="3" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_DeferredTaxAssetsGross_40f9cbe3-f1cd-d4d3-e7be-f62e64714b00" xlink:to="loc_us-gaap_DeferredTaxAssetsTaxDeferredExpenseReservesAndAccrualsUnearnedPremiumsReserve_0e61eb3c-39a4-7b0f-5dab-0a89394cdc26" xlink:type="arc" />
    <link:loc xlink:href="nmih-20171231.xsd#nmih_DeferredTaxAssetsTaxDeferredExpenseStartupCosts" xlink:label="loc_nmih_DeferredTaxAssetsTaxDeferredExpenseStartupCosts_7bb17ee5-9438-c438-caaf-b850143224ab" xlink:type="locator" />
    <link:calculationArc order="4" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_DeferredTaxAssetsGross_40f9cbe3-f1cd-d4d3-e7be-f62e64714b00" xlink:to="loc_nmih_DeferredTaxAssetsTaxDeferredExpenseStartupCosts_7bb17ee5-9438-c438-caaf-b850143224ab" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_DeferredTaxAssetsInvestments" xlink:label="loc_us-gaap_DeferredTaxAssetsInvestments_b8a5e3b7-9760-db89-d068-003657b47288" xlink:type="locator" />
    <link:calculationArc order="5" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_DeferredTaxAssetsGross_40f9cbe3-f1cd-d4d3-e7be-f62e64714b00" xlink:to="loc_us-gaap_DeferredTaxAssetsInvestments_b8a5e3b7-9760-db89-d068-003657b47288" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_DeferredTaxAssetsTaxCreditCarryforwardsAlternativeMinimumTax" xlink:label="loc_us-gaap_DeferredTaxAssetsTaxCreditCarryforwardsAlternativeMinimumTax_90bbcb15-a179-1dbd-046f-2ab7486eb80c" xlink:type="locator" />
    <link:calculationArc order="6" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_DeferredTaxAssetsGross_40f9cbe3-f1cd-d4d3-e7be-f62e64714b00" xlink:to="loc_us-gaap_DeferredTaxAssetsTaxCreditCarryforwardsAlternativeMinimumTax_90bbcb15-a179-1dbd-046f-2ab7486eb80c" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_DeferredTaxAssetsOther" xlink:label="loc_us-gaap_DeferredTaxAssetsOther_91623f44-5f42-408a-f7b7-7a4698afab83" xlink:type="locator" />
    <link:calculationArc order="7" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_DeferredTaxAssetsGross_40f9cbe3-f1cd-d4d3-e7be-f62e64714b00" xlink:to="loc_us-gaap_DeferredTaxAssetsOther_91623f44-5f42-408a-f7b7-7a4698afab83" xlink:type="arc" />
    <link:loc xlink:href="nmih-20171231.xsd#nmih_DeferredTaxAssetsDeferredCedingCommissions" xlink:label="loc_nmih_DeferredTaxAssetsDeferredCedingCommissions_dc537e2b-0e61-edec-5bb8-b8501444ac74" xlink:type="locator" />
    <link:calculationArc order="8" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_DeferredTaxAssetsGross_40f9cbe3-f1cd-d4d3-e7be-f62e64714b00" xlink:to="loc_nmih_DeferredTaxAssetsDeferredCedingCommissions_dc537e2b-0e61-edec-5bb8-b8501444ac74" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_DeferredTaxAssetsValuationAllowance" xlink:label="loc_us-gaap_DeferredTaxAssetsValuationAllowance_46929883-d93f-69b0-5ded-4c800feeb57f" xlink:type="locator" />
    <link:calculationArc order="2" weight="-1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_DeferredTaxAssetsNet_d74724c2-178d-7f3f-8e86-5f5ba690672c" xlink:to="loc_us-gaap_DeferredTaxAssetsValuationAllowance_46929883-d93f-69b0-5ded-4c800feeb57f" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_DeferredIncomeTaxLiabilities" xlink:label="loc_us-gaap_DeferredIncomeTaxLiabilities_bbf9fd06-b461-3f65-8882-6e322d99a60b" xlink:type="locator" />
    <link:calculationArc order="2" weight="-1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_DeferredTaxAssetsLiabilitiesNet_b361a033-37cf-a2bc-6e1f-0297b90aa5a9" xlink:to="loc_us-gaap_DeferredIncomeTaxLiabilities_bbf9fd06-b461-3f65-8882-6e322d99a60b" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_DeferredTaxLiabilitiesDeferredExpenseDeferredPolicyAcquisitionCost" xlink:label="loc_us-gaap_DeferredTaxLiabilitiesDeferredExpenseDeferredPolicyAcquisitionCost_948c71cd-f4f9-844f-e6cf-93d7e9a274ac" xlink:type="locator" />
    <link:calculationArc order="1" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_DeferredIncomeTaxLiabilities_bbf9fd06-b461-3f65-8882-6e322d99a60b" xlink:to="loc_us-gaap_DeferredTaxLiabilitiesDeferredExpenseDeferredPolicyAcquisitionCost_948c71cd-f4f9-844f-e6cf-93d7e9a274ac" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_DeferredTaxLiabilitiesDeferredExpenseCapitalizedSoftware" xlink:label="loc_us-gaap_DeferredTaxLiabilitiesDeferredExpenseCapitalizedSoftware_fac6ebaa-e76f-3823-464d-7a122813090b" xlink:type="locator" />
    <link:calculationArc order="2" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_DeferredIncomeTaxLiabilities_bbf9fd06-b461-3f65-8882-6e322d99a60b" xlink:to="loc_us-gaap_DeferredTaxLiabilitiesDeferredExpenseCapitalizedSoftware_fac6ebaa-e76f-3823-464d-7a122813090b" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_DeferredTaxLiabilitiesInvestments" xlink:label="loc_us-gaap_DeferredTaxLiabilitiesInvestments_11fe7ea9-3f55-290e-87ec-27a8ad4ddaee" xlink:type="locator" />
    <link:calculationArc order="3" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_DeferredIncomeTaxLiabilities_bbf9fd06-b461-3f65-8882-6e322d99a60b" xlink:to="loc_us-gaap_DeferredTaxLiabilitiesInvestments_11fe7ea9-3f55-290e-87ec-27a8ad4ddaee" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_DeferredTaxLiabilitiesGoodwillAndIntangibleAssetsIntangibleAssets" xlink:label="loc_us-gaap_DeferredTaxLiabilitiesGoodwillAndIntangibleAssetsIntangibleAssets_d1de4f5a-e70f-c355-7179-89a9064c7b88" xlink:type="locator" />
    <link:calculationArc order="4" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_DeferredIncomeTaxLiabilities_bbf9fd06-b461-3f65-8882-6e322d99a60b" xlink:to="loc_us-gaap_DeferredTaxLiabilitiesGoodwillAndIntangibleAssetsIntangibleAssets_d1de4f5a-e70f-c355-7179-89a9064c7b88" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_DeferredTaxLiabilitiesOther" xlink:label="loc_us-gaap_DeferredTaxLiabilitiesOther_40c7d4a7-f1a1-0c55-497e-f9a3bb09604c" xlink:type="locator" />
    <link:calculationArc order="5" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_DeferredIncomeTaxLiabilities_bbf9fd06-b461-3f65-8882-6e322d99a60b" xlink:to="loc_us-gaap_DeferredTaxLiabilitiesOther_40c7d4a7-f1a1-0c55-497e-f9a3bb09604c" xlink:type="arc" />
  </link:calculationLink>
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/IncomeTaxesIncomeTaxReconciliationDetails" xlink:type="extended">
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_EffectiveIncomeTaxRateContinuingOperations" xlink:label="loc_us-gaap_EffectiveIncomeTaxRateContinuingOperations_8712fd02-171c-5995-3f18-84e885c380b9" xlink:type="locator" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_EffectiveIncomeTaxRateReconciliationAtFederalStatutoryIncomeTaxRate" xlink:label="loc_us-gaap_EffectiveIncomeTaxRateReconciliationAtFederalStatutoryIncomeTaxRate_29919d14-72a3-6197-982a-3a6269f21038" xlink:type="locator" />
    <link:calculationArc order="1" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_EffectiveIncomeTaxRateContinuingOperations_8712fd02-171c-5995-3f18-84e885c380b9" xlink:to="loc_us-gaap_EffectiveIncomeTaxRateReconciliationAtFederalStatutoryIncomeTaxRate_29919d14-72a3-6197-982a-3a6269f21038" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_EffectiveIncomeTaxRateReconciliationChangeInEnactedTaxRate" xlink:label="loc_us-gaap_EffectiveIncomeTaxRateReconciliationChangeInEnactedTaxRate_8718aa1e-c40a-73dd-11d3-b6a4475e0d37" xlink:type="locator" />
    <link:calculationArc order="2" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_EffectiveIncomeTaxRateContinuingOperations_8712fd02-171c-5995-3f18-84e885c380b9" xlink:to="loc_us-gaap_EffectiveIncomeTaxRateReconciliationChangeInEnactedTaxRate_8718aa1e-c40a-73dd-11d3-b6a4475e0d37" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_EffectiveIncomeTaxRateReconciliationNondeductibleExpenseShareBasedCompensationCost" xlink:label="loc_us-gaap_EffectiveIncomeTaxRateReconciliationNondeductibleExpenseShareBasedCompensationCost_c3fa658e-2108-f8f1-5239-330a908982a2" xlink:type="locator" />
    <link:calculationArc order="3" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_EffectiveIncomeTaxRateContinuingOperations_8712fd02-171c-5995-3f18-84e885c380b9" xlink:to="loc_us-gaap_EffectiveIncomeTaxRateReconciliationNondeductibleExpenseShareBasedCompensationCost_c3fa658e-2108-f8f1-5239-330a908982a2" xlink:type="arc" />
    <link:loc xlink:href="nmih-20171231.xsd#nmih_EffectiveIncomeTaxRateReconciliationWarrantGainLossPercent" xlink:label="loc_nmih_EffectiveIncomeTaxRateReconciliationWarrantGainLossPercent_b76e360d-f352-1821-26a3-b85014614ff6" xlink:type="locator" />
    <link:calculationArc order="4" weight="-1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_EffectiveIncomeTaxRateContinuingOperations_8712fd02-171c-5995-3f18-84e885c380b9" xlink:to="loc_nmih_EffectiveIncomeTaxRateReconciliationWarrantGainLossPercent_b76e360d-f352-1821-26a3-b85014614ff6" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_EffectiveIncomeTaxRateReconciliationOtherAdjustments" xlink:label="loc_us-gaap_EffectiveIncomeTaxRateReconciliationOtherAdjustments_e076fca2-751d-53ee-27b4-64a5b6f5b217" xlink:type="locator" />
    <link:calculationArc order="5" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_EffectiveIncomeTaxRateContinuingOperations_8712fd02-171c-5995-3f18-84e885c380b9" xlink:to="loc_us-gaap_EffectiveIncomeTaxRateReconciliationOtherAdjustments_e076fca2-751d-53ee-27b4-64a5b6f5b217" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_EffectiveIncomeTaxRateReconciliationChangeInDeferredTaxAssetsValuationAllowance" xlink:label="loc_us-gaap_EffectiveIncomeTaxRateReconciliationChangeInDeferredTaxAssetsValuationAllowance_e1bd5e97-dd80-bb67-1b32-f0283be3c62d" xlink:type="locator" />
    <link:calculationArc order="6" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_EffectiveIncomeTaxRateContinuingOperations_8712fd02-171c-5995-3f18-84e885c380b9" xlink:to="loc_us-gaap_EffectiveIncomeTaxRateReconciliationChangeInDeferredTaxAssetsValuationAllowance_e1bd5e97-dd80-bb67-1b32-f0283be3c62d" xlink:type="arc" />
  </link:calculationLink>
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/IncomeTaxesNarrativeDetails" xlink:type="extended" />
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/IncomeTaxesTables" xlink:type="extended" />
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/IntangibleAssetsAndGoodwill" xlink:type="extended" />
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/IntangibleAssetsAndGoodwillBalancesDetails" xlink:type="extended" />
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/IntangibleAssetsAndGoodwillTables" xlink:type="extended" />
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/Investments" xlink:type="extended" />
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/InvestmentsFairValuesAndGrossUnrealizedGainsAndLossesOnInvestmentsDetails" xlink:type="extended">
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_AvailableForSaleSecuritiesAmortizedCost" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesAmortizedCost_30dc6014-97a8-c9af-5d13-c233c1983f7f" xlink:type="locator" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_AvailableForSaleSecuritiesAccumulatedGrossUnrealizedGainBeforeTax" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesAccumulatedGrossUnrealizedGainBeforeTax_1932fd43-f07d-5e04-493b-eca2ebb13c97" xlink:type="locator" />
    <link:calculationArc order="1" weight="-1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AvailableForSaleSecuritiesAmortizedCost_30dc6014-97a8-c9af-5d13-c233c1983f7f" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesAccumulatedGrossUnrealizedGainBeforeTax_1932fd43-f07d-5e04-493b-eca2ebb13c97" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_AvailableForSaleSecuritiesAccumulatedGrossUnrealizedLossBeforeTax" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesAccumulatedGrossUnrealizedLossBeforeTax_e96beffd-8ab7-62f8-402b-cfa1adccd68f" xlink:type="locator" />
    <link:calculationArc order="2" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AvailableForSaleSecuritiesAmortizedCost_30dc6014-97a8-c9af-5d13-c233c1983f7f" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesAccumulatedGrossUnrealizedLossBeforeTax_e96beffd-8ab7-62f8-402b-cfa1adccd68f" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_AvailableForSaleSecurities" xlink:label="loc_us-gaap_AvailableForSaleSecurities_d444402b-921b-e0fa-119c-908ab66850af" xlink:type="locator" />
    <link:calculationArc order="3" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AvailableForSaleSecuritiesAmortizedCost_30dc6014-97a8-c9af-5d13-c233c1983f7f" xlink:to="loc_us-gaap_AvailableForSaleSecurities_d444402b-921b-e0fa-119c-908ab66850af" xlink:type="arc" />
  </link:calculationLink>
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/InvestmentsNarrativeDetails" xlink:type="extended" />
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/InvestmentsNetInvestmentIncomeDetails" xlink:type="extended">
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_InvestmentIncomeNet" xlink:label="loc_us-gaap_InvestmentIncomeNet_1dfa26bf-6b76-8f92-6fe2-019abedc0769" xlink:type="locator" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_InvestmentIncomeInvestmentExpense" xlink:label="loc_us-gaap_InvestmentIncomeInvestmentExpense_6db45ded-e80e-177a-5a26-8515df71efe4" xlink:type="locator" />
    <link:calculationArc order="1" weight="-1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_InvestmentIncomeNet_1dfa26bf-6b76-8f92-6fe2-019abedc0769" xlink:to="loc_us-gaap_InvestmentIncomeInvestmentExpense_6db45ded-e80e-177a-5a26-8515df71efe4" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_InvestmentIncomeInterestAndDividend" xlink:label="loc_us-gaap_InvestmentIncomeInterestAndDividend_bc368fb0-0ed4-a707-5fec-e52b7d3c8d9b" xlink:type="locator" />
    <link:calculationArc order="2" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_InvestmentIncomeNet_1dfa26bf-6b76-8f92-6fe2-019abedc0769" xlink:to="loc_us-gaap_InvestmentIncomeInterestAndDividend_bc368fb0-0ed4-a707-5fec-e52b7d3c8d9b" xlink:type="arc" />
  </link:calculationLink>
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/InvestmentsNetRealizedInvestmentsGainsLossesDetails" xlink:type="extended">
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_AvailableforsaleSecuritiesGrossRealizedGainLossExcludingOtherThanTemporaryImpairments" xlink:label="loc_us-gaap_AvailableforsaleSecuritiesGrossRealizedGainLossExcludingOtherThanTemporaryImpairments_43786c37-cf54-5da7-9a1f-a4e795eb3c41" xlink:type="locator" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_AvailableForSaleSecuritiesGrossRealizedGains" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesGrossRealizedGains_0c3203dd-4b24-5624-3641-9ab08b1db8c0" xlink:type="locator" />
    <link:calculationArc order="1" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AvailableforsaleSecuritiesGrossRealizedGainLossExcludingOtherThanTemporaryImpairments_43786c37-cf54-5da7-9a1f-a4e795eb3c41" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesGrossRealizedGains_0c3203dd-4b24-5624-3641-9ab08b1db8c0" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_AvailableforsaleSecuritiesGrossRealizedLossesExcludingOtherThanTemporaryImpairments" xlink:label="loc_us-gaap_AvailableforsaleSecuritiesGrossRealizedLossesExcludingOtherThanTemporaryImpairments_da7938e2-c93e-90b8-70f3-93558ebff5c3" xlink:type="locator" />
    <link:calculationArc order="2" weight="-1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AvailableforsaleSecuritiesGrossRealizedGainLossExcludingOtherThanTemporaryImpairments_43786c37-cf54-5da7-9a1f-a4e795eb3c41" xlink:to="loc_us-gaap_AvailableforsaleSecuritiesGrossRealizedLossesExcludingOtherThanTemporaryImpairments_da7938e2-c93e-90b8-70f3-93558ebff5c3" xlink:type="arc" />
  </link:calculationLink>
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/InvestmentsScheduledMaturitiesDetails" xlink:type="extended">
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_AvailableForSaleSecuritiesAmortizedCost" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesAmortizedCost_30dc6014-97a8-c9af-5d13-c233c1983f7f" xlink:type="locator" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_AvailableForSaleSecuritiesDebtMaturitiesWithinOneYearAmortizedCost" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesWithinOneYearAmortizedCost_065ac417-143a-3361-82a5-1e59ffd9749a" xlink:type="locator" />
    <link:calculationArc order="1" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AvailableForSaleSecuritiesAmortizedCost_30dc6014-97a8-c9af-5d13-c233c1983f7f" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesWithinOneYearAmortizedCost_065ac417-143a-3361-82a5-1e59ffd9749a" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_AvailableForSaleSecuritiesDebtMaturitiesAfterOneThroughFiveYearsAmortizedCost" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesAfterOneThroughFiveYearsAmortizedCost_6806c6da-7794-6cc2-dea6-0fe1f4c6a026" xlink:type="locator" />
    <link:calculationArc order="2" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AvailableForSaleSecuritiesAmortizedCost_30dc6014-97a8-c9af-5d13-c233c1983f7f" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesAfterOneThroughFiveYearsAmortizedCost_6806c6da-7794-6cc2-dea6-0fe1f4c6a026" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_AvailableForSaleSecuritiesDebtMaturitiesAfterFiveThroughTenYearsAmortizedCost" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesAfterFiveThroughTenYearsAmortizedCost_c1571bda-5b61-dcae-c5bf-c051d205fcb0" xlink:type="locator" />
    <link:calculationArc order="3" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AvailableForSaleSecuritiesAmortizedCost_30dc6014-97a8-c9af-5d13-c233c1983f7f" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesAfterFiveThroughTenYearsAmortizedCost_c1571bda-5b61-dcae-c5bf-c051d205fcb0" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_AvailableForSaleSecuritiesDebtMaturitiesAfterTenYearsAmortizedCost" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesAfterTenYearsAmortizedCost_ff34ba87-e8d3-6e7f-88aa-c1d3f9f922ea" xlink:type="locator" />
    <link:calculationArc order="4" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AvailableForSaleSecuritiesAmortizedCost_30dc6014-97a8-c9af-5d13-c233c1983f7f" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesAfterTenYearsAmortizedCost_ff34ba87-e8d3-6e7f-88aa-c1d3f9f922ea" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_AvailableForSaleSecuritiesDebtMaturitiesWithoutSingleMaturityDateAmortizedCost" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesWithoutSingleMaturityDateAmortizedCost_ac973b63-1234-e9dc-6850-581bee09202d" xlink:type="locator" />
    <link:calculationArc order="5" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AvailableForSaleSecuritiesAmortizedCost_30dc6014-97a8-c9af-5d13-c233c1983f7f" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesWithoutSingleMaturityDateAmortizedCost_ac973b63-1234-e9dc-6850-581bee09202d" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_AvailableForSaleSecurities" xlink:label="loc_us-gaap_AvailableForSaleSecurities_d444402b-921b-e0fa-119c-908ab66850af" xlink:type="locator" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_AvailableForSaleSecuritiesDebtMaturitiesWithinOneYearFairValue" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesWithinOneYearFairValue_4836856d-11b6-313b-8616-6a2c8b77e26f" xlink:type="locator" />
    <link:calculationArc order="1" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AvailableForSaleSecurities_d444402b-921b-e0fa-119c-908ab66850af" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesWithinOneYearFairValue_4836856d-11b6-313b-8616-6a2c8b77e26f" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_AvailableForSaleSecuritiesDebtMaturitiesAfterOneThroughFiveYearsFairValue" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesAfterOneThroughFiveYearsFairValue_c92402e9-bd0b-d11c-b52e-45b5c23d49be" xlink:type="locator" />
    <link:calculationArc order="2" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AvailableForSaleSecurities_d444402b-921b-e0fa-119c-908ab66850af" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesAfterOneThroughFiveYearsFairValue_c92402e9-bd0b-d11c-b52e-45b5c23d49be" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_AvailableForSaleSecuritiesDebtMaturitiesAfterFiveThroughTenYearsFairValue" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesAfterFiveThroughTenYearsFairValue_4e9a5751-649f-39a9-c9ec-844be0df352b" xlink:type="locator" />
    <link:calculationArc order="3" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AvailableForSaleSecurities_d444402b-921b-e0fa-119c-908ab66850af" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesAfterFiveThroughTenYearsFairValue_4e9a5751-649f-39a9-c9ec-844be0df352b" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_AvailableForSaleSecuritiesDebtMaturitiesAfterTenYearsFairValue" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesAfterTenYearsFairValue_e94acabe-050f-59b3-6024-05630a9bf579" xlink:type="locator" />
    <link:calculationArc order="4" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AvailableForSaleSecurities_d444402b-921b-e0fa-119c-908ab66850af" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesAfterTenYearsFairValue_e94acabe-050f-59b3-6024-05630a9bf579" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_AvailableForSaleSecuritiesDebtMaturitiesWithoutSingleMaturityDateFairValue" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesWithoutSingleMaturityDateFairValue_11c917bd-9af8-6ef7-e11a-4b124839ec0d" xlink:type="locator" />
    <link:calculationArc order="5" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AvailableForSaleSecurities_d444402b-921b-e0fa-119c-908ab66850af" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtMaturitiesWithoutSingleMaturityDateFairValue_11c917bd-9af8-6ef7-e11a-4b124839ec0d" xlink:type="arc" />
  </link:calculationLink>
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/InvestmentsTables" xlink:type="extended" />
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/InvestmentsUnrealizedLossesDetails" xlink:type="extended">
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_AvailableForSaleSecuritiesContinuousUnrealizedLossPositionAccumulatedLoss" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesContinuousUnrealizedLossPositionAccumulatedLoss_2e09f20d-7547-1a18-6f83-8a0ce6a75ae4" xlink:type="locator" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_AvailableForSaleSecuritiesContinuousUnrealizedLossPosition12MonthsOrLongerAccumulatedLoss" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesContinuousUnrealizedLossPosition12MonthsOrLongerAccumulatedLoss_80d8afbb-83ba-fc94-42ba-ea8166197445" xlink:type="locator" />
    <link:calculationArc order="1" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AvailableForSaleSecuritiesContinuousUnrealizedLossPositionAccumulatedLoss_2e09f20d-7547-1a18-6f83-8a0ce6a75ae4" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesContinuousUnrealizedLossPosition12MonthsOrLongerAccumulatedLoss_80d8afbb-83ba-fc94-42ba-ea8166197445" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_AvailableForSaleSecuritiesContinuousUnrealizedLossPositionLessThan12MonthsAccumulatedLoss" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesContinuousUnrealizedLossPositionLessThan12MonthsAccumulatedLoss_aaf3e830-a5d9-ffa3-4995-c9e738f331db" xlink:type="locator" />
    <link:calculationArc order="2" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AvailableForSaleSecuritiesContinuousUnrealizedLossPositionAccumulatedLoss_2e09f20d-7547-1a18-6f83-8a0ce6a75ae4" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesContinuousUnrealizedLossPositionLessThan12MonthsAccumulatedLoss_aaf3e830-a5d9-ffa3-4995-c9e738f331db" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_AvailableForSaleSecuritiesContinuousUnrealizedLossPositionFairValue" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesContinuousUnrealizedLossPositionFairValue_00e7a94b-1ec9-6499-7f0a-2050ff159115" xlink:type="locator" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_AvailableForSaleSecuritiesContinuousUnrealizedLossPositionTwelveMonthsOrLongerFairValue" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesContinuousUnrealizedLossPositionTwelveMonthsOrLongerFairValue_7b1de9af-f23a-d7bf-8a2c-7efccf28ddba" xlink:type="locator" />
    <link:calculationArc order="1" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AvailableForSaleSecuritiesContinuousUnrealizedLossPositionFairValue_00e7a94b-1ec9-6499-7f0a-2050ff159115" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesContinuousUnrealizedLossPositionTwelveMonthsOrLongerFairValue_7b1de9af-f23a-d7bf-8a2c-7efccf28ddba" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_AvailableForSaleSecuritiesContinuousUnrealizedLossPositionLessThanTwelveMonthsFairValue" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesContinuousUnrealizedLossPositionLessThanTwelveMonthsFairValue_a1dd3f1b-4c24-2372-1a98-24b25891a665" xlink:type="locator" />
    <link:calculationArc order="2" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AvailableForSaleSecuritiesContinuousUnrealizedLossPositionFairValue_00e7a94b-1ec9-6499-7f0a-2050ff159115" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesContinuousUnrealizedLossPositionLessThanTwelveMonthsFairValue_a1dd3f1b-4c24-2372-1a98-24b25891a665" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_AvailableforsaleSecuritiesInUnrealizedLossPositionsQualitativeDisclosureNumberOfPositions1" xlink:label="loc_us-gaap_AvailableforsaleSecuritiesInUnrealizedLossPositionsQualitativeDisclosureNumberOfPositions1_111b7cba-e95e-3799-f7b7-f27c52cbd965" xlink:type="locator" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_AvailableforsaleSecuritiesInUnrealizedLossPositionsQualitativeDisclosureNumberOfPositionsGreaterThanOrEqualToOneYear" xlink:label="loc_us-gaap_AvailableforsaleSecuritiesInUnrealizedLossPositionsQualitativeDisclosureNumberOfPositionsGreaterThanOrEqualToOneYear_7e4980cb-d5e7-da42-9b43-5fe24011710f" xlink:type="locator" />
    <link:calculationArc order="1" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AvailableforsaleSecuritiesInUnrealizedLossPositionsQualitativeDisclosureNumberOfPositions1_111b7cba-e95e-3799-f7b7-f27c52cbd965" xlink:to="loc_us-gaap_AvailableforsaleSecuritiesInUnrealizedLossPositionsQualitativeDisclosureNumberOfPositionsGreaterThanOrEqualToOneYear_7e4980cb-d5e7-da42-9b43-5fe24011710f" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_AvailableForSaleSecuritiesInUnrealizedLossPositionsQualitativeDisclosureNumberOfPositionsLessThanOneYear" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesInUnrealizedLossPositionsQualitativeDisclosureNumberOfPositionsLessThanOneYear_6bbb0e70-697e-73fd-d0fa-86f9d4dfc3fb" xlink:type="locator" />
    <link:calculationArc order="2" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_AvailableforsaleSecuritiesInUnrealizedLossPositionsQualitativeDisclosureNumberOfPositions1_111b7cba-e95e-3799-f7b7-f27c52cbd965" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesInUnrealizedLossPositionsQualitativeDisclosureNumberOfPositionsLessThanOneYear_6bbb0e70-697e-73fd-d0fa-86f9d4dfc3fb" xlink:type="arc" />
  </link:calculationLink>
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/OrganizationAndBasisOfPresentation" xlink:type="extended" />
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/OrganizationAndBasisOfPresentationNarrativeDetails" xlink:type="extended" />
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/QuarterlyFinancialDataUnaudited" xlink:type="extended" />
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/QuarterlyFinancialDataUnauditedDetails" xlink:type="extended" />
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/QuarterlyFinancialDataUnauditedTables" xlink:type="extended" />
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/RegulatoryInformation" xlink:type="extended" />
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/RegulatoryInformationNarrativeDetails" xlink:type="extended" />
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/RegulatoryInformationScheduleOfCombinedStatutoryNetLossStatutorySurplusContingencyReserveAndRtcRatiosDetails" xlink:type="extended" />
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/RegulatoryInformationTables" xlink:type="extended" />
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/Reinsurance" xlink:type="extended" />
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/ReinsuranceAmountsCededRelatedTo2016QsrTransactionDetails" xlink:type="extended" />
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/ReinsuranceEffectOfReinsuranceOnNetPremiumsWrittenAndEarnedDetails" xlink:type="extended">
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_PremiumsEarnedNet" xlink:label="loc_us-gaap_PremiumsEarnedNet_c064cba7-a0d7-dfb0-7513-652e64da6752" xlink:type="locator" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_DirectPremiumsEarned" xlink:label="loc_us-gaap_DirectPremiumsEarned_87372c03-ca96-210d-a800-21d3801388c5" xlink:type="locator" />
    <link:calculationArc order="1" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_PremiumsEarnedNet_c064cba7-a0d7-dfb0-7513-652e64da6752" xlink:to="loc_us-gaap_DirectPremiumsEarned_87372c03-ca96-210d-a800-21d3801388c5" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_CededPremiumsEarned" xlink:label="loc_us-gaap_CededPremiumsEarned_f572c81d-14a3-f5f6-737d-4f1c595b9a45" xlink:type="locator" />
    <link:calculationArc order="2" weight="-1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_PremiumsEarnedNet_c064cba7-a0d7-dfb0-7513-652e64da6752" xlink:to="loc_us-gaap_CededPremiumsEarned_f572c81d-14a3-f5f6-737d-4f1c595b9a45" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_PremiumsWrittenNet" xlink:label="loc_us-gaap_PremiumsWrittenNet_5f61ec91-ae06-1915-e15c-cc822f60ee70" xlink:type="locator" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_DirectPremiumsWritten" xlink:label="loc_us-gaap_DirectPremiumsWritten_a548a7f5-e42e-d254-f3bf-6d0637d663a1" xlink:type="locator" />
    <link:calculationArc order="1" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_PremiumsWrittenNet_5f61ec91-ae06-1915-e15c-cc822f60ee70" xlink:to="loc_us-gaap_DirectPremiumsWritten_a548a7f5-e42e-d254-f3bf-6d0637d663a1" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_CededPremiumsWritten" xlink:label="loc_us-gaap_CededPremiumsWritten_9dbb80c0-1738-0c53-8199-22f80b7e5acb" xlink:type="locator" />
    <link:calculationArc order="2" weight="-1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_PremiumsWrittenNet_5f61ec91-ae06-1915-e15c-cc822f60ee70" xlink:to="loc_us-gaap_CededPremiumsWritten_9dbb80c0-1738-0c53-8199-22f80b7e5acb" xlink:type="arc" />
  </link:calculationLink>
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/ReinsuranceNarrativeDetails" xlink:type="extended" />
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/ReinsuranceTables" xlink:type="extended" />
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/ReserveForInsuranceClaimsAndClaimExpenses" xlink:type="extended" />
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/ReservesForInsuranceClaimsAndClaimExpensesAverageAnnualPercentagePayoutOfIncurredClaimsByAgeNetOfReinsuranceDetails" xlink:type="extended" />
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/ReservesForInsuranceClaimsAndClaimExpensesClaimDevelopmentByAccidentYearAndReconciliationOfReserveForInsuranceClaimsAndClaimsExpenseDetails" xlink:type="extended" />
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/ReservesForInsuranceClaimsAndClaimExpensesNarrativeDetails" xlink:type="extended" />
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/ReservesForInsuranceClaimsAndClaimExpensesReconciliationOfDisclosureOfIncurredAndPaidClaimsDevelopmentToLiabilityForUnpaidClaimsAndClaimsAdjustmentExpensesDetails" xlink:type="extended">
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_ShortdurationInsuranceContractsLiabilityForUnpaidClaimsAndAllocatedClaimAdjustmentExpenseNet" xlink:label="loc_us-gaap_ShortdurationInsuranceContractsLiabilityForUnpaidClaimsAndAllocatedClaimAdjustmentExpenseNet_b75f3ad9-323d-15d2-81e2-d83149b6627a" xlink:type="locator" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_ShortdurationInsuranceContractsIncurredClaimsAndAllocatedClaimAdjustmentExpenseNet" xlink:label="loc_us-gaap_ShortdurationInsuranceContractsIncurredClaimsAndAllocatedClaimAdjustmentExpenseNet_096d099d-caae-7d20-1c01-d353dc4c3833" xlink:type="locator" />
    <link:calculationArc order="1" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_ShortdurationInsuranceContractsLiabilityForUnpaidClaimsAndAllocatedClaimAdjustmentExpenseNet_b75f3ad9-323d-15d2-81e2-d83149b6627a" xlink:to="loc_us-gaap_ShortdurationInsuranceContractsIncurredClaimsAndAllocatedClaimAdjustmentExpenseNet_096d099d-caae-7d20-1c01-d353dc4c3833" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_ShortdurationInsuranceContractsCumulativePaidClaimsAndAllocatedClaimAdjustmentExpenseNet" xlink:label="loc_us-gaap_ShortdurationInsuranceContractsCumulativePaidClaimsAndAllocatedClaimAdjustmentExpenseNet_c1345bce-f40d-6a0b-95b5-3dacd2d4f7b0" xlink:type="locator" />
    <link:calculationArc order="2" weight="-1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_ShortdurationInsuranceContractsLiabilityForUnpaidClaimsAndAllocatedClaimAdjustmentExpenseNet_b75f3ad9-323d-15d2-81e2-d83149b6627a" xlink:to="loc_us-gaap_ShortdurationInsuranceContractsCumulativePaidClaimsAndAllocatedClaimAdjustmentExpenseNet_c1345bce-f40d-6a0b-95b5-3dacd2d4f7b0" xlink:type="arc" />
  </link:calculationLink>
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/ReservesForInsuranceClaimsAndClaimExpensesReconciliationOfReserveBalancesForInsuranceClaimsExpensesDetails" xlink:type="extended">
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_PaymentsForLossesAndLossAdjustmentExpense" xlink:label="loc_us-gaap_PaymentsForLossesAndLossAdjustmentExpense_644f9d55-86b4-ffc9-87f4-0e045aabde07" xlink:type="locator" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_LiabilityForUnpaidClaimsAndClaimsAdjustmentExpenseClaimsPaidCurrentYear1" xlink:label="loc_us-gaap_LiabilityForUnpaidClaimsAndClaimsAdjustmentExpenseClaimsPaidCurrentYear1_e0f917f2-9c85-c450-370a-9f6e89eb32dd" xlink:type="locator" />
    <link:calculationArc order="1" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_PaymentsForLossesAndLossAdjustmentExpense_644f9d55-86b4-ffc9-87f4-0e045aabde07" xlink:to="loc_us-gaap_LiabilityForUnpaidClaimsAndClaimsAdjustmentExpenseClaimsPaidCurrentYear1_e0f917f2-9c85-c450-370a-9f6e89eb32dd" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_LiabilityForUnpaidClaimsAndClaimsAdjustmentExpenseClaimsPaidPriorYears1" xlink:label="loc_us-gaap_LiabilityForUnpaidClaimsAndClaimsAdjustmentExpenseClaimsPaidPriorYears1_954a7e93-e5cd-ee82-775c-baaa4fb8255d" xlink:type="locator" />
    <link:calculationArc order="2" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_PaymentsForLossesAndLossAdjustmentExpense_644f9d55-86b4-ffc9-87f4-0e045aabde07" xlink:to="loc_us-gaap_LiabilityForUnpaidClaimsAndClaimsAdjustmentExpenseClaimsPaidPriorYears1_954a7e93-e5cd-ee82-775c-baaa4fb8255d" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_LiabilityForUnpaidClaimsAndClaimsAdjustmentExpenseNet" xlink:label="loc_us-gaap_LiabilityForUnpaidClaimsAndClaimsAdjustmentExpenseNet_f3543a3f-db57-db9c-e709-44987440e848" xlink:type="locator" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_ReinsuranceRecoverablesOnPaidAndUnpaidLosses" xlink:label="loc_us-gaap_ReinsuranceRecoverablesOnPaidAndUnpaidLosses_e3190fcd-fd23-67c6-2761-5195368b5c70" xlink:type="locator" />
    <link:calculationArc order="1" weight="-1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_LiabilityForUnpaidClaimsAndClaimsAdjustmentExpenseNet_f3543a3f-db57-db9c-e709-44987440e848" xlink:to="loc_us-gaap_ReinsuranceRecoverablesOnPaidAndUnpaidLosses_e3190fcd-fd23-67c6-2761-5195368b5c70" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_LiabilityForClaimsAndClaimsAdjustmentExpense" xlink:label="loc_us-gaap_LiabilityForClaimsAndClaimsAdjustmentExpense_99d901f4-4cf9-4545-f608-844c08dd00c1" xlink:type="locator" />
    <link:calculationArc order="2" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_LiabilityForUnpaidClaimsAndClaimsAdjustmentExpenseNet_f3543a3f-db57-db9c-e709-44987440e848" xlink:to="loc_us-gaap_LiabilityForClaimsAndClaimsAdjustmentExpense_99d901f4-4cf9-4545-f608-844c08dd00c1" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_LiabilityForUnpaidClaimsAndClaimsAdjustmentExpenseIncurredClaims1" xlink:label="loc_us-gaap_LiabilityForUnpaidClaimsAndClaimsAdjustmentExpenseIncurredClaims1_c747a310-177f-3fa2-0770-186fe0101549" xlink:type="locator" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_SupplementalInformationForPropertyCasualtyInsuranceUnderwritersCurrentYearClaimsAndClaimsAdjustmentExpense" xlink:label="loc_us-gaap_SupplementalInformationForPropertyCasualtyInsuranceUnderwritersCurrentYearClaimsAndClaimsAdjustmentExpense_d0aa3441-4497-e056-f2c6-be13451e2bd4" xlink:type="locator" />
    <link:calculationArc order="1" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_LiabilityForUnpaidClaimsAndClaimsAdjustmentExpenseIncurredClaims1_c747a310-177f-3fa2-0770-186fe0101549" xlink:to="loc_us-gaap_SupplementalInformationForPropertyCasualtyInsuranceUnderwritersCurrentYearClaimsAndClaimsAdjustmentExpense_d0aa3441-4497-e056-f2c6-be13451e2bd4" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_SupplementalInformationForPropertyCasualtyInsuranceUnderwritersPriorYearClaimsAndClaimsAdjustmentExpense" xlink:label="loc_us-gaap_SupplementalInformationForPropertyCasualtyInsuranceUnderwritersPriorYearClaimsAndClaimsAdjustmentExpense_23dda0ac-154f-f86f-fdec-10da1de6334f" xlink:type="locator" />
    <link:calculationArc order="2" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_LiabilityForUnpaidClaimsAndClaimsAdjustmentExpenseIncurredClaims1_c747a310-177f-3fa2-0770-186fe0101549" xlink:to="loc_us-gaap_SupplementalInformationForPropertyCasualtyInsuranceUnderwritersPriorYearClaimsAndClaimsAdjustmentExpense_23dda0ac-154f-f86f-fdec-10da1de6334f" xlink:type="arc" />
  </link:calculationLink>
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/ReservesForInsuranceClaimsAndClaimExpensesTables" xlink:type="extended" />
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/ScheduleISummaryOfInvestmentsOtherThanInvestmentsInRelatedParties" xlink:type="extended" />
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/ScheduleISummaryOfInvestmentsOtherThanInvestmentsInRelatedPartiesDetails" xlink:type="extended" />
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/ScheduleIiFinancialInformationOfRegistrantParentCompanyOnly" xlink:type="extended" />
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/ScheduleIiFinancialInformationOfRegistrantParentCompanyOnlyBalanceSheetAdditionalInformationDetails" xlink:type="extended" />
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/ScheduleIiFinancialInformationOfRegistrantParentCompanyOnlyBalanceSheetDetails" xlink:type="extended">
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_Assets" xlink:label="loc_us-gaap_Assets_c6057b1d-6685-8249-2051-6c57f3a16a9e" xlink:type="locator" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_AvailableForSaleSecuritiesDebtSecurities" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtSecurities_2c867d9b-5594-18ef-c82a-679b606d1bd3" xlink:type="locator" />
    <link:calculationArc order="1" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_c6057b1d-6685-8249-2051-6c57f3a16a9e" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtSecurities_2c867d9b-5594-18ef-c82a-679b606d1bd3" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_CashAndCashEquivalentsAtCarryingValue" xlink:label="loc_us-gaap_CashAndCashEquivalentsAtCarryingValue_07da1db4-2708-4446-4250-1fdd5956185e" xlink:type="locator" />
    <link:calculationArc order="2" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_c6057b1d-6685-8249-2051-6c57f3a16a9e" xlink:to="loc_us-gaap_CashAndCashEquivalentsAtCarryingValue_07da1db4-2708-4446-4250-1fdd5956185e" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_EquityMethodInvestments" xlink:label="loc_us-gaap_EquityMethodInvestments_cf3b9d2e-b42f-76bb-8c85-9bcfc4c76505" xlink:type="locator" />
    <link:calculationArc order="3" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_c6057b1d-6685-8249-2051-6c57f3a16a9e" xlink:to="loc_us-gaap_EquityMethodInvestments_cf3b9d2e-b42f-76bb-8c85-9bcfc4c76505" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_AccruedInvestmentIncomeReceivable" xlink:label="loc_us-gaap_AccruedInvestmentIncomeReceivable_1d6b0581-e24d-9a5d-0503-a30115a080d6" xlink:type="locator" />
    <link:calculationArc order="4" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_c6057b1d-6685-8249-2051-6c57f3a16a9e" xlink:to="loc_us-gaap_AccruedInvestmentIncomeReceivable_1d6b0581-e24d-9a5d-0503-a30115a080d6" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_PrepaidExpenseCurrentAndNoncurrent" xlink:label="loc_us-gaap_PrepaidExpenseCurrentAndNoncurrent_d3cee2e8-8c30-6786-1a8c-f18071d15caf" xlink:type="locator" />
    <link:calculationArc order="5" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_c6057b1d-6685-8249-2051-6c57f3a16a9e" xlink:to="loc_us-gaap_PrepaidExpenseCurrentAndNoncurrent_d3cee2e8-8c30-6786-1a8c-f18071d15caf" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_DueFromAffiliates" xlink:label="loc_us-gaap_DueFromAffiliates_f8c42ff8-67c6-aa90-ecb0-6c2d319ef639" xlink:type="locator" />
    <link:calculationArc order="6" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_c6057b1d-6685-8249-2051-6c57f3a16a9e" xlink:to="loc_us-gaap_DueFromAffiliates_f8c42ff8-67c6-aa90-ecb0-6c2d319ef639" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_PropertyPlantAndEquipmentNet" xlink:label="loc_us-gaap_PropertyPlantAndEquipmentNet_1944a381-5c4e-ce3c-9111-13ccd1c639db" xlink:type="locator" />
    <link:calculationArc order="7" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_c6057b1d-6685-8249-2051-6c57f3a16a9e" xlink:to="loc_us-gaap_PropertyPlantAndEquipmentNet_1944a381-5c4e-ce3c-9111-13ccd1c639db" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_DeferredIncomeTaxAssetsNet" xlink:label="loc_us-gaap_DeferredIncomeTaxAssetsNet_0c301281-b140-dfcb-9991-ae503484f9da" xlink:type="locator" />
    <link:calculationArc order="8" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_c6057b1d-6685-8249-2051-6c57f3a16a9e" xlink:to="loc_us-gaap_DeferredIncomeTaxAssetsNet_0c301281-b140-dfcb-9991-ae503484f9da" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_OtherAssets" xlink:label="loc_us-gaap_OtherAssets_cb56b01f-b9c5-ca9e-8988-e23b27fc7a20" xlink:type="locator" />
    <link:calculationArc order="9" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_Assets_c6057b1d-6685-8249-2051-6c57f3a16a9e" xlink:to="loc_us-gaap_OtherAssets_cb56b01f-b9c5-ca9e-8988-e23b27fc7a20" xlink:type="arc" />
  </link:calculationLink>
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/ScheduleIiFinancialInformationOfRegistrantParentCompanyOnlyCashFlowStatementDetails" xlink:type="extended">
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_NetCashProvidedByUsedInInvestingActivities" xlink:label="loc_us-gaap_NetCashProvidedByUsedInInvestingActivities_70319186-e7bd-7189-88d2-eba26fb93350" xlink:type="locator" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_PaymentsToAcquireInterestInSubsidiariesAndAffiliates" xlink:label="loc_us-gaap_PaymentsToAcquireInterestInSubsidiariesAndAffiliates_c41e3d5d-b807-2060-dba6-cb3a0cc0cc13" xlink:type="locator" />
    <link:calculationArc order="1" weight="-1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInInvestingActivities_70319186-e7bd-7189-88d2-eba26fb93350" xlink:to="loc_us-gaap_PaymentsToAcquireInterestInSubsidiariesAndAffiliates_c41e3d5d-b807-2060-dba6-cb3a0cc0cc13" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_PaymentsToAcquireShortTermInvestments" xlink:label="loc_us-gaap_PaymentsToAcquireShortTermInvestments_e9694662-6637-d237-1a9d-f800fe1b0696" xlink:type="locator" />
    <link:calculationArc order="2" weight="-1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInInvestingActivities_70319186-e7bd-7189-88d2-eba26fb93350" xlink:to="loc_us-gaap_PaymentsToAcquireShortTermInvestments_e9694662-6637-d237-1a9d-f800fe1b0696" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_PaymentsToAcquireAvailableForSaleSecuritiesDebt" xlink:label="loc_us-gaap_PaymentsToAcquireAvailableForSaleSecuritiesDebt_15394837-f38b-15ac-34b9-3c880d46492b" xlink:type="locator" />
    <link:calculationArc order="3" weight="-1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInInvestingActivities_70319186-e7bd-7189-88d2-eba26fb93350" xlink:to="loc_us-gaap_PaymentsToAcquireAvailableForSaleSecuritiesDebt_15394837-f38b-15ac-34b9-3c880d46492b" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_ProceedsFromSaleOfShortTermInvestments" xlink:label="loc_us-gaap_ProceedsFromSaleOfShortTermInvestments_7ff698d9-1fdb-6970-c9a8-b1f93428a1a5" xlink:type="locator" />
    <link:calculationArc order="4" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInInvestingActivities_70319186-e7bd-7189-88d2-eba26fb93350" xlink:to="loc_us-gaap_ProceedsFromSaleOfShortTermInvestments_7ff698d9-1fdb-6970-c9a8-b1f93428a1a5" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_ProceedsFromSaleAndMaturityOfAvailableForSaleSecurities" xlink:label="loc_us-gaap_ProceedsFromSaleAndMaturityOfAvailableForSaleSecurities_4beb4a13-125c-79a5-e70a-88872f47be70" xlink:type="locator" />
    <link:calculationArc order="5" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInInvestingActivities_70319186-e7bd-7189-88d2-eba26fb93350" xlink:to="loc_us-gaap_ProceedsFromSaleAndMaturityOfAvailableForSaleSecurities_4beb4a13-125c-79a5-e70a-88872f47be70" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_PaymentsToAcquirePropertyPlantAndEquipment" xlink:label="loc_us-gaap_PaymentsToAcquirePropertyPlantAndEquipment_fee12b15-6b42-6245-2e2f-ff030b98332c" xlink:type="locator" />
    <link:calculationArc order="6" weight="-1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_NetCashProvidedByUsedInInvestingActivities_70319186-e7bd-7189-88d2-eba26fb93350" xlink:to="loc_us-gaap_PaymentsToAcquirePropertyPlantAndEquipment_fee12b15-6b42-6245-2e2f-ff030b98332c" xlink:type="arc" />
  </link:calculationLink>
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/ScheduleIiFinancialInformationOfRegistrantParentCompanyOnlyIncomeStatementAdditionalInformationDetails" xlink:type="extended" />
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/ScheduleIiFinancialInformationOfRegistrantParentCompanyOnlyIncomeStatementDetails" xlink:type="extended">
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent" xlink:label="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent_72d12753-e25c-cdc0-88b6-98db8d7b7fae" xlink:type="locator" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_OtherComprehensiveIncomeUnrealizedHoldingGainLossOnSecuritiesArisingDuringPeriodNetOfTax" xlink:label="loc_us-gaap_OtherComprehensiveIncomeUnrealizedHoldingGainLossOnSecuritiesArisingDuringPeriodNetOfTax_57e8ae74-d8b6-c629-9bee-2d0929cd3999" xlink:type="locator" />
    <link:calculationArc order="1" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent_72d12753-e25c-cdc0-88b6-98db8d7b7fae" xlink:to="loc_us-gaap_OtherComprehensiveIncomeUnrealizedHoldingGainLossOnSecuritiesArisingDuringPeriodNetOfTax_57e8ae74-d8b6-c629-9bee-2d0929cd3999" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_OtherComprehensiveIncomeLossReclassificationAdjustmentFromAOCIForSaleOfSecuritiesNetOfTax" xlink:label="loc_us-gaap_OtherComprehensiveIncomeLossReclassificationAdjustmentFromAOCIForSaleOfSecuritiesNetOfTax_ab3008c3-c5c2-a86b-0613-39cbd9b94527" xlink:type="locator" />
    <link:calculationArc order="2" weight="-1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent_72d12753-e25c-cdc0-88b6-98db8d7b7fae" xlink:to="loc_us-gaap_OtherComprehensiveIncomeLossReclassificationAdjustmentFromAOCIForSaleOfSecuritiesNetOfTax_ab3008c3-c5c2-a86b-0613-39cbd9b94527" xlink:type="arc" />
    <link:loc xlink:href="nmih-20171231.xsd#nmih_OtherComprehensiveIncomeLossNetofTaxPortionAttributabletoSubsidiary" xlink:label="loc_nmih_OtherComprehensiveIncomeLossNetofTaxPortionAttributabletoSubsidiary_d6325db8-25bc-2734-e4e8-b850144545eb" xlink:type="locator" />
    <link:calculationArc order="3" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent_72d12753-e25c-cdc0-88b6-98db8d7b7fae" xlink:to="loc_nmih_OtherComprehensiveIncomeLossNetofTaxPortionAttributabletoSubsidiary_d6325db8-25bc-2734-e4e8-b850144545eb" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest" xlink:label="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest_a53f52a4-7a54-3283-f734-95683c76ebff" xlink:type="locator" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_OtherNonoperatingIncomeExpense" xlink:label="loc_us-gaap_OtherNonoperatingIncomeExpense_250c3b2f-7db5-7088-68cc-1dd831a2c2d7" xlink:type="locator" />
    <link:calculationArc order="1" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest_a53f52a4-7a54-3283-f734-95683c76ebff" xlink:to="loc_us-gaap_OtherNonoperatingIncomeExpense_250c3b2f-7db5-7088-68cc-1dd831a2c2d7" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_IncomeLossFromEquityMethodInvestments" xlink:label="loc_us-gaap_IncomeLossFromEquityMethodInvestments_1c520208-bae2-1c51-b4b4-935e91f5fece" xlink:type="locator" />
    <link:calculationArc order="2" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest_a53f52a4-7a54-3283-f734-95683c76ebff" xlink:to="loc_us-gaap_IncomeLossFromEquityMethodInvestments_1c520208-bae2-1c51-b4b4-935e91f5fece" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_CostsAndExpenses" xlink:label="loc_us-gaap_CostsAndExpenses_0d9ff7d0-e871-5bdf-adbd-21d7dbf57556" xlink:type="locator" />
    <link:calculationArc order="3" weight="-1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest_a53f52a4-7a54-3283-f734-95683c76ebff" xlink:to="loc_us-gaap_CostsAndExpenses_0d9ff7d0-e871-5bdf-adbd-21d7dbf57556" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_OtherExpenses" xlink:label="loc_us-gaap_OtherExpenses_fddbfe05-903b-f997-5941-640200f58e74" xlink:type="locator" />
    <link:calculationArc order="1" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_CostsAndExpenses_0d9ff7d0-e871-5bdf-adbd-21d7dbf57556" xlink:to="loc_us-gaap_OtherExpenses_fddbfe05-903b-f997-5941-640200f58e74" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_Revenues" xlink:label="loc_us-gaap_Revenues_33f76b65-31cf-be04-0849-25af345446d5" xlink:type="locator" />
    <link:calculationArc order="4" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest_a53f52a4-7a54-3283-f734-95683c76ebff" xlink:to="loc_us-gaap_Revenues_33f76b65-31cf-be04-0849-25af345446d5" xlink:type="arc" />
  </link:calculationLink>
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/ScheduleIiFinancialInformationOfRegistrantParentCompanyOnlySupplementalNotesDetails" xlink:type="extended" />
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/ScheduleIvFinancialInformationOfRegistrantReinsuranceParentCompanyOnly" xlink:type="extended" />
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/ScheduleIvFinancialInformationOfRegistrantReinsuranceParentCompanyOnlyDetails" xlink:type="extended" />
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/ShareBasedCompensation" xlink:type="extended" />
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/ShareBasedCompensationNarrativeDetails" xlink:type="extended" />
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/ShareBasedCompensationRestrictedStockUnitsActivityDetails" xlink:type="extended" />
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/ShareBasedCompensationStockOptionActivityDetails" xlink:type="extended" />
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/ShareBasedCompensationStockOptionValuationAssumptionsDetails" xlink:type="extended" />
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/ShareBasedCompensationTables" xlink:type="extended" />
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/SoftwareAndEquipment" xlink:type="extended" />
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/SoftwareAndEquipmentBalancesAndActivityDetails" xlink:type="extended">
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_PropertyPlantAndEquipmentNet" xlink:label="loc_us-gaap_PropertyPlantAndEquipmentNet_1944a381-5c4e-ce3c-9111-13ccd1c639db" xlink:type="locator" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_PropertyPlantAndEquipmentGross" xlink:label="loc_us-gaap_PropertyPlantAndEquipmentGross_fe5a8e8b-5934-3dc5-9dae-7d40983185cf" xlink:type="locator" />
    <link:calculationArc order="1" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_PropertyPlantAndEquipmentNet_1944a381-5c4e-ce3c-9111-13ccd1c639db" xlink:to="loc_us-gaap_PropertyPlantAndEquipmentGross_fe5a8e8b-5934-3dc5-9dae-7d40983185cf" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_AccumulatedDepreciationDepletionAndAmortizationPropertyPlantAndEquipment" xlink:label="loc_us-gaap_AccumulatedDepreciationDepletionAndAmortizationPropertyPlantAndEquipment_5551841b-83e0-4644-fca8-d4027d932c0a" xlink:type="locator" />
    <link:calculationArc order="2" weight="-1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_PropertyPlantAndEquipmentNet_1944a381-5c4e-ce3c-9111-13ccd1c639db" xlink:to="loc_us-gaap_AccumulatedDepreciationDepletionAndAmortizationPropertyPlantAndEquipment_5551841b-83e0-4644-fca8-d4027d932c0a" xlink:type="arc" />
  </link:calculationLink>
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/SoftwareAndEquipmentNarrativeDetails" xlink:type="extended" />
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/SoftwareAndEquipmentTables" xlink:type="extended" />
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/SummaryOfAccountingPolicies" xlink:type="extended" />
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/SummaryOfAccountingPoliciesNarrativeDetails" xlink:type="extended" />
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/SummaryOfAccountingPoliciesPolicies" xlink:type="extended" />
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/SummaryOfAccountingPoliciesPriorPeriodAdjustmentsDetails" xlink:type="extended" />
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/SummaryOfAccountingPoliciesSubsequentEventsDetails" xlink:type="extended" />
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/SummaryOfAccountingPoliciesTables" xlink:type="extended" />
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/TermLoan" xlink:type="extended" />
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/TermLoanNarrativeDetails" xlink:type="extended" />
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/TermLoanScheduleOfFuturePrincipalPaymentsDetails" xlink:type="extended">
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_DebtInstrumentCarryingAmount" xlink:label="loc_us-gaap_DebtInstrumentCarryingAmount_885301e5-debb-a378-50ee-e1d9b92a7437" xlink:type="locator" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_LongTermDebtMaturitiesRepaymentsOfPrincipalInNextTwelveMonths" xlink:label="loc_us-gaap_LongTermDebtMaturitiesRepaymentsOfPrincipalInNextTwelveMonths_07fc9b71-5e9e-f38c-0c73-b038be276f66" xlink:type="locator" />
    <link:calculationArc order="1" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_DebtInstrumentCarryingAmount_885301e5-debb-a378-50ee-e1d9b92a7437" xlink:to="loc_us-gaap_LongTermDebtMaturitiesRepaymentsOfPrincipalInNextTwelveMonths_07fc9b71-5e9e-f38c-0c73-b038be276f66" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2017/elts/us-gaap-2017-01-31.xsd#us-gaap_LongTermDebtMaturitiesRepaymentsOfPrincipalInYearTwo" xlink:label="loc_us-gaap_LongTermDebtMaturitiesRepaymentsOfPrincipalInYearTwo_fd0898b3-8ac6-af74-6eb0-16df5479b1d8" xlink:type="locator" />
    <link:calculationArc order="2" weight="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="loc_us-gaap_DebtInstrumentCarryingAmount_885301e5-debb-a378-50ee-e1d9b92a7437" xlink:to="loc_us-gaap_LongTermDebtMaturitiesRepaymentsOfPrincipalInYearTwo_fd0898b3-8ac6-af74-6eb0-16df5479b1d8" xlink:type="arc" />
  </link:calculationLink>
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/TermLoanTables" xlink:type="extended" />
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/Warrants" xlink:type="extended" />
  <link:calculationLink xlink:role="http://www.nationalmi.com/role/WarrantsNarrativeDetails" xlink:type="extended" />
</link:linkbase>
