<?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:xbrldt="http://xbrl.org/2005/xbrldt" 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-20191231.xsd#CommitmentsAndContingencies" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/CommitmentsAndContingenciesFutureMinimumLeasePaymentsDetails" xlink:href="nmih-20191231.xsd#CommitmentsAndContingenciesFutureMinimumLeasePaymentsDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/CommitmentsAndContingenciesFuturePaymentDueUnderOperatingLeasesDetails" xlink:href="nmih-20191231.xsd#CommitmentsAndContingenciesFuturePaymentDueUnderOperatingLeasesDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/CommitmentsAndContingenciesNarrativeDetails" xlink:href="nmih-20191231.xsd#CommitmentsAndContingenciesNarrativeDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/CommitmentsAndContingenciesRightOfUseAssetAndLeaseLiabilityAssumptionsDetails" xlink:href="nmih-20191231.xsd#CommitmentsAndContingenciesRightOfUseAssetAndLeaseLiabilityAssumptionsDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/CommitmentsAndContingenciesTables" xlink:href="nmih-20191231.xsd#CommitmentsAndContingenciesTables" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/CommonStock" xlink:href="nmih-20191231.xsd#CommonStock" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/CommonStockNarrativeDetails" xlink:href="nmih-20191231.xsd#CommonStockNarrativeDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/ConsolidatedBalanceSheets" xlink:href="nmih-20191231.xsd#ConsolidatedBalanceSheets" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/ConsolidatedBalanceSheetsParenthetical" xlink:href="nmih-20191231.xsd#ConsolidatedBalanceSheetsParenthetical" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/ConsolidatedStatementsOfCashFlows" xlink:href="nmih-20191231.xsd#ConsolidatedStatementsOfCashFlows" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/ConsolidatedStatementsOfChangesInShareholdersEquity" xlink:href="nmih-20191231.xsd#ConsolidatedStatementsOfChangesInShareholdersEquity" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/ConsolidatedStatementsOfChangesInShareholdersEquityParenthetical" xlink:href="nmih-20191231.xsd#ConsolidatedStatementsOfChangesInShareholdersEquityParenthetical" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/ConsolidatedStatementsOfOperationsAndComprehensiveIncome" xlink:href="nmih-20191231.xsd#ConsolidatedStatementsOfOperationsAndComprehensiveIncome" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/ConsolidatedStatementsOfOperationsAndComprehensiveIncomeParenthetical" xlink:href="nmih-20191231.xsd#ConsolidatedStatementsOfOperationsAndComprehensiveIncomeParenthetical" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/CoverPage" xlink:href="nmih-20191231.xsd#CoverPage" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/Debt" xlink:href="nmih-20191231.xsd#Debt" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/DebtNarrativeDetails" xlink:href="nmih-20191231.xsd#DebtNarrativeDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/DebtScheduleOfFuturePrincipalPaymentsDetails" xlink:href="nmih-20191231.xsd#DebtScheduleOfFuturePrincipalPaymentsDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/DebtTables" xlink:href="nmih-20191231.xsd#DebtTables" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/EarningsPerShare" xlink:href="nmih-20191231.xsd#EarningsPerShare" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/EarningsPerShareDetails" xlink:href="nmih-20191231.xsd#EarningsPerShareDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/EarningsPerShareTables" xlink:href="nmih-20191231.xsd#EarningsPerShareTables" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/FairValueOfFinancialInstruments" xlink:href="nmih-20191231.xsd#FairValueOfFinancialInstruments" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/FairValueOfFinancialInstrumentsAssetsAndLiabilitiesAtFairValueDetails" xlink:href="nmih-20191231.xsd#FairValueOfFinancialInstrumentsAssetsAndLiabilitiesAtFairValueDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/FairValueOfFinancialInstrumentsNarrativeDetails" xlink:href="nmih-20191231.xsd#FairValueOfFinancialInstrumentsNarrativeDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/FairValueOfFinancialInstrumentsRollfowardOfLevel3LiabilitiesDetails" xlink:href="nmih-20191231.xsd#FairValueOfFinancialInstrumentsRollfowardOfLevel3LiabilitiesDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/FairValueOfFinancialInstrumentsTables" xlink:href="nmih-20191231.xsd#FairValueOfFinancialInstrumentsTables" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/FairValueOfFinancialInstrumentsValuationAssumptionsForWarrantLiabilitiesDetails" xlink:href="nmih-20191231.xsd#FairValueOfFinancialInstrumentsValuationAssumptionsForWarrantLiabilitiesDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/IncomeTaxes" xlink:href="nmih-20191231.xsd#IncomeTaxes" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/IncomeTaxesComponentsOfIncomeTaxExpenseBenefitDetails" xlink:href="nmih-20191231.xsd#IncomeTaxesComponentsOfIncomeTaxExpenseBenefitDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/IncomeTaxesDeferredTaxAssetAndLiabilitiesDetails" xlink:href="nmih-20191231.xsd#IncomeTaxesDeferredTaxAssetAndLiabilitiesDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/IncomeTaxesEffectiveIncomeTaxRateReconciliationDetails" xlink:href="nmih-20191231.xsd#IncomeTaxesEffectiveIncomeTaxRateReconciliationDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/IncomeTaxesNarrativeDetails" xlink:href="nmih-20191231.xsd#IncomeTaxesNarrativeDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/IncomeTaxesTables" xlink:href="nmih-20191231.xsd#IncomeTaxesTables" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/IntangibleAssetsAndGoodwill" xlink:href="nmih-20191231.xsd#IntangibleAssetsAndGoodwill" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/IntangibleAssetsAndGoodwillDetails" xlink:href="nmih-20191231.xsd#IntangibleAssetsAndGoodwillDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/IntangibleAssetsAndGoodwillTables" xlink:href="nmih-20191231.xsd#IntangibleAssetsAndGoodwillTables" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/Investments" xlink:href="nmih-20191231.xsd#Investments" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/InvestmentsAgingOfUnrealizedLossesDetails" xlink:href="nmih-20191231.xsd#InvestmentsAgingOfUnrealizedLossesDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/InvestmentsCorporateDebtSecuritiesByIndustryGroupDetails" xlink:href="nmih-20191231.xsd#InvestmentsCorporateDebtSecuritiesByIndustryGroupDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/InvestmentsFairValuesAndGrossUnrealizedGainsAndLossesDetails" xlink:href="nmih-20191231.xsd#InvestmentsFairValuesAndGrossUnrealizedGainsAndLossesDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/InvestmentsNarrativeDetails" xlink:href="nmih-20191231.xsd#InvestmentsNarrativeDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/InvestmentsNetInvestmentIncomeDetails" xlink:href="nmih-20191231.xsd#InvestmentsNetInvestmentIncomeDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/InvestmentsNetRealizedInvestmentsGainsLossesDetails" xlink:href="nmih-20191231.xsd#InvestmentsNetRealizedInvestmentsGainsLossesDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/InvestmentsScheduledMaturitiesDetails" xlink:href="nmih-20191231.xsd#InvestmentsScheduledMaturitiesDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/InvestmentsTables" xlink:href="nmih-20191231.xsd#InvestmentsTables" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/OrganizationAndBasisOfPresentation" xlink:href="nmih-20191231.xsd#OrganizationAndBasisOfPresentation" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/OrganizationAndBasisOfPresentationDetails" xlink:href="nmih-20191231.xsd#OrganizationAndBasisOfPresentationDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/QuarterlyFinancialDataUnaudited" xlink:href="nmih-20191231.xsd#QuarterlyFinancialDataUnaudited" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/QuarterlyFinancialDataUnauditedDetails" xlink:href="nmih-20191231.xsd#QuarterlyFinancialDataUnauditedDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/QuarterlyFinancialDataUnauditedTables" xlink:href="nmih-20191231.xsd#QuarterlyFinancialDataUnauditedTables" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/RegulatoryInformation" xlink:href="nmih-20191231.xsd#RegulatoryInformation" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/RegulatoryInformationNarrativeDetails" xlink:href="nmih-20191231.xsd#RegulatoryInformationNarrativeDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/RegulatoryInformationScheduleOfCombinedStatutoryNetLossStatutorySurplusContingencyReserveAndRtcRatiosDetails" xlink:href="nmih-20191231.xsd#RegulatoryInformationScheduleOfCombinedStatutoryNetLossStatutorySurplusContingencyReserveAndRtcRatiosDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/RegulatoryInformationTables" xlink:href="nmih-20191231.xsd#RegulatoryInformationTables" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/Reinsurance" xlink:href="nmih-20191231.xsd#Reinsurance" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/ReinsuranceAmountsCededRelatedToQsrTransactionsDetails" xlink:href="nmih-20191231.xsd#ReinsuranceAmountsCededRelatedToQsrTransactionsDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/ReinsuranceEffectOfReinsuranceAgreementsOnPremiumsWrittenAndEarnedDetails" xlink:href="nmih-20191231.xsd#ReinsuranceEffectOfReinsuranceAgreementsOnPremiumsWrittenAndEarnedDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/ReinsuranceIlnTransactionsDetails" xlink:href="nmih-20191231.xsd#ReinsuranceIlnTransactionsDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/ReinsuranceNarrativeDetails" xlink:href="nmih-20191231.xsd#ReinsuranceNarrativeDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/ReinsuranceTables" xlink:href="nmih-20191231.xsd#ReinsuranceTables" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/ReserveForInsuranceClaimsAndClaimExpenses" xlink:href="nmih-20191231.xsd#ReserveForInsuranceClaimsAndClaimExpenses" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/ReservesForInsuranceClaimsAndClaimExpensesAverageAnnualPercentagePayoutOfIncurredClaimsByAgeNetOfReinsuranceDetails" xlink:href="nmih-20191231.xsd#ReservesForInsuranceClaimsAndClaimExpensesAverageAnnualPercentagePayoutOfIncurredClaimsByAgeNetOfReinsuranceDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/ReservesForInsuranceClaimsAndClaimExpensesClaimDevelopmentByAccidentYearAndReconciliationOfReserveForInsuranceClaimsAndClaimsExpenseDetails" xlink:href="nmih-20191231.xsd#ReservesForInsuranceClaimsAndClaimExpensesClaimDevelopmentByAccidentYearAndReconciliationOfReserveForInsuranceClaimsAndClaimsExpenseDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/ReservesForInsuranceClaimsAndClaimExpensesNarrativeDetails" xlink:href="nmih-20191231.xsd#ReservesForInsuranceClaimsAndClaimExpensesNarrativeDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/ReservesForInsuranceClaimsAndClaimExpensesReconciliationOfDisclosureOfIncurredAndPaidClaimsDevelopmentToLiabilityForUnpaidClaimsAndClaimsAdjustmentExpensesDetails" xlink:href="nmih-20191231.xsd#ReservesForInsuranceClaimsAndClaimExpensesReconciliationOfDisclosureOfIncurredAndPaidClaimsDevelopmentToLiabilityForUnpaidClaimsAndClaimsAdjustmentExpensesDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/ReservesForInsuranceClaimsAndClaimExpensesReconciliationOfReserveBalancesForInsuranceClaimsExpensesDetails" xlink:href="nmih-20191231.xsd#ReservesForInsuranceClaimsAndClaimExpensesReconciliationOfReserveBalancesForInsuranceClaimsExpensesDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/ReservesForInsuranceClaimsAndClaimExpensesTables" xlink:href="nmih-20191231.xsd#ReservesForInsuranceClaimsAndClaimExpensesTables" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/ScheduleISummaryOfInvestmentsOtherThanInvestmentsInRelatedParties" xlink:href="nmih-20191231.xsd#ScheduleISummaryOfInvestmentsOtherThanInvestmentsInRelatedParties" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/ScheduleISummaryOfInvestmentsOtherThanInvestmentsInRelatedPartiesDetails" xlink:href="nmih-20191231.xsd#ScheduleISummaryOfInvestmentsOtherThanInvestmentsInRelatedPartiesDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/ScheduleIiFinancialInformationOfRegistrantParentCompanyOnly" xlink:href="nmih-20191231.xsd#ScheduleIiFinancialInformationOfRegistrantParentCompanyOnly" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/ScheduleIiFinancialInformationOfRegistrantParentCompanyOnlyBalanceSheetsAdditionalInformationParentCompanyOnlyDetails" xlink:href="nmih-20191231.xsd#ScheduleIiFinancialInformationOfRegistrantParentCompanyOnlyBalanceSheetsAdditionalInformationParentCompanyOnlyDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/ScheduleIiFinancialInformationOfRegistrantParentCompanyOnlyBalanceSheetsParentCompanyOnlyDetails" xlink:href="nmih-20191231.xsd#ScheduleIiFinancialInformationOfRegistrantParentCompanyOnlyBalanceSheetsParentCompanyOnlyDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/ScheduleIiFinancialInformationOfRegistrantParentCompanyOnlyStatementOfOperationsAdditionalInformationParentCompanyOnlyDetails" xlink:href="nmih-20191231.xsd#ScheduleIiFinancialInformationOfRegistrantParentCompanyOnlyStatementOfOperationsAdditionalInformationParentCompanyOnlyDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/ScheduleIiFinancialInformationOfRegistrantParentCompanyOnlyStatementOfOperationsParentCompanyOnlyDetails" xlink:href="nmih-20191231.xsd#ScheduleIiFinancialInformationOfRegistrantParentCompanyOnlyStatementOfOperationsParentCompanyOnlyDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/ScheduleIiFinancialInformationOfRegistrantParentCompanyOnlyStatementsOfCashFlowsParentCompanyOnlyDetails" xlink:href="nmih-20191231.xsd#ScheduleIiFinancialInformationOfRegistrantParentCompanyOnlyStatementsOfCashFlowsParentCompanyOnlyDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/ScheduleIiFinancialInformationOfRegistrantParentCompanyOnlySupplementalNotesParentCompanyOnlyDetails" xlink:href="nmih-20191231.xsd#ScheduleIiFinancialInformationOfRegistrantParentCompanyOnlySupplementalNotesParentCompanyOnlyDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/ScheduleIvFinancialInformationOfRegistrantReinsurance" xlink:href="nmih-20191231.xsd#ScheduleIvFinancialInformationOfRegistrantReinsurance" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/ScheduleIvFinancialInformationOfRegistrantReinsuranceDetails" xlink:href="nmih-20191231.xsd#ScheduleIvFinancialInformationOfRegistrantReinsuranceDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/ShareBasedCompensation" xlink:href="nmih-20191231.xsd#ShareBasedCompensation" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/ShareBasedCompensationNarrativeDetails" xlink:href="nmih-20191231.xsd#ShareBasedCompensationNarrativeDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/ShareBasedCompensationRestrictedStockUnitsActivityDetails" xlink:href="nmih-20191231.xsd#ShareBasedCompensationRestrictedStockUnitsActivityDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/ShareBasedCompensationStockOptionActivityDetails" xlink:href="nmih-20191231.xsd#ShareBasedCompensationStockOptionActivityDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/ShareBasedCompensationStockOptionValuationAssumptionsDetails" xlink:href="nmih-20191231.xsd#ShareBasedCompensationStockOptionValuationAssumptionsDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/ShareBasedCompensationTables" xlink:href="nmih-20191231.xsd#ShareBasedCompensationTables" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/SoftwareAndEquipment" xlink:href="nmih-20191231.xsd#SoftwareAndEquipment" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/SoftwareAndEquipmentNarrativeDetails" xlink:href="nmih-20191231.xsd#SoftwareAndEquipmentNarrativeDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/SoftwareAndEquipmentNetBalancesDetails" xlink:href="nmih-20191231.xsd#SoftwareAndEquipmentNetBalancesDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/SoftwareAndEquipmentTables" xlink:href="nmih-20191231.xsd#SoftwareAndEquipmentTables" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/SummaryOfAccountingPolicies" xlink:href="nmih-20191231.xsd#SummaryOfAccountingPolicies" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/SummaryOfAccountingPoliciesDetails" xlink:href="nmih-20191231.xsd#SummaryOfAccountingPoliciesDetails" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/SummaryOfAccountingPoliciesPolicies" xlink:href="nmih-20191231.xsd#SummaryOfAccountingPoliciesPolicies" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/Warrants" xlink:href="nmih-20191231.xsd#Warrants" xlink:type="simple" />
  <link:roleRef roleURI="http://www.nationalmi.com/role/WarrantsDetails" xlink:href="nmih-20191231.xsd#WarrantsDetails" xlink:type="simple" />
  <link:arcroleRef arcroleURI="http://xbrl.org/int/dim/arcrole/all" xlink:href="http://www.xbrl.org/2005/xbrldt-2005.xsd#all" xlink:type="simple" />
  <link:arcroleRef arcroleURI="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:href="http://www.xbrl.org/2005/xbrldt-2005.xsd#dimension-default" xlink:type="simple" />
  <link:arcroleRef arcroleURI="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:href="http://www.xbrl.org/2005/xbrldt-2005.xsd#dimension-domain" xlink:type="simple" />
  <link:arcroleRef arcroleURI="http://xbrl.org/int/dim/arcrole/domain-member" xlink:href="http://www.xbrl.org/2005/xbrldt-2005.xsd#domain-member" xlink:type="simple" />
  <link:arcroleRef arcroleURI="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:href="http://www.xbrl.org/2005/xbrldt-2005.xsd#hypercube-dimension" xlink:type="simple" />
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/CommitmentsAndContingencies" xlink:type="extended" />
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/CommitmentsAndContingenciesFutureMinimumLeasePaymentsDetails" xlink:type="extended" />
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/CommitmentsAndContingenciesFuturePaymentDueUnderOperatingLeasesDetails" xlink:type="extended" />
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/CommitmentsAndContingenciesNarrativeDetails" xlink:type="extended">
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_LesseeLeaseDescriptionLineItems" xlink:label="loc_us-gaap_LesseeLeaseDescriptionLineItems_BCF9DDC4D270B5B6C4F93AA1569FE6B9" xlink:type="locator" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_LesseeLeaseDescriptionTable" xlink:label="loc_us-gaap_LesseeLeaseDescriptionTable_3CB16F34E944CDEF33CF3AA1569DDEB8" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_LesseeLeaseDescriptionLineItems_BCF9DDC4D270B5B6C4F93AA1569FE6B9" xlink:to="loc_us-gaap_LesseeLeaseDescriptionTable_3CB16F34E944CDEF33CF3AA1569DDEB8" xlink:type="arc" xbrldt:closed="true" xbrldt:contextElement="segment" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_RealEstateAndAccumulatedDepreciationDescriptionOfPropertyAxis" xlink:label="loc_srt_RealEstateAndAccumulatedDepreciationDescriptionOfPropertyAxis_511855517DB114B7BE743AA1569D6754" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_LesseeLeaseDescriptionTable_3CB16F34E944CDEF33CF3AA1569DDEB8" xlink:to="loc_srt_RealEstateAndAccumulatedDepreciationDescriptionOfPropertyAxis_511855517DB114B7BE743AA1569D6754" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_RealEstateAndAccumulatedDepreciationNameOfPropertyDomain" xlink:label="loc_srt_RealEstateAndAccumulatedDepreciationNameOfPropertyDomain_2A352974D8A625CBC94D3AA1569E0DB1_default" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_RealEstateAndAccumulatedDepreciationDescriptionOfPropertyAxis_511855517DB114B7BE743AA1569D6754" xlink:to="loc_srt_RealEstateAndAccumulatedDepreciationNameOfPropertyDomain_2A352974D8A625CBC94D3AA1569E0DB1_default" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_RealEstateAndAccumulatedDepreciationNameOfPropertyDomain" xlink:label="loc_srt_RealEstateAndAccumulatedDepreciationNameOfPropertyDomain_2A352974D8A625CBC94D3AA1569E0DB1" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_RealEstateAndAccumulatedDepreciationDescriptionOfPropertyAxis_511855517DB114B7BE743AA1569D6754" xlink:to="loc_srt_RealEstateAndAccumulatedDepreciationNameOfPropertyDomain_2A352974D8A625CBC94D3AA1569E0DB1" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_CorporateHeadquartersMember" xlink:label="loc_nmih_CorporateHeadquartersMember_2B0FD1821BFCDEF00E403AA1569E79BD" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RealEstateAndAccumulatedDepreciationNameOfPropertyDomain_2A352974D8A625CBC94D3AA1569E0DB1" xlink:to="loc_nmih_CorporateHeadquartersMember_2B0FD1821BFCDEF00E403AA1569E79BD" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_RangeAxis" xlink:label="loc_srt_RangeAxis_AD0801B7EA28AB7980D53AA1569E70FD" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_LesseeLeaseDescriptionTable_3CB16F34E944CDEF33CF3AA1569DDEB8" xlink:to="loc_srt_RangeAxis_AD0801B7EA28AB7980D53AA1569E70FD" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_RangeMember" xlink:label="loc_srt_RangeMember_D0FF58F1B5C6B4EFB4DC3AA1569EFE67_default" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_RangeAxis_AD0801B7EA28AB7980D53AA1569E70FD" xlink:to="loc_srt_RangeMember_D0FF58F1B5C6B4EFB4DC3AA1569EFE67_default" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_RangeMember" xlink:label="loc_srt_RangeMember_D0FF58F1B5C6B4EFB4DC3AA1569EFE67" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_RangeAxis_AD0801B7EA28AB7980D53AA1569E70FD" xlink:to="loc_srt_RangeMember_D0FF58F1B5C6B4EFB4DC3AA1569EFE67" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_MinimumMember" xlink:label="loc_srt_MinimumMember_7961BFBE0108DD39CFD23AA1569F26E7" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RangeMember_D0FF58F1B5C6B4EFB4DC3AA1569EFE67" xlink:to="loc_srt_MinimumMember_7961BFBE0108DD39CFD23AA1569F26E7" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_MaximumMember" xlink:label="loc_srt_MaximumMember_8EA0B2478C49E49722343AA1569FDB37" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RangeMember_D0FF58F1B5C6B4EFB4DC3AA1569EFE67" xlink:to="loc_srt_MaximumMember_8EA0B2478C49E49722343AA1569FDB37" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_ApprovedInsurersMinimumRequiredAssets" xlink:label="loc_nmih_ApprovedInsurersMinimumRequiredAssets_22E413C96AD1C58708453AA156A037FA" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LesseeLeaseDescriptionLineItems_BCF9DDC4D270B5B6C4F93AA1569FE6B9" xlink:to="loc_nmih_ApprovedInsurersMinimumRequiredAssets_22E413C96AD1C58708453AA156A037FA" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_ApprovedInsurersRiskedBasedRequiredAssetsPrimaryInsuranceFloor" xlink:label="loc_nmih_ApprovedInsurersRiskedBasedRequiredAssetsPrimaryInsuranceFloor_708C797D1E994D2C8B373AA156A0A37A" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LesseeLeaseDescriptionLineItems_BCF9DDC4D270B5B6C4F93AA1569FE6B9" xlink:to="loc_nmih_ApprovedInsurersRiskedBasedRequiredAssetsPrimaryInsuranceFloor_708C797D1E994D2C8B373AA156A0A37A" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_NumberOfOperatingLeasesCorporateOfficeAndDataCenterFacility" xlink:label="loc_nmih_NumberOfOperatingLeasesCorporateOfficeAndDataCenterFacility_F210D4385DDB2803AD2F3AA156A05889" xlink:type="locator" />
    <link:definitionArc order="3" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LesseeLeaseDescriptionLineItems_BCF9DDC4D270B5B6C4F93AA1569FE6B9" xlink:to="loc_nmih_NumberOfOperatingLeasesCorporateOfficeAndDataCenterFacility_F210D4385DDB2803AD2F3AA156A05889" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_OperatingLeaseRightOfUseAsset" xlink:label="loc_us-gaap_OperatingLeaseRightOfUseAsset_1F198B529801437723953AA156A0BA0C" xlink:type="locator" />
    <link:definitionArc order="4" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LesseeLeaseDescriptionLineItems_BCF9DDC4D270B5B6C4F93AA1569FE6B9" xlink:to="loc_us-gaap_OperatingLeaseRightOfUseAsset_1F198B529801437723953AA156A0BA0C" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_OperatingLeaseLiability" xlink:label="loc_us-gaap_OperatingLeaseLiability_454BA86C4401968F61C13AA156A0F2DE" xlink:type="locator" />
    <link:definitionArc order="5" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LesseeLeaseDescriptionLineItems_BCF9DDC4D270B5B6C4F93AA1569FE6B9" xlink:to="loc_us-gaap_OperatingLeaseLiability_454BA86C4401968F61C13AA156A0F2DE" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_RightOfUseAssetObtainedInExchangeForOperatingLeaseLiability" xlink:label="loc_us-gaap_RightOfUseAssetObtainedInExchangeForOperatingLeaseLiability_99F24F03273A505C5AF93AA156A10A12" xlink:type="locator" />
    <link:definitionArc order="6" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LesseeLeaseDescriptionLineItems_BCF9DDC4D270B5B6C4F93AA1569FE6B9" xlink:to="loc_us-gaap_RightOfUseAssetObtainedInExchangeForOperatingLeaseLiability_99F24F03273A505C5AF93AA156A10A12" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_OperatingLeasePayments" xlink:label="loc_us-gaap_OperatingLeasePayments_7AA29DFF6447CEB505783AA156A1B20D" xlink:type="locator" />
    <link:definitionArc order="7" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LesseeLeaseDescriptionLineItems_BCF9DDC4D270B5B6C4F93AA1569FE6B9" xlink:to="loc_us-gaap_OperatingLeasePayments_7AA29DFF6447CEB505783AA156A1B20D" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_OperatingLeaseExpense" xlink:label="loc_us-gaap_OperatingLeaseExpense_406D0BC6E64ABDE07ADC3AA156A1B551" xlink:type="locator" />
    <link:definitionArc order="8" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LesseeLeaseDescriptionLineItems_BCF9DDC4D270B5B6C4F93AA1569FE6B9" xlink:to="loc_us-gaap_OperatingLeaseExpense_406D0BC6E64ABDE07ADC3AA156A1B551" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_LesseeOperatingLeaseTermOfContract" xlink:label="loc_us-gaap_LesseeOperatingLeaseTermOfContract_0BD0AB6CEC0125EAAFE13AA156A12F82" xlink:type="locator" />
    <link:definitionArc order="9" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LesseeLeaseDescriptionLineItems_BCF9DDC4D270B5B6C4F93AA1569FE6B9" xlink:to="loc_us-gaap_LesseeOperatingLeaseTermOfContract_0BD0AB6CEC0125EAAFE13AA156A12F82" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_LesseeOperatingLeaseRenewalTerm" xlink:label="loc_us-gaap_LesseeOperatingLeaseRenewalTerm_0D29672E13DC00E071553AA156A22E42" xlink:type="locator" />
    <link:definitionArc order="10" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LesseeLeaseDescriptionLineItems_BCF9DDC4D270B5B6C4F93AA1569FE6B9" xlink:to="loc_us-gaap_LesseeOperatingLeaseRenewalTerm_0D29672E13DC00E071553AA156A22E42" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_OperatingLeasesRentExpenseNet" xlink:label="loc_us-gaap_OperatingLeasesRentExpenseNet_17B3C07408A7E4CE7AC03AA156A2480C" xlink:type="locator" />
    <link:definitionArc order="11" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LesseeLeaseDescriptionLineItems_BCF9DDC4D270B5B6C4F93AA1569FE6B9" xlink:to="loc_us-gaap_OperatingLeasesRentExpenseNet_17B3C07408A7E4CE7AC03AA156A2480C" xlink:type="arc" />
  </link:definitionLink>
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/CommitmentsAndContingenciesRightOfUseAssetAndLeaseLiabilityAssumptionsDetails" xlink:type="extended" />
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/CommitmentsAndContingenciesTables" xlink:type="extended" />
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/CommonStock" xlink:type="extended" />
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/CommonStockNarrativeDetails" xlink:type="extended">
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ClassOfStockLineItems" xlink:label="loc_us-gaap_ClassOfStockLineItems_5955BD841AD761674DB83AA1567800DF" xlink:type="locator" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ScheduleOfStockByClassTable" xlink:label="loc_us-gaap_ScheduleOfStockByClassTable_9AE251549E8DD07CA67F3AA15677FFD9" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_ClassOfStockLineItems_5955BD841AD761674DB83AA1567800DF" xlink:to="loc_us-gaap_ScheduleOfStockByClassTable_9AE251549E8DD07CA67F3AA15677FFD9" xlink:type="arc" xbrldt:closed="true" xbrldt:contextElement="segment" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_SubsidiarySaleOfStockAxis" xlink:label="loc_us-gaap_SubsidiarySaleOfStockAxis_0A44FA14FE124A9DEC453AA15677EEC5" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfStockByClassTable_9AE251549E8DD07CA67F3AA15677FFD9" xlink:to="loc_us-gaap_SubsidiarySaleOfStockAxis_0A44FA14FE124A9DEC453AA15677EEC5" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_SaleOfStockNameOfTransactionDomain" xlink:label="loc_us-gaap_SaleOfStockNameOfTransactionDomain_D96182B6EAC1A297DFF53AA15678A726_default" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_SubsidiarySaleOfStockAxis_0A44FA14FE124A9DEC453AA15677EEC5" xlink:to="loc_us-gaap_SaleOfStockNameOfTransactionDomain_D96182B6EAC1A297DFF53AA15678A726_default" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_SaleOfStockNameOfTransactionDomain" xlink:label="loc_us-gaap_SaleOfStockNameOfTransactionDomain_D96182B6EAC1A297DFF53AA15678A726" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_SubsidiarySaleOfStockAxis_0A44FA14FE124A9DEC453AA15677EEC5" xlink:to="loc_us-gaap_SaleOfStockNameOfTransactionDomain_D96182B6EAC1A297DFF53AA15678A726" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_OverAllotmentOptionMember" xlink:label="loc_us-gaap_OverAllotmentOptionMember_80F791E4E906B9BBDAA03AA156780B17" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_SaleOfStockNameOfTransactionDomain_D96182B6EAC1A297DFF53AA15678A726" xlink:to="loc_us-gaap_OverAllotmentOptionMember_80F791E4E906B9BBDAA03AA156780B17" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_CommonStockSharesOutstanding" xlink:label="loc_us-gaap_CommonStockSharesOutstanding_6162DA2226CEC5A69C073AA15678FF86" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfStockLineItems_5955BD841AD761674DB83AA1567800DF" xlink:to="loc_us-gaap_CommonStockSharesOutstanding_6162DA2226CEC5A69C073AA15678FF86" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_StockIssuedDuringPeriodSharesNewIssuesBeforeOverallotment" xlink:label="loc_nmih_StockIssuedDuringPeriodSharesNewIssuesBeforeOverallotment_EEB9279C3614DAA5286F3AA156790507" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfStockLineItems_5955BD841AD761674DB83AA1567800DF" xlink:to="loc_nmih_StockIssuedDuringPeriodSharesNewIssuesBeforeOverallotment_EEB9279C3614DAA5286F3AA156790507" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_StockIssuedDuringPeriodOverallotmentOptionPercent" xlink:label="loc_nmih_StockIssuedDuringPeriodOverallotmentOptionPercent_24D7DAA34558269608D53AA156797127" xlink:type="locator" />
    <link:definitionArc order="3" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfStockLineItems_5955BD841AD761674DB83AA1567800DF" xlink:to="loc_nmih_StockIssuedDuringPeriodOverallotmentOptionPercent_24D7DAA34558269608D53AA156797127" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_StockIssuedDuringPeriodSharesNewIssues" xlink:label="loc_us-gaap_StockIssuedDuringPeriodSharesNewIssues_107C4951A17019496E603AA15679AC28" xlink:type="locator" />
    <link:definitionArc order="4" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfStockLineItems_5955BD841AD761674DB83AA1567800DF" xlink:to="loc_us-gaap_StockIssuedDuringPeriodSharesNewIssues_107C4951A17019496E603AA15679AC28" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ProceedsFromIssuanceOfCommonStock" xlink:label="loc_us-gaap_ProceedsFromIssuanceOfCommonStock_74D38D1C888BEF3149B43AA1567AA58B" xlink:type="locator" />
    <link:definitionArc order="5" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfStockLineItems_5955BD841AD761674DB83AA1567800DF" xlink:to="loc_us-gaap_ProceedsFromIssuanceOfCommonStock_74D38D1C888BEF3149B43AA1567AA58B" xlink:type="arc" />
  </link:definitionLink>
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/ConsolidatedBalanceSheets" xlink:type="extended" />
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/ConsolidatedBalanceSheetsParenthetical" xlink:type="extended" />
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/ConsolidatedStatementsOfCashFlows" xlink:type="extended" />
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/ConsolidatedStatementsOfChangesInShareholdersEquity" xlink:type="extended">
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_StatementLineItems" xlink:label="loc_us-gaap_StatementLineItems_E5FC4CFF40A74DA42DC83AA15AF40561" xlink:type="locator" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_StatementTable" xlink:label="loc_us-gaap_StatementTable_6F41D6F1D2443601381B3AA15AF185B3" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_StatementLineItems_E5FC4CFF40A74DA42DC83AA15AF40561" xlink:to="loc_us-gaap_StatementTable_6F41D6F1D2443601381B3AA15AF185B3" xlink:type="arc" xbrldt:closed="true" xbrldt:contextElement="segment" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_StatementEquityComponentsAxis" xlink:label="loc_us-gaap_StatementEquityComponentsAxis_38EDDD2A729C1D29570B3AA15AF23E01" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_StatementTable_6F41D6F1D2443601381B3AA15AF185B3" xlink:to="loc_us-gaap_StatementEquityComponentsAxis_38EDDD2A729C1D29570B3AA15AF23E01" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_EquityComponentDomain" xlink:label="loc_us-gaap_EquityComponentDomain_AA8C830C9C2667ABB4563AA15AF2CE0B_default" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_StatementEquityComponentsAxis_38EDDD2A729C1D29570B3AA15AF23E01" xlink:to="loc_us-gaap_EquityComponentDomain_AA8C830C9C2667ABB4563AA15AF2CE0B_default" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_EquityComponentDomain" xlink:label="loc_us-gaap_EquityComponentDomain_AA8C830C9C2667ABB4563AA15AF2CE0B" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_StatementEquityComponentsAxis_38EDDD2A729C1D29570B3AA15AF23E01" xlink:to="loc_us-gaap_EquityComponentDomain_AA8C830C9C2667ABB4563AA15AF2CE0B" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_CommonStockMember" xlink:label="loc_us-gaap_CommonStockMember_4F76F312731654477FC33AA15AF2CAF1" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquityComponentDomain_AA8C830C9C2667ABB4563AA15AF2CE0B" xlink:to="loc_us-gaap_CommonStockMember_4F76F312731654477FC33AA15AF2CAF1" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_AdditionalPaidInCapitalMember" xlink:label="loc_us-gaap_AdditionalPaidInCapitalMember_E2F3A6587966365A98163AA15AF33E83" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquityComponentDomain_AA8C830C9C2667ABB4563AA15AF2CE0B" xlink:to="loc_us-gaap_AdditionalPaidInCapitalMember_E2F3A6587966365A98163AA15AF33E83" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_AccumulatedOtherComprehensiveIncomeMember" xlink:label="loc_us-gaap_AccumulatedOtherComprehensiveIncomeMember_B4A549D5C8498E09E0E53AA15AF3C69B" xlink:type="locator" />
    <link:definitionArc order="3" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquityComponentDomain_AA8C830C9C2667ABB4563AA15AF2CE0B" xlink:to="loc_us-gaap_AccumulatedOtherComprehensiveIncomeMember_B4A549D5C8498E09E0E53AA15AF3C69B" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_RetainedEarningsMember" xlink:label="loc_us-gaap_RetainedEarningsMember_00E2A3C94F0BF22ADB303AA15AF347A9" xlink:type="locator" />
    <link:definitionArc order="4" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquityComponentDomain_AA8C830C9C2667ABB4563AA15AF2CE0B" xlink:to="loc_us-gaap_RetainedEarningsMember_00E2A3C94F0BF22ADB303AA15AF347A9" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_IncreaseDecreaseInStockholdersEquityRollForward" xlink:label="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_E53E99C08853116938EE3AA15AF44E27" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_E5FC4CFF40A74DA42DC83AA15AF40561" xlink:to="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_E53E99C08853116938EE3AA15AF44E27" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_StockholdersEquity" xlink:label="loc_us-gaap_StockholdersEquity_1DFD97275FCE57EF08083AA15AF466F8" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_E53E99C08853116938EE3AA15AF44E27" xlink:to="loc_us-gaap_StockholdersEquity_1DFD97275FCE57EF08083AA15AF466F8" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_SharesOutstanding" xlink:label="loc_us-gaap_SharesOutstanding_9FF8364DF50CE52A87D73AA15AF458BE" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_E53E99C08853116938EE3AA15AF44E27" xlink:to="loc_us-gaap_SharesOutstanding_9FF8364DF50CE52A87D73AA15AF458BE" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_CumulativeEffectOfNewAccountingPrincipleInPeriodOfAdoption" xlink:label="loc_us-gaap_CumulativeEffectOfNewAccountingPrincipleInPeriodOfAdoption_60019DB01C3687067A933AA15AF52972" xlink:type="locator" />
    <link:definitionArc order="3" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_E53E99C08853116938EE3AA15AF44E27" xlink:to="loc_us-gaap_CumulativeEffectOfNewAccountingPrincipleInPeriodOfAdoption_60019DB01C3687067A933AA15AF52972" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_StockIssuedDuringPeriodValueNewIssues" xlink:label="loc_us-gaap_StockIssuedDuringPeriodValueNewIssues_14440A1DF47383541B2B3AA15AF54306" xlink:type="locator" />
    <link:definitionArc order="4" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_E53E99C08853116938EE3AA15AF44E27" xlink:to="loc_us-gaap_StockIssuedDuringPeriodValueNewIssues_14440A1DF47383541B2B3AA15AF54306" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_StockIssuedDuringPeriodSharesNewIssues" xlink:label="loc_us-gaap_StockIssuedDuringPeriodSharesNewIssues_6AD27C19713A1618F7333AA15AF50A9F" xlink:type="locator" />
    <link:definitionArc order="5" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_E53E99C08853116938EE3AA15AF44E27" xlink:to="loc_us-gaap_StockIssuedDuringPeriodSharesNewIssues_6AD27C19713A1618F7333AA15AF50A9F" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_StockIssuedDuringPeriodValueConversionOfConvertibleSecurities" xlink:label="loc_us-gaap_StockIssuedDuringPeriodValueConversionOfConvertibleSecurities_765701EEC6A235AB4BD33AA15AF5D15D" xlink:type="locator" />
    <link:definitionArc order="6" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_E53E99C08853116938EE3AA15AF44E27" xlink:to="loc_us-gaap_StockIssuedDuringPeriodValueConversionOfConvertibleSecurities_765701EEC6A235AB4BD33AA15AF5D15D" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_StockIssuedDuringPeriodSharesConversionOfConvertibleSecurities" xlink:label="loc_us-gaap_StockIssuedDuringPeriodSharesConversionOfConvertibleSecurities_E50FE924E1594B4360B73AA15AF515DC" xlink:type="locator" />
    <link:definitionArc order="7" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_E53E99C08853116938EE3AA15AF44E27" xlink:to="loc_us-gaap_StockIssuedDuringPeriodSharesConversionOfConvertibleSecurities_E50FE924E1594B4360B73AA15AF515DC" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_StockIssuedDuringPeriodValueEmployeeStockPurchasePlanNetofTaxWithholdings" xlink:label="loc_nmih_StockIssuedDuringPeriodValueEmployeeStockPurchasePlanNetofTaxWithholdings_482F684AE262E45C018C3AA15AF6DF2D" xlink:type="locator" />
    <link:definitionArc order="8" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_E53E99C08853116938EE3AA15AF44E27" xlink:to="loc_nmih_StockIssuedDuringPeriodValueEmployeeStockPurchasePlanNetofTaxWithholdings_482F684AE262E45C018C3AA15AF6DF2D" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_StockIssuedDuringPeriodSharesEmployeeStockPurchasePlansNetofSharesForTaxWithholdings" xlink:label="loc_nmih_StockIssuedDuringPeriodSharesEmployeeStockPurchasePlansNetofSharesForTaxWithholdings_3873C126152C91AA6B453AA15B414F46" xlink:type="locator" />
    <link:definitionArc order="9" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_E53E99C08853116938EE3AA15AF44E27" xlink:to="loc_nmih_StockIssuedDuringPeriodSharesEmployeeStockPurchasePlansNetofSharesForTaxWithholdings_3873C126152C91AA6B453AA15B414F46" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_AdjustmentsToAdditionalPaidInCapitalSharebasedCompensationRequisiteServicePeriodRecognitionValue" xlink:label="loc_us-gaap_AdjustmentsToAdditionalPaidInCapitalSharebasedCompensationRequisiteServicePeriodRecognitionValue_E511C2270E0D43A8FDC23AA15B428D2C" xlink:type="locator" />
    <link:definitionArc order="10" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_E53E99C08853116938EE3AA15AF44E27" xlink:to="loc_us-gaap_AdjustmentsToAdditionalPaidInCapitalSharebasedCompensationRequisiteServicePeriodRecognitionValue_E511C2270E0D43A8FDC23AA15B428D2C" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_OtherComprehensiveIncomeAvailableforsaleSecuritiesAdjustmentNetOfTaxPortionAttributableToParent" xlink:label="loc_us-gaap_OtherComprehensiveIncomeAvailableforsaleSecuritiesAdjustmentNetOfTaxPortionAttributableToParent_44B7B7ABBD287435A3FF3AA15B422FB5" xlink:type="locator" />
    <link:definitionArc order="11" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_E53E99C08853116938EE3AA15AF44E27" xlink:to="loc_us-gaap_OtherComprehensiveIncomeAvailableforsaleSecuritiesAdjustmentNetOfTaxPortionAttributableToParent_44B7B7ABBD287435A3FF3AA15B422FB5" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_NetIncomeLoss" xlink:label="loc_us-gaap_NetIncomeLoss_A21A80D69BF216B9B4DB3AA15B42A262" xlink:type="locator" />
    <link:definitionArc order="12" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInStockholdersEquityRollForward_E53E99C08853116938EE3AA15AF44E27" xlink:to="loc_us-gaap_NetIncomeLoss_A21A80D69BF216B9B4DB3AA15B42A262" xlink:type="arc" />
  </link:definitionLink>
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/ConsolidatedStatementsOfChangesInShareholdersEquityParenthetical" xlink:type="extended">
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_StatementLineItems" xlink:label="loc_us-gaap_StatementLineItems_8D97900BD082E1EC2A963AA15AE7B9B1" xlink:type="locator" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_StatementTable" xlink:label="loc_us-gaap_StatementTable_ED0F0250C8F34DD786653AA15AE6CBB1" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_StatementLineItems_8D97900BD082E1EC2A963AA15AE7B9B1" xlink:to="loc_us-gaap_StatementTable_ED0F0250C8F34DD786653AA15AE6CBB1" xlink:type="arc" xbrldt:closed="true" xbrldt:contextElement="segment" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_StatementEquityComponentsAxis" xlink:label="loc_us-gaap_StatementEquityComponentsAxis_493C874B0A745D5F98BF3AA15AE6432B" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_StatementTable_ED0F0250C8F34DD786653AA15AE6CBB1" xlink:to="loc_us-gaap_StatementEquityComponentsAxis_493C874B0A745D5F98BF3AA15AE6432B" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_EquityComponentDomain" xlink:label="loc_us-gaap_EquityComponentDomain_3AC6C37DAE9D54561C773AA15AE78C87_default" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_StatementEquityComponentsAxis_493C874B0A745D5F98BF3AA15AE6432B" xlink:to="loc_us-gaap_EquityComponentDomain_3AC6C37DAE9D54561C773AA15AE78C87_default" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_EquityComponentDomain" xlink:label="loc_us-gaap_EquityComponentDomain_3AC6C37DAE9D54561C773AA15AE78C87" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_StatementEquityComponentsAxis_493C874B0A745D5F98BF3AA15AE6432B" xlink:to="loc_us-gaap_EquityComponentDomain_3AC6C37DAE9D54561C773AA15AE78C87" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_CommonStockMember" xlink:label="loc_us-gaap_CommonStockMember_FF3A4DDC95C5D9C29ADC3AA15AE74240" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquityComponentDomain_3AC6C37DAE9D54561C773AA15AE78C87" xlink:to="loc_us-gaap_CommonStockMember_FF3A4DDC95C5D9C29ADC3AA15AE74240" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_OtherComprehensiveIncomeLossAvailableForSaleSecuritiesTax" xlink:label="loc_us-gaap_OtherComprehensiveIncomeLossAvailableForSaleSecuritiesTax_A9BF1F2D4CEF1C6519273AA15AE883AD" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_8D97900BD082E1EC2A963AA15AE7B9B1" xlink:to="loc_us-gaap_OtherComprehensiveIncomeLossAvailableForSaleSecuritiesTax_A9BF1F2D4CEF1C6519273AA15AE883AD" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_StockIssuedDuringPeriodSharesConversionOfConvertibleSecurities" xlink:label="loc_us-gaap_StockIssuedDuringPeriodSharesConversionOfConvertibleSecurities_278AC6E596643A8998673AA15AE870A0" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_8D97900BD082E1EC2A963AA15AE7B9B1" xlink:to="loc_us-gaap_StockIssuedDuringPeriodSharesConversionOfConvertibleSecurities_278AC6E596643A8998673AA15AE870A0" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_CommonStockParOrStatedValuePerShare" xlink:label="loc_us-gaap_CommonStockParOrStatedValuePerShare_DDCB18AF79CB6C6389D53AA15AE858EB" xlink:type="locator" />
    <link:definitionArc order="3" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatementLineItems_8D97900BD082E1EC2A963AA15AE7B9B1" xlink:to="loc_us-gaap_CommonStockParOrStatedValuePerShare_DDCB18AF79CB6C6389D53AA15AE858EB" xlink:type="arc" />
  </link:definitionLink>
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/ConsolidatedStatementsOfOperationsAndComprehensiveIncome" xlink:type="extended" />
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/ConsolidatedStatementsOfOperationsAndComprehensiveIncomeParenthetical" xlink:type="extended" />
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/CoverPage" xlink:type="extended" />
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/Debt" xlink:type="extended" />
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/DebtNarrativeDetails" xlink:type="extended">
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_DebtInstrumentLineItems" xlink:label="loc_us-gaap_DebtInstrumentLineItems_5D7674FC6607F30DADA73AA1595E38D0" xlink:type="locator" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_DebtInstrumentTable" xlink:label="loc_us-gaap_DebtInstrumentTable_642F58069287C2C557E23AA159524068" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_DebtInstrumentLineItems_5D7674FC6607F30DADA73AA1595E38D0" xlink:to="loc_us-gaap_DebtInstrumentTable_642F58069287C2C557E23AA159524068" xlink:type="arc" xbrldt:closed="true" xbrldt:contextElement="segment" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_CreditFacilityAxis" xlink:label="loc_us-gaap_CreditFacilityAxis_751D7CF133C012AE4D513AA159533DB4" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DebtInstrumentTable_642F58069287C2C557E23AA159524068" xlink:to="loc_us-gaap_CreditFacilityAxis_751D7CF133C012AE4D513AA159533DB4" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_CreditFacilityDomain" xlink:label="loc_us-gaap_CreditFacilityDomain_9169966F31C877D12E733AA1595365A4_default" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_CreditFacilityAxis_751D7CF133C012AE4D513AA159533DB4" xlink:to="loc_us-gaap_CreditFacilityDomain_9169966F31C877D12E733AA1595365A4_default" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_CreditFacilityDomain" xlink:label="loc_us-gaap_CreditFacilityDomain_9169966F31C877D12E733AA1595365A4" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_CreditFacilityAxis_751D7CF133C012AE4D513AA159533DB4" xlink:to="loc_us-gaap_CreditFacilityDomain_9169966F31C877D12E733AA1595365A4" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_RevolvingCreditFacilityMember" xlink:label="loc_us-gaap_RevolvingCreditFacilityMember_8E7A8F423750EFCD79553AA15953C7CF" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_CreditFacilityDomain_9169966F31C877D12E733AA1595365A4" xlink:to="loc_us-gaap_RevolvingCreditFacilityMember_8E7A8F423750EFCD79553AA15953C7CF" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_LongtermDebtTypeAxis" xlink:label="loc_us-gaap_LongtermDebtTypeAxis_3A0FCF55EEB469EE10923AA1595427EE" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DebtInstrumentTable_642F58069287C2C557E23AA159524068" xlink:to="loc_us-gaap_LongtermDebtTypeAxis_3A0FCF55EEB469EE10923AA1595427EE" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_LongtermDebtTypeDomain" xlink:label="loc_us-gaap_LongtermDebtTypeDomain_DA392432CBC493F30CAE3AA15954CB25_default" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_LongtermDebtTypeAxis_3A0FCF55EEB469EE10923AA1595427EE" xlink:to="loc_us-gaap_LongtermDebtTypeDomain_DA392432CBC493F30CAE3AA15954CB25_default" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_LongtermDebtTypeDomain" xlink:label="loc_us-gaap_LongtermDebtTypeDomain_DA392432CBC493F30CAE3AA15954CB25" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_LongtermDebtTypeAxis_3A0FCF55EEB469EE10923AA1595427EE" xlink:to="loc_us-gaap_LongtermDebtTypeDomain_DA392432CBC493F30CAE3AA15954CB25" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_SecuredDebtMember" xlink:label="loc_us-gaap_SecuredDebtMember_78871C1E78C023BF8ACC3AA159545101" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LongtermDebtTypeDomain_DA392432CBC493F30CAE3AA15954CB25" xlink:to="loc_us-gaap_SecuredDebtMember_78871C1E78C023BF8ACC3AA159545101" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_SeniorSecuredDebtMember" xlink:label="loc_nmih_SeniorSecuredDebtMember_15B32334D98BEC5DCED83AA15955381E" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LongtermDebtTypeDomain_DA392432CBC493F30CAE3AA15954CB25" xlink:to="loc_nmih_SeniorSecuredDebtMember_15B32334D98BEC5DCED83AA15955381E" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_DebtInstrumentAxis" xlink:label="loc_us-gaap_DebtInstrumentAxis_5540E962BC6CECDF2E3C3AA159559557" xlink:type="locator" />
    <link:definitionArc order="3" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DebtInstrumentTable_642F58069287C2C557E23AA159524068" xlink:to="loc_us-gaap_DebtInstrumentAxis_5540E962BC6CECDF2E3C3AA159559557" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_DebtInstrumentNameDomain" xlink:label="loc_us-gaap_DebtInstrumentNameDomain_6D0F0F61C5F9BCFF65F13AA15955DF4A_default" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_DebtInstrumentAxis_5540E962BC6CECDF2E3C3AA159559557" xlink:to="loc_us-gaap_DebtInstrumentNameDomain_6D0F0F61C5F9BCFF65F13AA15955DF4A_default" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_DebtInstrumentNameDomain" xlink:label="loc_us-gaap_DebtInstrumentNameDomain_6D0F0F61C5F9BCFF65F13AA15955DF4A" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_DebtInstrumentAxis_5540E962BC6CECDF2E3C3AA159559557" xlink:to="loc_us-gaap_DebtInstrumentNameDomain_6D0F0F61C5F9BCFF65F13AA15955DF4A" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_SeniorSecuredTermLoan2018Member" xlink:label="loc_nmih_SeniorSecuredTermLoan2018Member_DED0664A1D28A24393043AA15955AF12" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentNameDomain_6D0F0F61C5F9BCFF65F13AA15955DF4A" xlink:to="loc_nmih_SeniorSecuredTermLoan2018Member_DED0664A1D28A24393043AA15955AF12" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_SecuredRevolvingCreditFacility2018Member" xlink:label="loc_nmih_SecuredRevolvingCreditFacility2018Member_310CA11A8B50C678ECF13AA159561B0A" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentNameDomain_6D0F0F61C5F9BCFF65F13AA15955DF4A" xlink:to="loc_nmih_SecuredRevolvingCreditFacility2018Member_310CA11A8B50C678ECF13AA159561B0A" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_CreditAgreementAmendmentMember" xlink:label="loc_nmih_CreditAgreementAmendmentMember_EB6C43F210F221A5C8493AA15956A031" xlink:type="locator" />
    <link:definitionArc order="3" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentNameDomain_6D0F0F61C5F9BCFF65F13AA15955DF4A" xlink:to="loc_nmih_CreditAgreementAmendmentMember_EB6C43F210F221A5C8493AA15956A031" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_VariableRateAxis" xlink:label="loc_us-gaap_VariableRateAxis_6AAB7ED4494C54924C193AA159564B23" xlink:type="locator" />
    <link:definitionArc order="4" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DebtInstrumentTable_642F58069287C2C557E23AA159524068" xlink:to="loc_us-gaap_VariableRateAxis_6AAB7ED4494C54924C193AA159564B23" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_VariableRateDomain" xlink:label="loc_us-gaap_VariableRateDomain_49734CD87607D41AC3B03AA1595635F1_default" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_VariableRateAxis_6AAB7ED4494C54924C193AA159564B23" xlink:to="loc_us-gaap_VariableRateDomain_49734CD87607D41AC3B03AA1595635F1_default" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_VariableRateDomain" xlink:label="loc_us-gaap_VariableRateDomain_49734CD87607D41AC3B03AA1595635F1" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_VariableRateAxis_6AAB7ED4494C54924C193AA159564B23" xlink:to="loc_us-gaap_VariableRateDomain_49734CD87607D41AC3B03AA1595635F1" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_BaseRateMember" xlink:label="loc_us-gaap_BaseRateMember_D75059ABA07CC6C4E2693AA15957BBD2" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_VariableRateDomain_49734CD87607D41AC3B03AA1595635F1" xlink:to="loc_us-gaap_BaseRateMember_D75059ABA07CC6C4E2693AA15957BBD2" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_LondonInterbankOfferedRateLIBORMember" xlink:label="loc_us-gaap_LondonInterbankOfferedRateLIBORMember_D3B01B8F0E077DBE76723AA15957179C" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_VariableRateDomain_49734CD87607D41AC3B03AA1595635F1" xlink:to="loc_us-gaap_LondonInterbankOfferedRateLIBORMember_D3B01B8F0E077DBE76723AA15957179C" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_EurodollarMember" xlink:label="loc_us-gaap_EurodollarMember_9E86F082FE27F68326863AA159577604" xlink:type="locator" />
    <link:definitionArc order="3" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_VariableRateDomain_49734CD87607D41AC3B03AA1595635F1" xlink:to="loc_us-gaap_EurodollarMember_9E86F082FE27F68326863AA159577604" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_RangeAxis" xlink:label="loc_srt_RangeAxis_C56D37FF274E22162FCF3AA1595D9B2D" xlink:type="locator" />
    <link:definitionArc order="5" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DebtInstrumentTable_642F58069287C2C557E23AA159524068" xlink:to="loc_srt_RangeAxis_C56D37FF274E22162FCF3AA1595D9B2D" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_RangeMember" xlink:label="loc_srt_RangeMember_E46EAFCA32816B0D86943AA1595DF6D3_default" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_RangeAxis_C56D37FF274E22162FCF3AA1595D9B2D" xlink:to="loc_srt_RangeMember_E46EAFCA32816B0D86943AA1595DF6D3_default" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_RangeMember" xlink:label="loc_srt_RangeMember_E46EAFCA32816B0D86943AA1595DF6D3" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_RangeAxis_C56D37FF274E22162FCF3AA1595D9B2D" xlink:to="loc_srt_RangeMember_E46EAFCA32816B0D86943AA1595DF6D3" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_MinimumMember" xlink:label="loc_srt_MinimumMember_326E74ABFB04EC0DA29E3AA1595DADAB" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RangeMember_E46EAFCA32816B0D86943AA1595DF6D3" xlink:to="loc_srt_MinimumMember_326E74ABFB04EC0DA29E3AA1595DADAB" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_MaximumMember" xlink:label="loc_srt_MaximumMember_72306A2BD8C9A41C41613AA1595E352A" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RangeMember_E46EAFCA32816B0D86943AA1595DF6D3" xlink:to="loc_srt_MaximumMember_72306A2BD8C9A41C41613AA1595E352A" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_DebtInstrumentFaceAmount" xlink:label="loc_us-gaap_DebtInstrumentFaceAmount_F6EDF2403F2D8E6A1F6B3AA1595E7A29" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentLineItems_5D7674FC6607F30DADA73AA1595E38D0" xlink:to="loc_us-gaap_DebtInstrumentFaceAmount_F6EDF2403F2D8E6A1F6B3AA1595E7A29" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_DebtInstrumentTerm" xlink:label="loc_us-gaap_DebtInstrumentTerm_B519F72B1797297F72CE3AA1595EDE8E" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentLineItems_5D7674FC6607F30DADA73AA1595E38D0" xlink:to="loc_us-gaap_DebtInstrumentTerm_B519F72B1797297F72CE3AA1595EDE8E" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_LineOfCreditFacilityMaximumBorrowingCapacity" xlink:label="loc_us-gaap_LineOfCreditFacilityMaximumBorrowingCapacity_C83EE98B8AEEB1584C9D3AA1595F3078" xlink:type="locator" />
    <link:definitionArc order="3" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentLineItems_5D7674FC6607F30DADA73AA1595E38D0" xlink:to="loc_us-gaap_LineOfCreditFacilityMaximumBorrowingCapacity_C83EE98B8AEEB1584C9D3AA1595F3078" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_DebtInstrumentVariableInterestRateFloor" xlink:label="loc_nmih_DebtInstrumentVariableInterestRateFloor_828C7D637C88B3C683373AA1595F3F11" xlink:type="locator" />
    <link:definitionArc order="4" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentLineItems_5D7674FC6607F30DADA73AA1595E38D0" xlink:to="loc_nmih_DebtInstrumentVariableInterestRateFloor_828C7D637C88B3C683373AA1595F3F11" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_DebtInstrumentBasisSpreadOnVariableRate1" xlink:label="loc_us-gaap_DebtInstrumentBasisSpreadOnVariableRate1_26F77A419022ACE4DB003AA1595F9E43" xlink:type="locator" />
    <link:definitionArc order="5" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentLineItems_5D7674FC6607F30DADA73AA1595E38D0" xlink:to="loc_us-gaap_DebtInstrumentBasisSpreadOnVariableRate1_26F77A419022ACE4DB003AA1595F9E43" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_LineOfCreditFacilityFairValueOfAmountOutstanding" xlink:label="loc_us-gaap_LineOfCreditFacilityFairValueOfAmountOutstanding_77F135EB0ADC9C748BE03AA1595F9F90" xlink:type="locator" />
    <link:definitionArc order="6" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentLineItems_5D7674FC6607F30DADA73AA1595E38D0" xlink:to="loc_us-gaap_LineOfCreditFacilityFairValueOfAmountOutstanding_77F135EB0ADC9C748BE03AA1595F9F90" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_DebtInstrumentInterestRateDuringPeriod" xlink:label="loc_us-gaap_DebtInstrumentInterestRateDuringPeriod_598A63723A960383D2543AA159600C07" xlink:type="locator" />
    <link:definitionArc order="7" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentLineItems_5D7674FC6607F30DADA73AA1595E38D0" xlink:to="loc_us-gaap_DebtInstrumentInterestRateDuringPeriod_598A63723A960383D2543AA159600C07" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_DebtInstrumentFrequencyOfPeriodicPayment" xlink:label="loc_us-gaap_DebtInstrumentFrequencyOfPeriodicPayment_567051F652DEF8C967483AA159605E64" xlink:type="locator" />
    <link:definitionArc order="8" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentLineItems_5D7674FC6607F30DADA73AA1595E38D0" xlink:to="loc_us-gaap_DebtInstrumentFrequencyOfPeriodicPayment_567051F652DEF8C967483AA159605E64" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_DebtInstrumentPeriodicPaymentPrincipal" xlink:label="loc_us-gaap_DebtInstrumentPeriodicPaymentPrincipal_880A2D1B64E94FC54A743AA159602EE2" xlink:type="locator" />
    <link:definitionArc order="9" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentLineItems_5D7674FC6607F30DADA73AA1595E38D0" xlink:to="loc_us-gaap_DebtInstrumentPeriodicPaymentPrincipal_880A2D1B64E94FC54A743AA159602EE2" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_DebtInstrumentCarryingAmount" xlink:label="loc_us-gaap_DebtInstrumentCarryingAmount_915BB22BE066E48C539D3AA159608413" xlink:type="locator" />
    <link:definitionArc order="10" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentLineItems_5D7674FC6607F30DADA73AA1595E38D0" xlink:to="loc_us-gaap_DebtInstrumentCarryingAmount_915BB22BE066E48C539D3AA159608413" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_InterestExpense" xlink:label="loc_us-gaap_InterestExpense_CEFCC204E4024063659A3AA15960A6F6" xlink:type="locator" />
    <link:definitionArc order="11" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentLineItems_5D7674FC6607F30DADA73AA1595E38D0" xlink:to="loc_us-gaap_InterestExpense_CEFCC204E4024063659A3AA15960A6F6" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_DebtInstrumentUnamortizedDiscountPremiumAndDebtIssuanceCostsNet" xlink:label="loc_us-gaap_DebtInstrumentUnamortizedDiscountPremiumAndDebtIssuanceCostsNet_34D859EC22A969AEE2E93AA159616621" xlink:type="locator" />
    <link:definitionArc order="12" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentLineItems_5D7674FC6607F30DADA73AA1595E38D0" xlink:to="loc_us-gaap_DebtInstrumentUnamortizedDiscountPremiumAndDebtIssuanceCostsNet_34D859EC22A969AEE2E93AA159616621" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_DebtInstrumentCovenantDebttoTotalCapitalizationRatioMaximum" xlink:label="loc_nmih_DebtInstrumentCovenantDebttoTotalCapitalizationRatioMaximum_DD90CB0A6AB3F2A1D1433AA15961AEE5" xlink:type="locator" />
    <link:definitionArc order="13" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentLineItems_5D7674FC6607F30DADA73AA1595E38D0" xlink:to="loc_nmih_DebtInstrumentCovenantDebttoTotalCapitalizationRatioMaximum_DD90CB0A6AB3F2A1D1433AA15961AEE5" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_LineOfCreditFacilityUnusedCapacityCommitmentFeePercentage" xlink:label="loc_us-gaap_LineOfCreditFacilityUnusedCapacityCommitmentFeePercentage_AB78C23E37A807331F9A3AA159612495" xlink:type="locator" />
    <link:definitionArc order="14" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentLineItems_5D7674FC6607F30DADA73AA1595E38D0" xlink:to="loc_us-gaap_LineOfCreditFacilityUnusedCapacityCommitmentFeePercentage_AB78C23E37A807331F9A3AA159612495" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_LineOfCreditFacilityCommitmentFeeAmount" xlink:label="loc_us-gaap_LineOfCreditFacilityCommitmentFeeAmount_4B44E1E3F918FF0EA6D93AA15961C611" xlink:type="locator" />
    <link:definitionArc order="15" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentLineItems_5D7674FC6607F30DADA73AA1595E38D0" xlink:to="loc_us-gaap_LineOfCreditFacilityCommitmentFeeAmount_4B44E1E3F918FF0EA6D93AA15961C611" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_DeferredFinanceCostsGross" xlink:label="loc_us-gaap_DeferredFinanceCostsGross_0299F205FDC7A89A5B713AA15962260C" xlink:type="locator" />
    <link:definitionArc order="16" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentLineItems_5D7674FC6607F30DADA73AA1595E38D0" xlink:to="loc_us-gaap_DeferredFinanceCostsGross_0299F205FDC7A89A5B713AA15962260C" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_AmortizationOfFinancingCosts" xlink:label="loc_us-gaap_AmortizationOfFinancingCosts_D887AEA962BB2DF86F7A3AA159625A4C" xlink:type="locator" />
    <link:definitionArc order="17" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentLineItems_5D7674FC6607F30DADA73AA1595E38D0" xlink:to="loc_us-gaap_AmortizationOfFinancingCosts_D887AEA962BB2DF86F7A3AA159625A4C" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_DebtIssuanceCostsLineOfCreditArrangementsNet" xlink:label="loc_us-gaap_DebtIssuanceCostsLineOfCreditArrangementsNet_307945D194BC2876EE673AA159625F1A" xlink:type="locator" />
    <link:definitionArc order="18" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentLineItems_5D7674FC6607F30DADA73AA1595E38D0" xlink:to="loc_us-gaap_DebtIssuanceCostsLineOfCreditArrangementsNet_307945D194BC2876EE673AA159625F1A" xlink:type="arc" />
  </link:definitionLink>
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/DebtScheduleOfFuturePrincipalPaymentsDetails" xlink:type="extended" />
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/DebtTables" xlink:type="extended" />
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/EarningsPerShare" xlink:type="extended" />
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/EarningsPerShareDetails" xlink:type="extended" />
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/EarningsPerShareTables" xlink:type="extended" />
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/FairValueOfFinancialInstruments" xlink:type="extended" />
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/FairValueOfFinancialInstrumentsAssetsAndLiabilitiesAtFairValueDetails" xlink:type="extended">
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems" xlink:label="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems_874AA0D65C9F3A1CA24A3AA15A1385F7" xlink:type="locator" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisTable" xlink:label="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisTable_902EDDF6D49BE7E47D953AA15A09D3D8" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems_874AA0D65C9F3A1CA24A3AA15A1385F7" xlink:to="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisTable_902EDDF6D49BE7E47D953AA15A09D3D8" xlink:type="arc" xbrldt:closed="true" xbrldt:contextElement="segment" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_FairValueByMeasurementFrequencyAxis" xlink:label="loc_us-gaap_FairValueByMeasurementFrequencyAxis_A5F3353E0E38914F19803AA15A0FB972" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisTable_902EDDF6D49BE7E47D953AA15A09D3D8" xlink:to="loc_us-gaap_FairValueByMeasurementFrequencyAxis_A5F3353E0E38914F19803AA15A0FB972" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_FairValueMeasurementFrequencyDomain" xlink:label="loc_us-gaap_FairValueMeasurementFrequencyDomain_F2DB645D283F63F8DFDC3AA15A0F19B1_default" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FairValueByMeasurementFrequencyAxis_A5F3353E0E38914F19803AA15A0FB972" xlink:to="loc_us-gaap_FairValueMeasurementFrequencyDomain_F2DB645D283F63F8DFDC3AA15A0F19B1_default" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_FairValueMeasurementFrequencyDomain" xlink:label="loc_us-gaap_FairValueMeasurementFrequencyDomain_F2DB645D283F63F8DFDC3AA15A0F19B1" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FairValueByMeasurementFrequencyAxis_A5F3353E0E38914F19803AA15A0FB972" xlink:to="loc_us-gaap_FairValueMeasurementFrequencyDomain_F2DB645D283F63F8DFDC3AA15A0F19B1" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_FairValueMeasurementsRecurringMember" xlink:label="loc_us-gaap_FairValueMeasurementsRecurringMember_9A411977F198F454A25D3AA15A105097" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueMeasurementFrequencyDomain_F2DB645D283F63F8DFDC3AA15A0F19B1" xlink:to="loc_us-gaap_FairValueMeasurementsRecurringMember_9A411977F198F454A25D3AA15A105097" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_FairValueByFairValueHierarchyLevelAxis" xlink:label="loc_us-gaap_FairValueByFairValueHierarchyLevelAxis_5E34FF89F1A52CFCC0F13AA15A10E796" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisTable_902EDDF6D49BE7E47D953AA15A09D3D8" xlink:to="loc_us-gaap_FairValueByFairValueHierarchyLevelAxis_5E34FF89F1A52CFCC0F13AA15A10E796" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_FairValueMeasurementsFairValueHierarchyDomain" xlink:label="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_8878619D5B20F769C25B3AA15A10BF11_default" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FairValueByFairValueHierarchyLevelAxis_5E34FF89F1A52CFCC0F13AA15A10E796" xlink:to="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_8878619D5B20F769C25B3AA15A10BF11_default" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_FairValueMeasurementsFairValueHierarchyDomain" xlink:label="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_8878619D5B20F769C25B3AA15A10BF11" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FairValueByFairValueHierarchyLevelAxis_5E34FF89F1A52CFCC0F13AA15A10E796" xlink:to="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_8878619D5B20F769C25B3AA15A10BF11" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_FairValueInputsLevel1Member" xlink:label="loc_us-gaap_FairValueInputsLevel1Member_2E6834F65AB380067B093AA15A1122F5" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_8878619D5B20F769C25B3AA15A10BF11" xlink:to="loc_us-gaap_FairValueInputsLevel1Member_2E6834F65AB380067B093AA15A1122F5" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_FairValueInputsLevel2Member" xlink:label="loc_us-gaap_FairValueInputsLevel2Member_FBA8175182F6B6F2E9A73AA15A11A3C3" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_8878619D5B20F769C25B3AA15A10BF11" xlink:to="loc_us-gaap_FairValueInputsLevel2Member_FBA8175182F6B6F2E9A73AA15A11A3C3" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_FairValueInputsLevel3Member" xlink:label="loc_us-gaap_FairValueInputsLevel3Member_9AE46D9FFF013F1E5FB33AA15A1156C8" xlink:type="locator" />
    <link:definitionArc order="3" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_8878619D5B20F769C25B3AA15A10BF11" xlink:to="loc_us-gaap_FairValueInputsLevel3Member_9AE46D9FFF013F1E5FB33AA15A1156C8" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_FinancialInstrumentAxis" xlink:label="loc_us-gaap_FinancialInstrumentAxis_DECD02DC1B22B6D4CFEF3AA15A125C35" xlink:type="locator" />
    <link:definitionArc order="3" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisTable_902EDDF6D49BE7E47D953AA15A09D3D8" xlink:to="loc_us-gaap_FinancialInstrumentAxis_DECD02DC1B22B6D4CFEF3AA15A125C35" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain" xlink:label="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_5C26807D134789811C273AA15A120E66_default" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FinancialInstrumentAxis_DECD02DC1B22B6D4CFEF3AA15A125C35" xlink:to="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_5C26807D134789811C273AA15A120E66_default" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain" xlink:label="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_5C26807D134789811C273AA15A120E66" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FinancialInstrumentAxis_DECD02DC1B22B6D4CFEF3AA15A125C35" xlink:to="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_5C26807D134789811C273AA15A120E66" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_USTreasuryAndGovernmentMember" xlink:label="loc_us-gaap_USTreasuryAndGovernmentMember_1FE14CF24260CE1E0F5F3AA15A120045" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_5C26807D134789811C273AA15A120E66" xlink:to="loc_us-gaap_USTreasuryAndGovernmentMember_1FE14CF24260CE1E0F5F3AA15A120045" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_USStatesAndPoliticalSubdivisionsMember" xlink:label="loc_us-gaap_USStatesAndPoliticalSubdivisionsMember_F5DFC20041970A5609A43AA15A12ADE1" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_5C26807D134789811C273AA15A120E66" xlink:to="loc_us-gaap_USStatesAndPoliticalSubdivisionsMember_F5DFC20041970A5609A43AA15A12ADE1" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_CorporateDebtSecuritiesMember" xlink:label="loc_us-gaap_CorporateDebtSecuritiesMember_CD80E759C4D5C3A8AB713AA15A13B234" xlink:type="locator" />
    <link:definitionArc order="3" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_5C26807D134789811C273AA15A120E66" xlink:to="loc_us-gaap_CorporateDebtSecuritiesMember_CD80E759C4D5C3A8AB713AA15A13B234" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_AssetBackedSecuritiesMember" xlink:label="loc_us-gaap_AssetBackedSecuritiesMember_3BFDFA58EF8B88F2A3C13AA15A137423" xlink:type="locator" />
    <link:definitionArc order="4" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_5C26807D134789811C273AA15A120E66" xlink:to="loc_us-gaap_AssetBackedSecuritiesMember_3BFDFA58EF8B88F2A3C13AA15A137423" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_WarrantMember" xlink:label="loc_us-gaap_WarrantMember_35E4595A66E725B6D9413AA15A137197" xlink:type="locator" />
    <link:definitionArc order="5" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_5C26807D134789811C273AA15A120E66" xlink:to="loc_us-gaap_WarrantMember_35E4595A66E725B6D9413AA15A137197" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_AvailableForSaleSecuritiesDebtSecurities" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtSecurities_1AD620BACB9A233DE8BA3AA15A143051" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems_874AA0D65C9F3A1CA24A3AA15A1385F7" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtSecurities_1AD620BACB9A233DE8BA3AA15A143051" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_CashAndCashEquivalentsFairValueDisclosure" xlink:label="loc_us-gaap_CashAndCashEquivalentsFairValueDisclosure_9C99EE3B2970673532013AA15A1417D7" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems_874AA0D65C9F3A1CA24A3AA15A1385F7" xlink:to="loc_us-gaap_CashAndCashEquivalentsFairValueDisclosure_9C99EE3B2970673532013AA15A1417D7" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_AssetsFairValueDisclosure" xlink:label="loc_us-gaap_AssetsFairValueDisclosure_43C7630C57C29816AF8F3AA15A148606" xlink:type="locator" />
    <link:definitionArc order="3" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems_874AA0D65C9F3A1CA24A3AA15A1385F7" xlink:to="loc_us-gaap_AssetsFairValueDisclosure_43C7630C57C29816AF8F3AA15A148606" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_DerivativeLiabilities" xlink:label="loc_us-gaap_DerivativeLiabilities_0077F606EBAFAC8B314F3AA15A14741A" xlink:type="locator" />
    <link:definitionArc order="4" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems_874AA0D65C9F3A1CA24A3AA15A1385F7" xlink:to="loc_us-gaap_DerivativeLiabilities_0077F606EBAFAC8B314F3AA15A14741A" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_LiabilitiesFairValueDisclosure" xlink:label="loc_us-gaap_LiabilitiesFairValueDisclosure_F6C48259E78A7C48DE143AA15A14A810" xlink:type="locator" />
    <link:definitionArc order="5" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems_874AA0D65C9F3A1CA24A3AA15A1385F7" xlink:to="loc_us-gaap_LiabilitiesFairValueDisclosure_F6C48259E78A7C48DE143AA15A14A810" xlink:type="arc" />
  </link:definitionLink>
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/FairValueOfFinancialInstrumentsNarrativeDetails" xlink:type="extended">
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems" xlink:label="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems_35F8372F3C1C019574DA3AA159AA642C" xlink:type="locator" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisTable" xlink:label="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisTable_C4CEF85062C906519F5C3AA1599D31AD" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems_35F8372F3C1C019574DA3AA159AA642C" xlink:to="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisTable_C4CEF85062C906519F5C3AA1599D31AD" xlink:type="arc" xbrldt:closed="true" xbrldt:contextElement="segment" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_RangeAxis" xlink:label="loc_srt_RangeAxis_46FD1839B12C9F55337C3AA1599D133A" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisTable_C4CEF85062C906519F5C3AA1599D31AD" xlink:to="loc_srt_RangeAxis_46FD1839B12C9F55337C3AA1599D133A" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_RangeMember" xlink:label="loc_srt_RangeMember_09DC0499B153C54F5ED53AA1599ED515_default" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_RangeAxis_46FD1839B12C9F55337C3AA1599D133A" xlink:to="loc_srt_RangeMember_09DC0499B153C54F5ED53AA1599ED515_default" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_RangeMember" xlink:label="loc_srt_RangeMember_09DC0499B153C54F5ED53AA1599ED515" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_RangeAxis_46FD1839B12C9F55337C3AA1599D133A" xlink:to="loc_srt_RangeMember_09DC0499B153C54F5ED53AA1599ED515" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_MaximumMember" xlink:label="loc_srt_MaximumMember_0AD5B72DF020DBED36B33AA1599E32BC" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RangeMember_09DC0499B153C54F5ED53AA1599ED515" xlink:to="loc_srt_MaximumMember_0AD5B72DF020DBED36B33AA1599E32BC" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_MinimumMember" xlink:label="loc_srt_MinimumMember_4B51AF5A4686D234F6D23AA1599F258D" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RangeMember_09DC0499B153C54F5ED53AA1599ED515" xlink:to="loc_srt_MinimumMember_4B51AF5A4686D234F6D23AA1599F258D" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ValuationTechniqueAxis" xlink:label="loc_us-gaap_ValuationTechniqueAxis_E5674095854CA6AD5AE03AA1599F6A2B" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisTable_C4CEF85062C906519F5C3AA1599D31AD" xlink:to="loc_us-gaap_ValuationTechniqueAxis_E5674095854CA6AD5AE03AA1599F6A2B" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ValuationTechniqueDomain" xlink:label="loc_us-gaap_ValuationTechniqueDomain_29A55130409F54F7ECA43AA1599F5A06_default" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_ValuationTechniqueAxis_E5674095854CA6AD5AE03AA1599F6A2B" xlink:to="loc_us-gaap_ValuationTechniqueDomain_29A55130409F54F7ECA43AA1599F5A06_default" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ValuationTechniqueDomain" xlink:label="loc_us-gaap_ValuationTechniqueDomain_29A55130409F54F7ECA43AA1599F5A06" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_ValuationTechniqueAxis_E5674095854CA6AD5AE03AA1599F6A2B" xlink:to="loc_us-gaap_ValuationTechniqueDomain_29A55130409F54F7ECA43AA1599F5A06" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ValuationTechniqueOptionPricingModelMember" xlink:label="loc_us-gaap_ValuationTechniqueOptionPricingModelMember_DEB95F3E5B3ED93071A83AA159A034E9" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ValuationTechniqueDomain_29A55130409F54F7ECA43AA1599F5A06" xlink:to="loc_us-gaap_ValuationTechniqueOptionPricingModelMember_DEB95F3E5B3ED93071A83AA159A034E9" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_MeasurementInputTypeAxis" xlink:label="loc_us-gaap_MeasurementInputTypeAxis_670FBD66F4F550ADBA903AA159A0FEAE" xlink:type="locator" />
    <link:definitionArc order="3" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisTable_C4CEF85062C906519F5C3AA1599D31AD" xlink:to="loc_us-gaap_MeasurementInputTypeAxis_670FBD66F4F550ADBA903AA159A0FEAE" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_MeasurementInputTypeDomain" xlink:label="loc_us-gaap_MeasurementInputTypeDomain_D1402EB49EA8637279B23AA159A14279_default" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_MeasurementInputTypeAxis_670FBD66F4F550ADBA903AA159A0FEAE" xlink:to="loc_us-gaap_MeasurementInputTypeDomain_D1402EB49EA8637279B23AA159A14279_default" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_MeasurementInputTypeDomain" xlink:label="loc_us-gaap_MeasurementInputTypeDomain_D1402EB49EA8637279B23AA159A14279" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_MeasurementInputTypeAxis_670FBD66F4F550ADBA903AA159A0FEAE" xlink:to="loc_us-gaap_MeasurementInputTypeDomain_D1402EB49EA8637279B23AA159A14279" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_MeasurementInputExpectedTermMember" xlink:label="loc_us-gaap_MeasurementInputExpectedTermMember_E7AC6C4AFC17E64DBEA43AA159A12716" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_MeasurementInputTypeDomain_D1402EB49EA8637279B23AA159A14279" xlink:to="loc_us-gaap_MeasurementInputExpectedTermMember_E7AC6C4AFC17E64DBEA43AA159A12716" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_MeasurementInputOptionVolatilityMember" xlink:label="loc_us-gaap_MeasurementInputOptionVolatilityMember_C4EC530592087DDAC6EA3AA159A1FB23" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_MeasurementInputTypeDomain_D1402EB49EA8637279B23AA159A14279" xlink:to="loc_us-gaap_MeasurementInputOptionVolatilityMember_C4EC530592087DDAC6EA3AA159A1FB23" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_MeasurementInputRiskFreeInterestRateMember" xlink:label="loc_us-gaap_MeasurementInputRiskFreeInterestRateMember_135D12E8EA8ED5D7A62F3AA159A2A341" xlink:type="locator" />
    <link:definitionArc order="3" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_MeasurementInputTypeDomain_D1402EB49EA8637279B23AA159A14279" xlink:to="loc_us-gaap_MeasurementInputRiskFreeInterestRateMember_135D12E8EA8ED5D7A62F3AA159A2A341" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_DebtInstrumentAxis" xlink:label="loc_us-gaap_DebtInstrumentAxis_EF7F9B6DF4A430E0736B3AA159A296BC" xlink:type="locator" />
    <link:definitionArc order="4" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisTable_C4CEF85062C906519F5C3AA1599D31AD" xlink:to="loc_us-gaap_DebtInstrumentAxis_EF7F9B6DF4A430E0736B3AA159A296BC" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_DebtInstrumentNameDomain" xlink:label="loc_us-gaap_DebtInstrumentNameDomain_394B77F1EBCD411A53C23AA159A3B14A_default" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_DebtInstrumentAxis_EF7F9B6DF4A430E0736B3AA159A296BC" xlink:to="loc_us-gaap_DebtInstrumentNameDomain_394B77F1EBCD411A53C23AA159A3B14A_default" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_DebtInstrumentNameDomain" xlink:label="loc_us-gaap_DebtInstrumentNameDomain_394B77F1EBCD411A53C23AA159A3B14A" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_DebtInstrumentAxis_EF7F9B6DF4A430E0736B3AA159A296BC" xlink:to="loc_us-gaap_DebtInstrumentNameDomain_394B77F1EBCD411A53C23AA159A3B14A" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_SeniorSecuredTermLoan2018Member" xlink:label="loc_nmih_SeniorSecuredTermLoan2018Member_9D2A7A348638670014693AA159A35297" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DebtInstrumentNameDomain_394B77F1EBCD411A53C23AA159A3B14A" xlink:to="loc_nmih_SeniorSecuredTermLoan2018Member_9D2A7A348638670014693AA159A35297" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_LongtermDebtTypeAxis" xlink:label="loc_us-gaap_LongtermDebtTypeAxis_0665935C07B8096200963AA159A31763" xlink:type="locator" />
    <link:definitionArc order="5" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisTable_C4CEF85062C906519F5C3AA1599D31AD" xlink:to="loc_us-gaap_LongtermDebtTypeAxis_0665935C07B8096200963AA159A31763" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_LongtermDebtTypeDomain" xlink:label="loc_us-gaap_LongtermDebtTypeDomain_4933537684CD9A4D496C3AA159A48D87_default" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_LongtermDebtTypeAxis_0665935C07B8096200963AA159A31763" xlink:to="loc_us-gaap_LongtermDebtTypeDomain_4933537684CD9A4D496C3AA159A48D87_default" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_LongtermDebtTypeDomain" xlink:label="loc_us-gaap_LongtermDebtTypeDomain_4933537684CD9A4D496C3AA159A48D87" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_LongtermDebtTypeAxis_0665935C07B8096200963AA159A31763" xlink:to="loc_us-gaap_LongtermDebtTypeDomain_4933537684CD9A4D496C3AA159A48D87" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_SecuredDebtMember" xlink:label="loc_us-gaap_SecuredDebtMember_53903C11D2EEB299B4BD3AA159A4C923" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LongtermDebtTypeDomain_4933537684CD9A4D496C3AA159A48D87" xlink:to="loc_us-gaap_SecuredDebtMember_53903C11D2EEB299B4BD3AA159A4C923" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_FairValueByFairValueHierarchyLevelAxis" xlink:label="loc_us-gaap_FairValueByFairValueHierarchyLevelAxis_458F6B35E84DDE47449A3AA159A4E580" xlink:type="locator" />
    <link:definitionArc order="6" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisTable_C4CEF85062C906519F5C3AA1599D31AD" xlink:to="loc_us-gaap_FairValueByFairValueHierarchyLevelAxis_458F6B35E84DDE47449A3AA159A4E580" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_FairValueMeasurementsFairValueHierarchyDomain" xlink:label="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_C29DA106E9F2B3AD2A103AA159A4C93B_default" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FairValueByFairValueHierarchyLevelAxis_458F6B35E84DDE47449A3AA159A4E580" xlink:to="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_C29DA106E9F2B3AD2A103AA159A4C93B_default" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_FairValueMeasurementsFairValueHierarchyDomain" xlink:label="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_C29DA106E9F2B3AD2A103AA159A4C93B" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FairValueByFairValueHierarchyLevelAxis_458F6B35E84DDE47449A3AA159A4E580" xlink:to="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_C29DA106E9F2B3AD2A103AA159A4C93B" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_FairValueInputsLevel3Member" xlink:label="loc_us-gaap_FairValueInputsLevel3Member_880D303105DF8716A5C43AA159A46EC8" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_C29DA106E9F2B3AD2A103AA159A4C93B" xlink:to="loc_us-gaap_FairValueInputsLevel3Member_880D303105DF8716A5C43AA159A46EC8" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_FairValueInputsLevel2Member" xlink:label="loc_us-gaap_FairValueInputsLevel2Member_3F3A4BFCDB55D33FA0513AA159AAF983" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_C29DA106E9F2B3AD2A103AA159A4C93B" xlink:to="loc_us-gaap_FairValueInputsLevel2Member_3F3A4BFCDB55D33FA0513AA159AAF983" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_WarrantsAndRightsOutstandingTerm" xlink:label="loc_us-gaap_WarrantsAndRightsOutstandingTerm_3D563FD4C9E04608059F3AA159AA0B88" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems_35F8372F3C1C019574DA3AA159AA642C" xlink:to="loc_us-gaap_WarrantsAndRightsOutstandingTerm_3D563FD4C9E04608059F3AA159AA0B88" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_WarrantsAndRightsOutstandingMeasurementInput" xlink:label="loc_us-gaap_WarrantsAndRightsOutstandingMeasurementInput_0B62002B685F8FED4C423AA159ABCD96" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems_35F8372F3C1C019574DA3AA159AA642C" xlink:to="loc_us-gaap_WarrantsAndRightsOutstandingMeasurementInput_0B62002B685F8FED4C423AA159ABCD96" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_LongTermDebt" xlink:label="loc_us-gaap_LongTermDebt_1D06C69322128D3323E73AA159ABDAE3" xlink:type="locator" />
    <link:definitionArc order="3" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems_35F8372F3C1C019574DA3AA159AA642C" xlink:to="loc_us-gaap_LongTermDebt_1D06C69322128D3323E73AA159ABDAE3" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_DebtInstrumentUnamortizedDiscountPremiumAndDebtIssuanceCostsNet" xlink:label="loc_us-gaap_DebtInstrumentUnamortizedDiscountPremiumAndDebtIssuanceCostsNet_F1A9A0F9F41BF80722333AA159AB3C97" xlink:type="locator" />
    <link:definitionArc order="4" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems_35F8372F3C1C019574DA3AA159AA642C" xlink:to="loc_us-gaap_DebtInstrumentUnamortizedDiscountPremiumAndDebtIssuanceCostsNet_F1A9A0F9F41BF80722333AA159AB3C97" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_LongTermDebtFairValue" xlink:label="loc_us-gaap_LongTermDebtFairValue_8EF6A1C19E1A592CD9913AA159AB99B5" xlink:type="locator" />
    <link:definitionArc order="5" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisLineItems_35F8372F3C1C019574DA3AA159AA642C" xlink:to="loc_us-gaap_LongTermDebtFairValue_8EF6A1C19E1A592CD9913AA159AB99B5" xlink:type="arc" />
  </link:definitionLink>
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/FairValueOfFinancialInstrumentsRollfowardOfLevel3LiabilitiesDetails" xlink:type="extended">
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_FairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationLineItems" xlink:label="loc_us-gaap_FairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationLineItems_6366AC9CCE45284F24E83B290D99C57E" xlink:type="locator" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_FairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationTable" xlink:label="loc_us-gaap_FairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationTable_9FF1BA1AB59FEBDAB2243B290D97EF06" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_FairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationLineItems_6366AC9CCE45284F24E83B290D99C57E" xlink:to="loc_us-gaap_FairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationTable_9FF1BA1AB59FEBDAB2243B290D97EF06" xlink:type="arc" xbrldt:closed="true" xbrldt:contextElement="segment" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_FairValueByFairValueHierarchyLevelAxis" xlink:label="loc_us-gaap_FairValueByFairValueHierarchyLevelAxis_1D28AFE9C821502C4E523B290D97B577" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_FairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationTable_9FF1BA1AB59FEBDAB2243B290D97EF06" xlink:to="loc_us-gaap_FairValueByFairValueHierarchyLevelAxis_1D28AFE9C821502C4E523B290D97B577" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_FairValueMeasurementsFairValueHierarchyDomain" xlink:label="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_DE0E6BEAEA1B2646B5E43B290D9730C8_default" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FairValueByFairValueHierarchyLevelAxis_1D28AFE9C821502C4E523B290D97B577" xlink:to="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_DE0E6BEAEA1B2646B5E43B290D9730C8_default" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_FairValueMeasurementsFairValueHierarchyDomain" xlink:label="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_DE0E6BEAEA1B2646B5E43B290D9730C8" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FairValueByFairValueHierarchyLevelAxis_1D28AFE9C821502C4E523B290D97B577" xlink:to="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_DE0E6BEAEA1B2646B5E43B290D9730C8" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_FairValueInputsLevel3Member" xlink:label="loc_us-gaap_FairValueInputsLevel3Member_9C5BC29E385A794FB50C3B290D984FCD" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_DE0E6BEAEA1B2646B5E43B290D9730C8" xlink:to="loc_us-gaap_FairValueInputsLevel3Member_9C5BC29E385A794FB50C3B290D984FCD" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_FairValueByLiabilityClassAxis" xlink:label="loc_us-gaap_FairValueByLiabilityClassAxis_18471D1107CD7CF356613B290D981C9F" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_FairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationTable_9FF1BA1AB59FEBDAB2243B290D97EF06" xlink:to="loc_us-gaap_FairValueByLiabilityClassAxis_18471D1107CD7CF356613B290D981C9F" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_FairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationByLiabilityClassDomain" xlink:label="loc_us-gaap_FairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationByLiabilityClassDomain_BAE85C53AF50D23917EB3B290D98D0F0_default" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FairValueByLiabilityClassAxis_18471D1107CD7CF356613B290D981C9F" xlink:to="loc_us-gaap_FairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationByLiabilityClassDomain_BAE85C53AF50D23917EB3B290D98D0F0_default" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_FairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationByLiabilityClassDomain" xlink:label="loc_us-gaap_FairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationByLiabilityClassDomain_BAE85C53AF50D23917EB3B290D98D0F0" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FairValueByLiabilityClassAxis_18471D1107CD7CF356613B290D981C9F" xlink:to="loc_us-gaap_FairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationByLiabilityClassDomain_BAE85C53AF50D23917EB3B290D98D0F0" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_WarrantMember" xlink:label="loc_us-gaap_WarrantMember_5A617538A8581D05C22F3B290D98CC67" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationByLiabilityClassDomain_BAE85C53AF50D23917EB3B290D98D0F0" xlink:to="loc_us-gaap_WarrantMember_5A617538A8581D05C22F3B290D98CC67" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_FairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationCalculationRollForward" xlink:label="loc_us-gaap_FairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationCalculationRollForward_59F3E66CF730371D7FF13B290D9906B8" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationLineItems_6366AC9CCE45284F24E83B290D99C57E" xlink:to="loc_us-gaap_FairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationCalculationRollForward_59F3E66CF730371D7FF13B290D9906B8" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_FairValueMeasurementWithUnobservableInputsReconciliationsRecurringBasisLiabilityValue" xlink:label="loc_us-gaap_FairValueMeasurementWithUnobservableInputsReconciliationsRecurringBasisLiabilityValue_C40A6BE21A62275417543B290D99F5A6" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationCalculationRollForward_59F3E66CF730371D7FF13B290D9906B8" xlink:to="loc_us-gaap_FairValueMeasurementWithUnobservableInputsReconciliationsRecurringBasisLiabilityValue_C40A6BE21A62275417543B290D99F5A6" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_FairValueMeasurementWithUnobservableInputsReconciliationRecurringBasisLiabilityGainLossIncludedInEarnings" xlink:label="loc_us-gaap_FairValueMeasurementWithUnobservableInputsReconciliationRecurringBasisLiabilityGainLossIncludedInEarnings_011B8621DAFFE7AA28613B290D99E53A" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationCalculationRollForward_59F3E66CF730371D7FF13B290D9906B8" xlink:to="loc_us-gaap_FairValueMeasurementWithUnobservableInputsReconciliationRecurringBasisLiabilityGainLossIncludedInEarnings_011B8621DAFFE7AA28613B290D99E53A" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_FairValueMeasurementWithUnobservableInputsReconciliationRecurringBasisLiabilitySettlements" xlink:label="loc_us-gaap_FairValueMeasurementWithUnobservableInputsReconciliationRecurringBasisLiabilitySettlements_744C33587266DC688E133B290D997034" xlink:type="locator" />
    <link:definitionArc order="3" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationCalculationRollForward_59F3E66CF730371D7FF13B290D9906B8" xlink:to="loc_us-gaap_FairValueMeasurementWithUnobservableInputsReconciliationRecurringBasisLiabilitySettlements_744C33587266DC688E133B290D997034" xlink:type="arc" />
  </link:definitionLink>
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/FairValueOfFinancialInstrumentsTables" xlink:type="extended" />
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/FairValueOfFinancialInstrumentsValuationAssumptionsForWarrantLiabilitiesDetails" xlink:type="extended">
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisValuationTechniquesLineItems" xlink:label="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisValuationTechniquesLineItems_DEA02FD3CF3B1CC053A33AA159D17D5D" xlink:type="locator" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisValuationTechniquesTable" xlink:label="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisValuationTechniquesTable_2D46D56FFB6ECC96DA043AA159C7E12B" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisValuationTechniquesLineItems_DEA02FD3CF3B1CC053A33AA159D17D5D" xlink:to="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisValuationTechniquesTable_2D46D56FFB6ECC96DA043AA159C7E12B" xlink:type="arc" xbrldt:closed="true" xbrldt:contextElement="segment" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_FairValueByFairValueHierarchyLevelAxis" xlink:label="loc_us-gaap_FairValueByFairValueHierarchyLevelAxis_064A2D0151CB7516296F3AA159C76D5A" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisValuationTechniquesTable_2D46D56FFB6ECC96DA043AA159C7E12B" xlink:to="loc_us-gaap_FairValueByFairValueHierarchyLevelAxis_064A2D0151CB7516296F3AA159C76D5A" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_FairValueMeasurementsFairValueHierarchyDomain" xlink:label="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_D6B24195F9AE314144A53AA159C89790_default" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FairValueByFairValueHierarchyLevelAxis_064A2D0151CB7516296F3AA159C76D5A" xlink:to="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_D6B24195F9AE314144A53AA159C89790_default" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_FairValueMeasurementsFairValueHierarchyDomain" xlink:label="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_D6B24195F9AE314144A53AA159C89790" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FairValueByFairValueHierarchyLevelAxis_064A2D0151CB7516296F3AA159C76D5A" xlink:to="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_D6B24195F9AE314144A53AA159C89790" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_FairValueInputsLevel3Member" xlink:label="loc_us-gaap_FairValueInputsLevel3Member_1B21EC761373FF2CBF7E3AA159C8B239" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueMeasurementsFairValueHierarchyDomain_D6B24195F9AE314144A53AA159C89790" xlink:to="loc_us-gaap_FairValueInputsLevel3Member_1B21EC761373FF2CBF7E3AA159C8B239" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ValuationTechniqueAxis" xlink:label="loc_us-gaap_ValuationTechniqueAxis_873FB55E5C0A0C756BCD3AA159C80385" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisValuationTechniquesTable_2D46D56FFB6ECC96DA043AA159C7E12B" xlink:to="loc_us-gaap_ValuationTechniqueAxis_873FB55E5C0A0C756BCD3AA159C80385" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ValuationTechniqueDomain" xlink:label="loc_us-gaap_ValuationTechniqueDomain_9D18CB32F684F36732353AA159C8E01E_default" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_ValuationTechniqueAxis_873FB55E5C0A0C756BCD3AA159C80385" xlink:to="loc_us-gaap_ValuationTechniqueDomain_9D18CB32F684F36732353AA159C8E01E_default" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ValuationTechniqueDomain" xlink:label="loc_us-gaap_ValuationTechniqueDomain_9D18CB32F684F36732353AA159C8E01E" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_ValuationTechniqueAxis_873FB55E5C0A0C756BCD3AA159C80385" xlink:to="loc_us-gaap_ValuationTechniqueDomain_9D18CB32F684F36732353AA159C8E01E" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ValuationTechniqueOptionPricingModelMember" xlink:label="loc_us-gaap_ValuationTechniqueOptionPricingModelMember_787ACFF169B34DD216B43AA159C904E4" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ValuationTechniqueDomain_9D18CB32F684F36732353AA159C8E01E" xlink:to="loc_us-gaap_ValuationTechniqueOptionPricingModelMember_787ACFF169B34DD216B43AA159C904E4" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_MeasurementInputTypeAxis" xlink:label="loc_us-gaap_MeasurementInputTypeAxis_F104E652A355A3CDE0C53AA159C9A807" xlink:type="locator" />
    <link:definitionArc order="3" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisValuationTechniquesTable_2D46D56FFB6ECC96DA043AA159C7E12B" xlink:to="loc_us-gaap_MeasurementInputTypeAxis_F104E652A355A3CDE0C53AA159C9A807" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_MeasurementInputTypeDomain" xlink:label="loc_us-gaap_MeasurementInputTypeDomain_9ACB9703D77020DE01583AA159C934C2_default" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_MeasurementInputTypeAxis_F104E652A355A3CDE0C53AA159C9A807" xlink:to="loc_us-gaap_MeasurementInputTypeDomain_9ACB9703D77020DE01583AA159C934C2_default" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_MeasurementInputTypeDomain" xlink:label="loc_us-gaap_MeasurementInputTypeDomain_9ACB9703D77020DE01583AA159C934C2" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_MeasurementInputTypeAxis_F104E652A355A3CDE0C53AA159C9A807" xlink:to="loc_us-gaap_MeasurementInputTypeDomain_9ACB9703D77020DE01583AA159C934C2" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_MeasurementInputSharePriceMember" xlink:label="loc_us-gaap_MeasurementInputSharePriceMember_FB914E73C89F532175FD3AA159CF8C1A" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_MeasurementInputTypeDomain_9ACB9703D77020DE01583AA159C934C2" xlink:to="loc_us-gaap_MeasurementInputSharePriceMember_FB914E73C89F532175FD3AA159CF8C1A" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_MeasurementInputRiskFreeInterestRateMember" xlink:label="loc_us-gaap_MeasurementInputRiskFreeInterestRateMember_12FB5D91B5292655F4273AA159CF76EC" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_MeasurementInputTypeDomain_9ACB9703D77020DE01583AA159C934C2" xlink:to="loc_us-gaap_MeasurementInputRiskFreeInterestRateMember_12FB5D91B5292655F4273AA159CF76EC" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_MeasurementInputExpectedTermMember" xlink:label="loc_us-gaap_MeasurementInputExpectedTermMember_129BA42088F24739062E3AA159CF4B5A" xlink:type="locator" />
    <link:definitionArc order="3" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_MeasurementInputTypeDomain_9ACB9703D77020DE01583AA159C934C2" xlink:to="loc_us-gaap_MeasurementInputExpectedTermMember_129BA42088F24739062E3AA159CF4B5A" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_MeasurementInputOptionVolatilityMember" xlink:label="loc_us-gaap_MeasurementInputOptionVolatilityMember_3792AE3DF910DEFBB54E3AA159D0702C" xlink:type="locator" />
    <link:definitionArc order="4" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_MeasurementInputTypeDomain_9ACB9703D77020DE01583AA159C934C2" xlink:to="loc_us-gaap_MeasurementInputOptionVolatilityMember_3792AE3DF910DEFBB54E3AA159D0702C" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_MeasurementInputExpectedDividendRateMember" xlink:label="loc_us-gaap_MeasurementInputExpectedDividendRateMember_F24D7FB0B7AE3D30A8163AA159D0C974" xlink:type="locator" />
    <link:definitionArc order="5" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_MeasurementInputTypeDomain_9ACB9703D77020DE01583AA159C934C2" xlink:to="loc_us-gaap_MeasurementInputExpectedDividendRateMember_F24D7FB0B7AE3D30A8163AA159D0C974" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_RangeAxis" xlink:label="loc_srt_RangeAxis_CFE9282DA9F18102CB8E3AA159D09361" xlink:type="locator" />
    <link:definitionArc order="4" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisValuationTechniquesTable_2D46D56FFB6ECC96DA043AA159C7E12B" xlink:to="loc_srt_RangeAxis_CFE9282DA9F18102CB8E3AA159D09361" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_RangeMember" xlink:label="loc_srt_RangeMember_E6504BD4CCA03EE40F7F3AA159D0AB8A_default" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_RangeAxis_CFE9282DA9F18102CB8E3AA159D09361" xlink:to="loc_srt_RangeMember_E6504BD4CCA03EE40F7F3AA159D0AB8A_default" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_RangeMember" xlink:label="loc_srt_RangeMember_E6504BD4CCA03EE40F7F3AA159D0AB8A" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_RangeAxis_CFE9282DA9F18102CB8E3AA159D09361" xlink:to="loc_srt_RangeMember_E6504BD4CCA03EE40F7F3AA159D0AB8A" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_MinimumMember" xlink:label="loc_srt_MinimumMember_80085122A87410AD6B1D3AA159D1A2D6" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RangeMember_E6504BD4CCA03EE40F7F3AA159D0AB8A" xlink:to="loc_srt_MinimumMember_80085122A87410AD6B1D3AA159D1A2D6" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_MaximumMember" xlink:label="loc_srt_MaximumMember_C107ED8403554713D71C3AA159D18BC8" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RangeMember_E6504BD4CCA03EE40F7F3AA159D0AB8A" xlink:to="loc_srt_MaximumMember_C107ED8403554713D71C3AA159D18BC8" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_WarrantsAndRightsOutstandingMeasurementInput" xlink:label="loc_us-gaap_WarrantsAndRightsOutstandingMeasurementInput_00C9E181778378C46F883AA159D2B2D7" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisValuationTechniquesLineItems_DEA02FD3CF3B1CC053A33AA159D17D5D" xlink:to="loc_us-gaap_WarrantsAndRightsOutstandingMeasurementInput_00C9E181778378C46F883AA159D2B2D7" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_WarrantsAndRightsOutstandingTerm" xlink:label="loc_us-gaap_WarrantsAndRightsOutstandingTerm_CD140242FD614EA50C6F3AA159D2F3F5" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FairValueAssetsAndLiabilitiesMeasuredOnRecurringAndNonrecurringBasisValuationTechniquesLineItems_DEA02FD3CF3B1CC053A33AA159D17D5D" xlink:to="loc_us-gaap_WarrantsAndRightsOutstandingTerm_CD140242FD614EA50C6F3AA159D2F3F5" xlink:type="arc" />
  </link:definitionLink>
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/IncomeTaxes" xlink:type="extended" />
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/IncomeTaxesComponentsOfIncomeTaxExpenseBenefitDetails" xlink:type="extended" />
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/IncomeTaxesDeferredTaxAssetAndLiabilitiesDetails" xlink:type="extended" />
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/IncomeTaxesEffectiveIncomeTaxRateReconciliationDetails" xlink:type="extended" />
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/IncomeTaxesNarrativeDetails" xlink:type="extended">
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_IncomeTaxContingencyLineItems" xlink:label="loc_us-gaap_IncomeTaxContingencyLineItems_14417F3CD70E9556922B3B989C12EAE2" xlink:type="locator" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_IncomeTaxContingencyTable" xlink:label="loc_us-gaap_IncomeTaxContingencyTable_AB0F46DEEECF1D8A58F53B989C0EDCBF" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_IncomeTaxContingencyLineItems_14417F3CD70E9556922B3B989C12EAE2" xlink:to="loc_us-gaap_IncomeTaxContingencyTable_AB0F46DEEECF1D8A58F53B989C0EDCBF" xlink:type="arc" xbrldt:closed="true" xbrldt:contextElement="segment" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_AdjustmentsForNewAccountingPronouncementsAxis" xlink:label="loc_us-gaap_AdjustmentsForNewAccountingPronouncementsAxis_19438AF437218927F9DA3B989C0E176A" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_IncomeTaxContingencyTable_AB0F46DEEECF1D8A58F53B989C0EDCBF" xlink:to="loc_us-gaap_AdjustmentsForNewAccountingPronouncementsAxis_19438AF437218927F9DA3B989C0E176A" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_TypeOfAdoptionMember" xlink:label="loc_us-gaap_TypeOfAdoptionMember_6A39054B730209D2D6F83B989C0E91EB_default" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_AdjustmentsForNewAccountingPronouncementsAxis_19438AF437218927F9DA3B989C0E176A" xlink:to="loc_us-gaap_TypeOfAdoptionMember_6A39054B730209D2D6F83B989C0E91EB_default" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_TypeOfAdoptionMember" xlink:label="loc_us-gaap_TypeOfAdoptionMember_6A39054B730209D2D6F83B989C0E91EB" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_AdjustmentsForNewAccountingPronouncementsAxis_19438AF437218927F9DA3B989C0E176A" xlink:to="loc_us-gaap_TypeOfAdoptionMember_6A39054B730209D2D6F83B989C0E91EB" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_AccountingStandardsUpdate201802Member" xlink:label="loc_us-gaap_AccountingStandardsUpdate201802Member_F87F4F75240380D4B8373B989C0FAB51" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TypeOfAdoptionMember_6A39054B730209D2D6F83B989C0E91EB" xlink:to="loc_us-gaap_AccountingStandardsUpdate201802Member_F87F4F75240380D4B8373B989C0FAB51" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_IncomeTaxAuthorityAxis" xlink:label="loc_us-gaap_IncomeTaxAuthorityAxis_EE8EAB7747B222E102953B989C0FC807" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_IncomeTaxContingencyTable_AB0F46DEEECF1D8A58F53B989C0EDCBF" xlink:to="loc_us-gaap_IncomeTaxAuthorityAxis_EE8EAB7747B222E102953B989C0FC807" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_IncomeTaxAuthorityDomain" xlink:label="loc_us-gaap_IncomeTaxAuthorityDomain_AB88B902A5B36AF83BDB3B989C0F8B01_default" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_IncomeTaxAuthorityAxis_EE8EAB7747B222E102953B989C0FC807" xlink:to="loc_us-gaap_IncomeTaxAuthorityDomain_AB88B902A5B36AF83BDB3B989C0F8B01_default" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_IncomeTaxAuthorityDomain" xlink:label="loc_us-gaap_IncomeTaxAuthorityDomain_AB88B902A5B36AF83BDB3B989C0F8B01" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_IncomeTaxAuthorityAxis_EE8EAB7747B222E102953B989C0FC807" xlink:to="loc_us-gaap_IncomeTaxAuthorityDomain_AB88B902A5B36AF83BDB3B989C0F8B01" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_DomesticCountryMember" xlink:label="loc_us-gaap_DomesticCountryMember_287C6DD228CCA8059CD63B989C0FF5CE" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncomeTaxAuthorityDomain_AB88B902A5B36AF83BDB3B989C0F8B01" xlink:to="loc_us-gaap_DomesticCountryMember_287C6DD228CCA8059CD63B989C0FF5CE" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_StateAndLocalJurisdictionMember" xlink:label="loc_us-gaap_StateAndLocalJurisdictionMember_08FDE54121042F9CDC0D3B989C10547C" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncomeTaxAuthorityDomain_AB88B902A5B36AF83BDB3B989C0F8B01" xlink:to="loc_us-gaap_StateAndLocalJurisdictionMember_08FDE54121042F9CDC0D3B989C10547C" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_IncomeTaxAuthorityNameAxis" xlink:label="loc_us-gaap_IncomeTaxAuthorityNameAxis_C7EC862A3AAD98D3309E3B989C100A9A" xlink:type="locator" />
    <link:definitionArc order="3" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_IncomeTaxContingencyTable_AB0F46DEEECF1D8A58F53B989C0EDCBF" xlink:to="loc_us-gaap_IncomeTaxAuthorityNameAxis_C7EC862A3AAD98D3309E3B989C100A9A" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_IncomeTaxAuthorityNameDomain" xlink:label="loc_us-gaap_IncomeTaxAuthorityNameDomain_6AA9EA8581AB766A56043B989C103B59_default" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_IncomeTaxAuthorityNameAxis_C7EC862A3AAD98D3309E3B989C100A9A" xlink:to="loc_us-gaap_IncomeTaxAuthorityNameDomain_6AA9EA8581AB766A56043B989C103B59_default" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_IncomeTaxAuthorityNameDomain" xlink:label="loc_us-gaap_IncomeTaxAuthorityNameDomain_6AA9EA8581AB766A56043B989C103B59" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_IncomeTaxAuthorityNameAxis_C7EC862A3AAD98D3309E3B989C100A9A" xlink:to="loc_us-gaap_IncomeTaxAuthorityNameDomain_6AA9EA8581AB766A56043B989C103B59" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_InternalRevenueServiceIRSMember" xlink:label="loc_us-gaap_InternalRevenueServiceIRSMember_6DEA64E9B57375D1E9983B989C10FA9D" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncomeTaxAuthorityNameDomain_6AA9EA8581AB766A56043B989C103B59" xlink:to="loc_us-gaap_InternalRevenueServiceIRSMember_6DEA64E9B57375D1E9983B989C10FA9D" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_ExpirationPeriodAxis" xlink:label="loc_nmih_ExpirationPeriodAxis_C0FA460FF405B584D5BF3B989C11D572" xlink:type="locator" />
    <link:definitionArc order="4" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_IncomeTaxContingencyTable_AB0F46DEEECF1D8A58F53B989C0EDCBF" xlink:to="loc_nmih_ExpirationPeriodAxis_C0FA460FF405B584D5BF3B989C11D572" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_ExpirationPeriodDomain" xlink:label="loc_nmih_ExpirationPeriodDomain_C0A2ED0F152EAE8DAC253B989C118740_default" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_nmih_ExpirationPeriodAxis_C0FA460FF405B584D5BF3B989C11D572" xlink:to="loc_nmih_ExpirationPeriodDomain_C0A2ED0F152EAE8DAC253B989C118740_default" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_ExpirationPeriodDomain" xlink:label="loc_nmih_ExpirationPeriodDomain_C0A2ED0F152EAE8DAC253B989C118740" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_nmih_ExpirationPeriodAxis_C0FA460FF405B584D5BF3B989C11D572" xlink:to="loc_nmih_ExpirationPeriodDomain_C0A2ED0F152EAE8DAC253B989C118740" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_AnnualLimitationThroughYearTwoMember" xlink:label="loc_nmih_AnnualLimitationThroughYearTwoMember_A83FD63AD21B198EA7DF3B989C11B48E" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_nmih_ExpirationPeriodDomain_C0A2ED0F152EAE8DAC253B989C118740" xlink:to="loc_nmih_AnnualLimitationThroughYearTwoMember_A83FD63AD21B198EA7DF3B989C11B48E" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_AnnualLimitationsAfterYearTwoMember" xlink:label="loc_nmih_AnnualLimitationsAfterYearTwoMember_B5C12C6996B232F1FC503B989C110D25" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_nmih_ExpirationPeriodDomain_C0A2ED0F152EAE8DAC253B989C118740" xlink:to="loc_nmih_AnnualLimitationsAfterYearTwoMember_B5C12C6996B232F1FC503B989C110D25" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_PurchasesOfTaxAndLossBonds" xlink:label="loc_nmih_PurchasesOfTaxAndLossBonds_71FA4DEA6FA9549580AE3B989C12CD77" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncomeTaxContingencyLineItems_14417F3CD70E9556922B3B989C12EAE2" xlink:to="loc_nmih_PurchasesOfTaxAndLossBonds_71FA4DEA6FA9549580AE3B989C12CD77" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_TaxAndLossBond" xlink:label="loc_nmih_TaxAndLossBond_3F2EFDAB8709F0B9BE583B989C1282FF" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncomeTaxContingencyLineItems_14417F3CD70E9556922B3B989C12EAE2" xlink:to="loc_nmih_TaxAndLossBond_3F2EFDAB8709F0B9BE583B989C1282FF" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_CumulativeEffectOfNewAccountingPrincipleInPeriodOfAdoption" xlink:label="loc_us-gaap_CumulativeEffectOfNewAccountingPrincipleInPeriodOfAdoption_40109F4AF2D7A311FD783B989C137FB2" xlink:type="locator" />
    <link:definitionArc order="3" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncomeTaxContingencyLineItems_14417F3CD70E9556922B3B989C12EAE2" xlink:to="loc_us-gaap_CumulativeEffectOfNewAccountingPrincipleInPeriodOfAdoption_40109F4AF2D7A311FD783B989C137FB2" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_AccumulatedOtherComprehensiveIncomeLossDebtSecuritiesAvailableForSaleStrandedTax" xlink:label="loc_nmih_AccumulatedOtherComprehensiveIncomeLossDebtSecuritiesAvailableForSaleStrandedTax_C22E8B6ADC7D5E87E2573B989C13026E" xlink:type="locator" />
    <link:definitionArc order="4" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncomeTaxContingencyLineItems_14417F3CD70E9556922B3B989C12EAE2" xlink:to="loc_nmih_AccumulatedOtherComprehensiveIncomeLossDebtSecuritiesAvailableForSaleStrandedTax_C22E8B6ADC7D5E87E2573B989C13026E" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_OperatingLossCarryforwards" xlink:label="loc_us-gaap_OperatingLossCarryforwards_61ABE0C3A0A1307898753B989C131D8D" xlink:type="locator" />
    <link:definitionArc order="5" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncomeTaxContingencyLineItems_14417F3CD70E9556922B3B989C12EAE2" xlink:to="loc_us-gaap_OperatingLossCarryforwards_61ABE0C3A0A1307898753B989C131D8D" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_DeferredTaxAssetsOperatingLossCarryforwardsSubjectToExpiration" xlink:label="loc_us-gaap_DeferredTaxAssetsOperatingLossCarryforwardsSubjectToExpiration_67AFD3F17AB9E0B36BB83B989C13EC07" xlink:type="locator" />
    <link:definitionArc order="6" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncomeTaxContingencyLineItems_14417F3CD70E9556922B3B989C12EAE2" xlink:to="loc_us-gaap_DeferredTaxAssetsOperatingLossCarryforwardsSubjectToExpiration_67AFD3F17AB9E0B36BB83B989C13EC07" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_DeferredTaxAssetsValuationAllowance" xlink:label="loc_us-gaap_DeferredTaxAssetsValuationAllowance_CC06F6A6C072125DA0973B989C13CDF3" xlink:type="locator" />
    <link:definitionArc order="7" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncomeTaxContingencyLineItems_14417F3CD70E9556922B3B989C12EAE2" xlink:to="loc_us-gaap_DeferredTaxAssetsValuationAllowance_CC06F6A6C072125DA0973B989C13CDF3" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_UnrecognizedTaxBenefits" xlink:label="loc_us-gaap_UnrecognizedTaxBenefits_E561E8D08A9192953C943B989C14066E" xlink:type="locator" />
    <link:definitionArc order="8" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncomeTaxContingencyLineItems_14417F3CD70E9556922B3B989C12EAE2" xlink:to="loc_us-gaap_UnrecognizedTaxBenefits_E561E8D08A9192953C943B989C14066E" xlink:type="arc" />
  </link:definitionLink>
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/IncomeTaxesTables" xlink:type="extended" />
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/IntangibleAssetsAndGoodwill" xlink:type="extended" />
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/IntangibleAssetsAndGoodwillDetails" xlink:type="extended">
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_IndefiniteLivedIntangibleAssetsByMajorClassLineItems" xlink:label="loc_us-gaap_IndefiniteLivedIntangibleAssetsByMajorClassLineItems_9410658E76B2037FE3813AA156B4CFEB" xlink:type="locator" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ScheduleOfIndefiniteLivedIntangibleAssetsTable" xlink:label="loc_us-gaap_ScheduleOfIndefiniteLivedIntangibleAssetsTable_830C248539BA24FC2F513AA156B25923" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_IndefiniteLivedIntangibleAssetsByMajorClassLineItems_9410658E76B2037FE3813AA156B4CFEB" xlink:to="loc_us-gaap_ScheduleOfIndefiniteLivedIntangibleAssetsTable_830C248539BA24FC2F513AA156B25923" xlink:type="arc" xbrldt:closed="true" xbrldt:contextElement="segment" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_IndefiniteLivedIntangibleAssetsByMajorClassAxis" xlink:label="loc_us-gaap_IndefiniteLivedIntangibleAssetsByMajorClassAxis_806777895FED69AA35F03AA156B232B5" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfIndefiniteLivedIntangibleAssetsTable_830C248539BA24FC2F513AA156B25923" xlink:to="loc_us-gaap_IndefiniteLivedIntangibleAssetsByMajorClassAxis_806777895FED69AA35F03AA156B232B5" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_IndefiniteLivedIntangibleAssetsMajorClassNameDomain" xlink:label="loc_us-gaap_IndefiniteLivedIntangibleAssetsMajorClassNameDomain_D6BF74AAC7DE5F63E3DA3AA156B357E0_default" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_IndefiniteLivedIntangibleAssetsByMajorClassAxis_806777895FED69AA35F03AA156B232B5" xlink:to="loc_us-gaap_IndefiniteLivedIntangibleAssetsMajorClassNameDomain_D6BF74AAC7DE5F63E3DA3AA156B357E0_default" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_IndefiniteLivedIntangibleAssetsMajorClassNameDomain" xlink:label="loc_us-gaap_IndefiniteLivedIntangibleAssetsMajorClassNameDomain_D6BF74AAC7DE5F63E3DA3AA156B357E0" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_IndefiniteLivedIntangibleAssetsByMajorClassAxis_806777895FED69AA35F03AA156B232B5" xlink:to="loc_us-gaap_IndefiniteLivedIntangibleAssetsMajorClassNameDomain_D6BF74AAC7DE5F63E3DA3AA156B357E0" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_StateLicensesMember" xlink:label="loc_nmih_StateLicensesMember_16FE917C65B73585CD703AA156B34B19" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IndefiniteLivedIntangibleAssetsMajorClassNameDomain_D6BF74AAC7DE5F63E3DA3AA156B357E0" xlink:to="loc_nmih_StateLicensesMember_16FE917C65B73585CD703AA156B34B19" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_GSEApprovalsMember" xlink:label="loc_nmih_GSEApprovalsMember_FA01AB321EBF13B122753AA156B4DC2D" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IndefiniteLivedIntangibleAssetsMajorClassNameDomain_D6BF74AAC7DE5F63E3DA3AA156B357E0" xlink:to="loc_nmih_GSEApprovalsMember_FA01AB321EBF13B122753AA156B4DC2D" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_Goodwill" xlink:label="loc_us-gaap_Goodwill_2B22F0D91073A6DB26DD3AA156B4B8A1" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IndefiniteLivedIntangibleAssetsByMajorClassLineItems_9410658E76B2037FE3813AA156B4CFEB" xlink:to="loc_us-gaap_Goodwill_2B22F0D91073A6DB26DD3AA156B4B8A1" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_IndefiniteLivedIntangibleAssetsExcludingGoodwill" xlink:label="loc_us-gaap_IndefiniteLivedIntangibleAssetsExcludingGoodwill_7AC8CFDD514F7F8CD5393AA156BFF9BD" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IndefiniteLivedIntangibleAssetsByMajorClassLineItems_9410658E76B2037FE3813AA156B4CFEB" xlink:to="loc_us-gaap_IndefiniteLivedIntangibleAssetsExcludingGoodwill_7AC8CFDD514F7F8CD5393AA156BFF9BD" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_IntangibleAssetsNetIncludingGoodwill" xlink:label="loc_us-gaap_IntangibleAssetsNetIncludingGoodwill_7C048A7FC23A83092E473AA156C09474" xlink:type="locator" />
    <link:definitionArc order="3" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IndefiniteLivedIntangibleAssetsByMajorClassLineItems_9410658E76B2037FE3813AA156B4CFEB" xlink:to="loc_us-gaap_IntangibleAssetsNetIncludingGoodwill_7C048A7FC23A83092E473AA156C09474" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_GoodwillAndIntangibleAssetImpairment" xlink:label="loc_us-gaap_GoodwillAndIntangibleAssetImpairment_068D4BAA9A34DECCDBB03AA156C0986B" xlink:type="locator" />
    <link:definitionArc order="4" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IndefiniteLivedIntangibleAssetsByMajorClassLineItems_9410658E76B2037FE3813AA156B4CFEB" xlink:to="loc_us-gaap_GoodwillAndIntangibleAssetImpairment_068D4BAA9A34DECCDBB03AA156C0986B" xlink:type="arc" />
  </link:definitionLink>
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/IntangibleAssetsAndGoodwillTables" xlink:type="extended" />
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/Investments" xlink:type="extended" />
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/InvestmentsAgingOfUnrealizedLossesDetails" xlink:type="extended">
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems" xlink:label="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems_57E4339764064E3F7E943AA15A532412" xlink:type="locator" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_DebtSecuritiesAvailableForSaleTable" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleTable_5D1DA8E070A0BC8445E03AA15A5197CB" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems_57E4339764064E3F7E943AA15A532412" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleTable_5D1DA8E070A0BC8445E03AA15A5197CB" xlink:type="arc" xbrldt:closed="true" xbrldt:contextElement="segment" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_FinancialInstrumentAxis" xlink:label="loc_us-gaap_FinancialInstrumentAxis_3A7BD3AAC1688DCC6FFF3AA15A51E7BA" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DebtSecuritiesAvailableForSaleTable_5D1DA8E070A0BC8445E03AA15A5197CB" xlink:to="loc_us-gaap_FinancialInstrumentAxis_3A7BD3AAC1688DCC6FFF3AA15A51E7BA" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain" xlink:label="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_80502BB1C44954E7E8813AA15A5199B6_default" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FinancialInstrumentAxis_3A7BD3AAC1688DCC6FFF3AA15A51E7BA" xlink:to="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_80502BB1C44954E7E8813AA15A5199B6_default" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain" xlink:label="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_80502BB1C44954E7E8813AA15A5199B6" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FinancialInstrumentAxis_3A7BD3AAC1688DCC6FFF3AA15A51E7BA" xlink:to="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_80502BB1C44954E7E8813AA15A5199B6" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_USTreasuryAndGovernmentMember" xlink:label="loc_us-gaap_USTreasuryAndGovernmentMember_027CC85E033FF878A3263AA15A5292F7" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_80502BB1C44954E7E8813AA15A5199B6" xlink:to="loc_us-gaap_USTreasuryAndGovernmentMember_027CC85E033FF878A3263AA15A5292F7" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_USStatesAndPoliticalSubdivisionsMember" xlink:label="loc_us-gaap_USStatesAndPoliticalSubdivisionsMember_1A11B4E6F93D3DE1AD4F3AA15A524A7D" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_80502BB1C44954E7E8813AA15A5199B6" xlink:to="loc_us-gaap_USStatesAndPoliticalSubdivisionsMember_1A11B4E6F93D3DE1AD4F3AA15A524A7D" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_CorporateDebtSecuritiesMember" xlink:label="loc_us-gaap_CorporateDebtSecuritiesMember_87EF96C8ACD241C97CB23AA15A529B4A" xlink:type="locator" />
    <link:definitionArc order="3" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_80502BB1C44954E7E8813AA15A5199B6" xlink:to="loc_us-gaap_CorporateDebtSecuritiesMember_87EF96C8ACD241C97CB23AA15A529B4A" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_AssetBackedSecuritiesMember" xlink:label="loc_us-gaap_AssetBackedSecuritiesMember_2D4E871659C0671FAD543AA15A534967" xlink:type="locator" />
    <link:definitionArc order="4" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_80502BB1C44954E7E8813AA15A5199B6" xlink:to="loc_us-gaap_AssetBackedSecuritiesMember_2D4E871659C0671FAD543AA15A534967" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_AvailableForsaleSecuritiesInUnrealizedLossPositionsQualitativeDisclosureNumberOfPositionsAbstract" xlink:label="loc_us-gaap_AvailableForsaleSecuritiesInUnrealizedLossPositionsQualitativeDisclosureNumberOfPositionsAbstract_E30FC7F52D3AD069B2ED3AA15A536EF8" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems_57E4339764064E3F7E943AA15A532412" xlink:to="loc_us-gaap_AvailableForsaleSecuritiesInUnrealizedLossPositionsQualitativeDisclosureNumberOfPositionsAbstract_E30FC7F52D3AD069B2ED3AA15A536EF8" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionLessThan12MonthsNumberOfPositions" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionLessThan12MonthsNumberOfPositions_60281B2728738BAD2DC33AA15A5306F4" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AvailableForsaleSecuritiesInUnrealizedLossPositionsQualitativeDisclosureNumberOfPositionsAbstract_E30FC7F52D3AD069B2ED3AA15A536EF8" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionLessThan12MonthsNumberOfPositions_60281B2728738BAD2DC33AA15A5306F4" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLongerNumberOfPositions" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLongerNumberOfPositions_36722A6C948426149CB93AA15A54B35C" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AvailableForsaleSecuritiesInUnrealizedLossPositionsQualitativeDisclosureNumberOfPositionsAbstract_E30FC7F52D3AD069B2ED3AA15A536EF8" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLongerNumberOfPositions_36722A6C948426149CB93AA15A54B35C" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPositionNumberOfPositions" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPositionNumberOfPositions_899EC13BAA46309CEF363AA15A54366E" xlink:type="locator" />
    <link:definitionArc order="3" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AvailableForsaleSecuritiesInUnrealizedLossPositionsQualitativeDisclosureNumberOfPositionsAbstract_E30FC7F52D3AD069B2ED3AA15A536EF8" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPositionNumberOfPositions_899EC13BAA46309CEF363AA15A54366E" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_DebtSecuritiesAvailableforsaleUnrealizedLossPositionAbstract" xlink:label="loc_nmih_DebtSecuritiesAvailableforsaleUnrealizedLossPositionAbstract_2E318F037D064C14F7F63AA15A54BA84" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems_57E4339764064E3F7E943AA15A532412" xlink:to="loc_nmih_DebtSecuritiesAvailableforsaleUnrealizedLossPositionAbstract_2E318F037D064C14F7F63AA15A54BA84" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionLessThan12Months" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionLessThan12Months_6FB2F94591EDCCABAD7F3AA15A548A86" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_nmih_DebtSecuritiesAvailableforsaleUnrealizedLossPositionAbstract_2E318F037D064C14F7F63AA15A54BA84" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionLessThan12Months_6FB2F94591EDCCABAD7F3AA15A548A86" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLonger" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLonger_31FA584FF384AD9747413AA15A552489" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_nmih_DebtSecuritiesAvailableforsaleUnrealizedLossPositionAbstract_2E318F037D064C14F7F63AA15A54BA84" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLonger_31FA584FF384AD9747413AA15A552489" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPosition" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPosition_BCB12EED8E8CCB72CAE53AA15A55070B" xlink:type="locator" />
    <link:definitionArc order="3" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_nmih_DebtSecuritiesAvailableforsaleUnrealizedLossPositionAbstract_2E318F037D064C14F7F63AA15A54BA84" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPosition_BCB12EED8E8CCB72CAE53AA15A55070B" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_AvailableForSaleSecuritiesContinuousUnrealizedLossPositionAccumulatedLossAbstract" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesContinuousUnrealizedLossPositionAccumulatedLossAbstract_83977B8E92BE47F28B1B3AA15A55AD50" xlink:type="locator" />
    <link:definitionArc order="3" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems_57E4339764064E3F7E943AA15A532412" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesContinuousUnrealizedLossPositionAccumulatedLossAbstract_83977B8E92BE47F28B1B3AA15A55AD50" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionLessThan12MonthsAccumulatedLoss" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionLessThan12MonthsAccumulatedLoss_B92BD8DE3C0A874671283AA15A55C4F2" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AvailableForSaleSecuritiesContinuousUnrealizedLossPositionAccumulatedLossAbstract_83977B8E92BE47F28B1B3AA15A55AD50" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPositionLessThan12MonthsAccumulatedLoss_B92BD8DE3C0A874671283AA15A55C4F2" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLongerAccumulatedLoss" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLongerAccumulatedLoss_62886EF5464A9406220E3AA15A568904" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AvailableForSaleSecuritiesContinuousUnrealizedLossPositionAccumulatedLossAbstract_83977B8E92BE47F28B1B3AA15A55AD50" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLongerAccumulatedLoss_62886EF5464A9406220E3AA15A568904" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPositionAccumulatedLoss" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPositionAccumulatedLoss_5A7B75DFA889BF83D6CE3AA15A566981" xlink:type="locator" />
    <link:definitionArc order="3" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AvailableForSaleSecuritiesContinuousUnrealizedLossPositionAccumulatedLossAbstract_83977B8E92BE47F28B1B3AA15A55AD50" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPositionAccumulatedLoss_5A7B75DFA889BF83D6CE3AA15A566981" xlink:type="arc" />
  </link:definitionLink>
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/InvestmentsCorporateDebtSecuritiesByIndustryGroupDetails" xlink:type="extended">
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems" xlink:label="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems_E295DE4E76194CF0053A3AA15A78573E" xlink:type="locator" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_DebtSecuritiesAvailableForSaleTable" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleTable_48492E48D380E8D2CC7C3AA15A758A43" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems_E295DE4E76194CF0053A3AA15A78573E" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleTable_48492E48D380E8D2CC7C3AA15A758A43" xlink:type="arc" xbrldt:closed="true" xbrldt:contextElement="segment" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_EquitySecuritiesByIndustryAxis" xlink:label="loc_us-gaap_EquitySecuritiesByIndustryAxis_6815AAB91ECD5091A8E03AA15A753F58" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DebtSecuritiesAvailableForSaleTable_48492E48D380E8D2CC7C3AA15A758A43" xlink:to="loc_us-gaap_EquitySecuritiesByIndustryAxis_6815AAB91ECD5091A8E03AA15A753F58" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_EquitySecuritiesIndustryMember" xlink:label="loc_us-gaap_EquitySecuritiesIndustryMember_1E1CB827C2F3585AAFD53AA15A765244_default" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_EquitySecuritiesByIndustryAxis_6815AAB91ECD5091A8E03AA15A753F58" xlink:to="loc_us-gaap_EquitySecuritiesIndustryMember_1E1CB827C2F3585AAFD53AA15A765244_default" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_EquitySecuritiesIndustryMember" xlink:label="loc_us-gaap_EquitySecuritiesIndustryMember_1E1CB827C2F3585AAFD53AA15A765244" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_EquitySecuritiesByIndustryAxis_6815AAB91ECD5091A8E03AA15A753F58" xlink:to="loc_us-gaap_EquitySecuritiesIndustryMember_1E1CB827C2F3585AAFD53AA15A765244" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_FinancialIndustryGroupMember" xlink:label="loc_nmih_FinancialIndustryGroupMember_3034C1A28C140AEEAD563AA15A761026" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquitySecuritiesIndustryMember_1E1CB827C2F3585AAFD53AA15A765244" xlink:to="loc_nmih_FinancialIndustryGroupMember_3034C1A28C140AEEAD563AA15A761026" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_ConsumerIndustryGroupMember" xlink:label="loc_nmih_ConsumerIndustryGroupMember_DD11DE588F073D54F1263AA15A760471" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquitySecuritiesIndustryMember_1E1CB827C2F3585AAFD53AA15A765244" xlink:to="loc_nmih_ConsumerIndustryGroupMember_DD11DE588F073D54F1263AA15A760471" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_CommunicationsIndustryGroupMember" xlink:label="loc_nmih_CommunicationsIndustryGroupMember_5F15E7701E9F1152ADA03AA15A77849D" xlink:type="locator" />
    <link:definitionArc order="3" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquitySecuritiesIndustryMember_1E1CB827C2F3585AAFD53AA15A765244" xlink:to="loc_nmih_CommunicationsIndustryGroupMember_5F15E7701E9F1152ADA03AA15A77849D" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_IndustrialIndustryGroupMember" xlink:label="loc_nmih_IndustrialIndustryGroupMember_8F0A94AD241C1578C1A43AA15A77C629" xlink:type="locator" />
    <link:definitionArc order="4" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquitySecuritiesIndustryMember_1E1CB827C2F3585AAFD53AA15A765244" xlink:to="loc_nmih_IndustrialIndustryGroupMember_8F0A94AD241C1578C1A43AA15A77C629" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_UtilitiesIndustryGroupMember" xlink:label="loc_nmih_UtilitiesIndustryGroupMember_DE8E8CBB64A309DB5D0B3AA15A777E78" xlink:type="locator" />
    <link:definitionArc order="5" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquitySecuritiesIndustryMember_1E1CB827C2F3585AAFD53AA15A765244" xlink:to="loc_nmih_UtilitiesIndustryGroupMember_DE8E8CBB64A309DB5D0B3AA15A777E78" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_TechnologyIndustryGroupMember" xlink:label="loc_nmih_TechnologyIndustryGroupMember_BFC713B01BDFD66972E13AA15A774CE1" xlink:type="locator" />
    <link:definitionArc order="6" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquitySecuritiesIndustryMember_1E1CB827C2F3585AAFD53AA15A765244" xlink:to="loc_nmih_TechnologyIndustryGroupMember_BFC713B01BDFD66972E13AA15A774CE1" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_EnergyIndustryGroupMember" xlink:label="loc_nmih_EnergyIndustryGroupMember_47DAD5AE5758EB1412DE3AA15A7886AF" xlink:type="locator" />
    <link:definitionArc order="7" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquitySecuritiesIndustryMember_1E1CB827C2F3585AAFD53AA15A765244" xlink:to="loc_nmih_EnergyIndustryGroupMember_47DAD5AE5758EB1412DE3AA15A7886AF" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_OtherIndustryGroupMember" xlink:label="loc_nmih_OtherIndustryGroupMember_83E7B733BFD295C8368F3AA15A78CD1C" xlink:type="locator" />
    <link:definitionArc order="8" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquitySecuritiesIndustryMember_1E1CB827C2F3585AAFD53AA15A765244" xlink:to="loc_nmih_OtherIndustryGroupMember_83E7B733BFD295C8368F3AA15A78CD1C" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_DebtSecuritiesCorporateComponentOfTotal.Percentage" xlink:label="loc_nmih_DebtSecuritiesCorporateComponentOfTotal.Percentage_F18B867CEB013F9599633AA15A7874CF" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems_E295DE4E76194CF0053A3AA15A78573E" xlink:to="loc_nmih_DebtSecuritiesCorporateComponentOfTotal.Percentage_F18B867CEB013F9599633AA15A7874CF" xlink:type="arc" />
  </link:definitionLink>
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/InvestmentsFairValuesAndGrossUnrealizedGainsAndLossesDetails" xlink:type="extended">
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems" xlink:label="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems_9861FAF44D0E912907D53B92B24AAC0F" xlink:type="locator" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_DebtSecuritiesAvailableForSaleTable" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleTable_FE3DE57F4D18447397B43B92B248AFD4" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems_9861FAF44D0E912907D53B92B24AAC0F" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleTable_FE3DE57F4D18447397B43B92B248AFD4" xlink:type="arc" xbrldt:closed="true" xbrldt:contextElement="segment" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_FinancialInstrumentAxis" xlink:label="loc_us-gaap_FinancialInstrumentAxis_6750B3FF3E22820FEDD43B92B248EA59" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DebtSecuritiesAvailableForSaleTable_FE3DE57F4D18447397B43B92B248AFD4" xlink:to="loc_us-gaap_FinancialInstrumentAxis_6750B3FF3E22820FEDD43B92B248EA59" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain" xlink:label="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_F829D4CD9B61786A75003B92B24823CC_default" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FinancialInstrumentAxis_6750B3FF3E22820FEDD43B92B248EA59" xlink:to="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_F829D4CD9B61786A75003B92B24823CC_default" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain" xlink:label="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_F829D4CD9B61786A75003B92B24823CC" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FinancialInstrumentAxis_6750B3FF3E22820FEDD43B92B248EA59" xlink:to="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_F829D4CD9B61786A75003B92B24823CC" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_USTreasuryAndGovernmentMember" xlink:label="loc_us-gaap_USTreasuryAndGovernmentMember_B4978817A31D025D76D93B92B24963A2" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_F829D4CD9B61786A75003B92B24823CC" xlink:to="loc_us-gaap_USTreasuryAndGovernmentMember_B4978817A31D025D76D93B92B24963A2" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_USStatesAndPoliticalSubdivisionsMember" xlink:label="loc_us-gaap_USStatesAndPoliticalSubdivisionsMember_051B3E7EB57541145A923B92B249A4E2" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_F829D4CD9B61786A75003B92B24823CC" xlink:to="loc_us-gaap_USStatesAndPoliticalSubdivisionsMember_051B3E7EB57541145A923B92B249A4E2" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_CorporateDebtSecuritiesMember" xlink:label="loc_us-gaap_CorporateDebtSecuritiesMember_E383ECE7C8B1CA141FB23B92B249EBA7" xlink:type="locator" />
    <link:definitionArc order="3" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_F829D4CD9B61786A75003B92B24823CC" xlink:to="loc_us-gaap_CorporateDebtSecuritiesMember_E383ECE7C8B1CA141FB23B92B249EBA7" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_AssetBackedSecuritiesMember" xlink:label="loc_us-gaap_AssetBackedSecuritiesMember_C65646E8C4476F1EA95A3B92B2491B5A" xlink:type="locator" />
    <link:definitionArc order="4" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_F829D4CD9B61786A75003B92B24823CC" xlink:to="loc_us-gaap_AssetBackedSecuritiesMember_C65646E8C4476F1EA95A3B92B2491B5A" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_BondsMember" xlink:label="loc_us-gaap_BondsMember_B0B842F80CF7989B8BD03B92B24A0B06" xlink:type="locator" />
    <link:definitionArc order="5" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_F829D4CD9B61786A75003B92B24823CC" xlink:to="loc_us-gaap_BondsMember_B0B842F80CF7989B8BD03B92B24A0B06" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ShortTermInvestmentsMember" xlink:label="loc_us-gaap_ShortTermInvestmentsMember_4EBB6BB1C769413D57533B92B24AA9CE" xlink:type="locator" />
    <link:definitionArc order="6" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_F829D4CD9B61786A75003B92B24823CC" xlink:to="loc_us-gaap_ShortTermInvestmentsMember_4EBB6BB1C769413D57533B92B24AA9CE" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_AvailableForSaleDebtSecuritiesAmortizedCostBasis" xlink:label="loc_us-gaap_AvailableForSaleDebtSecuritiesAmortizedCostBasis_2613B06CBFFD9BE99E463B92B24A28C1" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems_9861FAF44D0E912907D53B92B24AAC0F" xlink:to="loc_us-gaap_AvailableForSaleDebtSecuritiesAmortizedCostBasis_2613B06CBFFD9BE99E463B92B24A28C1" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedGainBeforeTax" xlink:label="loc_us-gaap_AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedGainBeforeTax_DB786BDEEC9D27ED62FB3B92B24A4203" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems_9861FAF44D0E912907D53B92B24AAC0F" xlink:to="loc_us-gaap_AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedGainBeforeTax_DB786BDEEC9D27ED62FB3B92B24A4203" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedLossBeforeTax" xlink:label="loc_us-gaap_AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedLossBeforeTax_437535E9811E775749563B92B24A2ACD" xlink:type="locator" />
    <link:definitionArc order="3" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems_9861FAF44D0E912907D53B92B24AAC0F" xlink:to="loc_us-gaap_AvailableForSaleDebtSecuritiesAccumulatedGrossUnrealizedLossBeforeTax_437535E9811E775749563B92B24A2ACD" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_AvailableForSaleSecuritiesDebtSecurities" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtSecurities_2196F6AF75FF86F901173B92B24B3D59" xlink:type="locator" />
    <link:definitionArc order="4" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems_9861FAF44D0E912907D53B92B24AAC0F" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtSecurities_2196F6AF75FF86F901173B92B24B3D59" xlink:type="arc" />
  </link:definitionLink>
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/InvestmentsNarrativeDetails" xlink:type="extended">
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems" xlink:label="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems_6F989BB2063DD8FA01443B290E1A0180" xlink:type="locator" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_DebtSecuritiesAvailableForSaleTable" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleTable_BC4A0F77DC09124CB08C3B290E190268" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems_6F989BB2063DD8FA01443B290E1A0180" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleTable_BC4A0F77DC09124CB08C3B290E190268" xlink:type="arc" xbrldt:closed="true" xbrldt:contextElement="segment" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_FinancialInstrumentAxis" xlink:label="loc_us-gaap_FinancialInstrumentAxis_0A7995B510AEA60212CA3B290E196A59" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_DebtSecuritiesAvailableForSaleTable_BC4A0F77DC09124CB08C3B290E190268" xlink:to="loc_us-gaap_FinancialInstrumentAxis_0A7995B510AEA60212CA3B290E196A59" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain" xlink:label="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_D36BED076159AFA7F8273B290E197691_default" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FinancialInstrumentAxis_0A7995B510AEA60212CA3B290E196A59" xlink:to="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_D36BED076159AFA7F8273B290E197691_default" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain" xlink:label="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_D36BED076159AFA7F8273B290E197691" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FinancialInstrumentAxis_0A7995B510AEA60212CA3B290E196A59" xlink:to="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_D36BED076159AFA7F8273B290E197691" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_USTreasuryAndGovernmentMember" xlink:label="loc_us-gaap_USTreasuryAndGovernmentMember_3986EB7E1A77966F036B3B290E19B37C" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_D36BED076159AFA7F8273B290E197691" xlink:to="loc_us-gaap_USTreasuryAndGovernmentMember_3986EB7E1A77966F036B3B290E19B37C" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_CashCashEquivalentsAndShortTermInvestments" xlink:label="loc_us-gaap_CashCashEquivalentsAndShortTermInvestments_DE73CEAD322DF160213F3B290E1A9F4B" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems_6F989BB2063DD8FA01443B290E1A0180" xlink:to="loc_us-gaap_CashCashEquivalentsAndShortTermInvestments_DE73CEAD322DF160213F3B290E1A9F4B" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPositionAccumulatedLoss" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPositionAccumulatedLoss_8F5C769177BF3AA304BB3B290E1A6063" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems_6F989BB2063DD8FA01443B290E1A0180" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleUnrealizedLossPositionAccumulatedLoss_8F5C769177BF3AA304BB3B290E1A6063" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLongerAccumulatedLoss" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLongerAccumulatedLoss_C20A1D68E2F0FF729D593B290E1AA2C3" xlink:type="locator" />
    <link:definitionArc order="3" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems_6F989BB2063DD8FA01443B290E1A0180" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleContinuousUnrealizedLossPosition12MonthsOrLongerAccumulatedLoss_C20A1D68E2F0FF729D593B290E1AA2C3" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_OtherThanTemporaryImpairmentLossDebtSecuritiesAvailableForSale" xlink:label="loc_us-gaap_OtherThanTemporaryImpairmentLossDebtSecuritiesAvailableForSale_FF682C69C59D4507421E3B290E1AFAFE" xlink:type="locator" />
    <link:definitionArc order="4" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ScheduleOfAvailableForSaleSecuritiesLineItems_6F989BB2063DD8FA01443B290E1A0180" xlink:to="loc_us-gaap_OtherThanTemporaryImpairmentLossDebtSecuritiesAvailableForSale_FF682C69C59D4507421E3B290E1AFAFE" xlink:type="arc" />
  </link:definitionLink>
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/InvestmentsNetInvestmentIncomeDetails" xlink:type="extended" />
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/InvestmentsNetRealizedInvestmentsGainsLossesDetails" xlink:type="extended" />
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/InvestmentsScheduledMaturitiesDetails" xlink:type="extended" />
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/InvestmentsTables" xlink:type="extended" />
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/OrganizationAndBasisOfPresentation" xlink:type="extended" />
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/OrganizationAndBasisOfPresentationDetails" xlink:type="extended" />
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/QuarterlyFinancialDataUnaudited" xlink:type="extended" />
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/QuarterlyFinancialDataUnauditedDetails" xlink:type="extended" />
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/QuarterlyFinancialDataUnauditedTables" xlink:type="extended" />
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/RegulatoryInformation" xlink:type="extended" />
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/RegulatoryInformationNarrativeDetails" xlink:type="extended">
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_StatutoryAccountingPracticesLineItems" xlink:label="loc_us-gaap_StatutoryAccountingPracticesLineItems_F30E2D8642AD542B8E433AA15659F1C6" xlink:type="locator" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_StatutoryAccountingPracticesTable" xlink:label="loc_us-gaap_StatutoryAccountingPracticesTable_C897D3463A07D7BE4CB03AA156573E36" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_StatutoryAccountingPracticesLineItems_F30E2D8642AD542B8E433AA15659F1C6" xlink:to="loc_us-gaap_StatutoryAccountingPracticesTable_C897D3463A07D7BE4CB03AA156573E36" xlink:type="arc" xbrldt:closed="true" xbrldt:contextElement="segment" />
    <link:loc xlink:href="https://xbrl.sec.gov/dei/2019/dei-2019-01-31.xsd#dei_LegalEntityAxis" xlink:label="loc_dei_LegalEntityAxis_C46D3DA66D56F761907D3AA156589E84" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_StatutoryAccountingPracticesTable_C897D3463A07D7BE4CB03AA156573E36" xlink:to="loc_dei_LegalEntityAxis_C46D3DA66D56F761907D3AA156589E84" xlink:type="arc" />
    <link:loc xlink:href="https://xbrl.sec.gov/dei/2019/dei-2019-01-31.xsd#dei_EntityDomain" xlink:label="loc_dei_EntityDomain_86D2321E67401D101DA33AA156584525_default" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_dei_LegalEntityAxis_C46D3DA66D56F761907D3AA156589E84" xlink:to="loc_dei_EntityDomain_86D2321E67401D101DA33AA156584525_default" xlink:type="arc" />
    <link:loc xlink:href="https://xbrl.sec.gov/dei/2019/dei-2019-01-31.xsd#dei_EntityDomain" xlink:label="loc_dei_EntityDomain_86D2321E67401D101DA33AA156584525" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_dei_LegalEntityAxis_C46D3DA66D56F761907D3AA156589E84" xlink:to="loc_dei_EntityDomain_86D2321E67401D101DA33AA156584525" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_NMICMember" xlink:label="loc_nmih_NMICMember_6950D65B0CC6F1C22CBB3AA15658E005" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityDomain_86D2321E67401D101DA33AA156584525" xlink:to="loc_nmih_NMICMember_6950D65B0CC6F1C22CBB3AA15658E005" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_MaximumPermittedRTCRatio" xlink:label="loc_nmih_MaximumPermittedRTCRatio_179EBFD38B2D6F29DE293AA15659CB53" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatutoryAccountingPracticesLineItems_F30E2D8642AD542B8E433AA15659F1C6" xlink:to="loc_nmih_MaximumPermittedRTCRatio_179EBFD38B2D6F29DE293AA15659CB53" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_NumberofStatesWhichRequireMinimumAmountofStatutoryCapitalRelativetoRiskInForce" xlink:label="loc_nmih_NumberofStatesWhichRequireMinimumAmountofStatutoryCapitalRelativetoRiskInForce_4EC06ACEB4A7E5BCDA673AA15659C54E" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatutoryAccountingPracticesLineItems_F30E2D8642AD542B8E433AA15659F1C6" xlink:to="loc_nmih_NumberofStatesWhichRequireMinimumAmountofStatutoryCapitalRelativetoRiskInForce_4EC06ACEB4A7E5BCDA673AA15659C54E" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_MortgageInsuranceRiskinForce" xlink:label="loc_nmih_MortgageInsuranceRiskinForce_22059E0C10AEFF6BA9F63AA15659BAC6" xlink:type="locator" />
    <link:definitionArc order="3" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatutoryAccountingPracticesLineItems_F30E2D8642AD542B8E433AA15659F1C6" xlink:to="loc_nmih_MortgageInsuranceRiskinForce_22059E0C10AEFF6BA9F63AA15659BAC6" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_RiskToCapitalRatioRegulatoryActual" xlink:label="loc_nmih_RiskToCapitalRatioRegulatoryActual_073B5758BADF5AF10B943AA1565A7A0F" xlink:type="locator" />
    <link:definitionArc order="4" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatutoryAccountingPracticesLineItems_F30E2D8642AD542B8E433AA15659F1C6" xlink:to="loc_nmih_RiskToCapitalRatioRegulatoryActual_073B5758BADF5AF10B943AA1565A7A0F" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_MortgageInsurancePercentageofIndebtednessonSingleLoanLimit" xlink:label="loc_nmih_MortgageInsurancePercentageofIndebtednessonSingleLoanLimit_AAC1F21D3AA6BDAE55953AA1565A4AED" xlink:type="locator" />
    <link:definitionArc order="5" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatutoryAccountingPracticesLineItems_F30E2D8642AD542B8E433AA15659F1C6" xlink:to="loc_nmih_MortgageInsurancePercentageofIndebtednessonSingleLoanLimit_AAC1F21D3AA6BDAE55953AA1565A4AED" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_StockholdersEquity" xlink:label="loc_us-gaap_StockholdersEquity_F5F73B17C986850277D63AA1565ABADF" xlink:type="locator" />
    <link:definitionArc order="6" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatutoryAccountingPracticesLineItems_F30E2D8642AD542B8E433AA15659F1C6" xlink:to="loc_us-gaap_StockholdersEquity_F5F73B17C986850277D63AA1565ABADF" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_OrdinaryDividendsRestrictionwithRegardstoCapitalSurplus" xlink:label="loc_nmih_OrdinaryDividendsRestrictionwithRegardstoCapitalSurplus_EF636C6D092DC918E25C3AA1565A5893" xlink:type="locator" />
    <link:definitionArc order="7" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatutoryAccountingPracticesLineItems_F30E2D8642AD542B8E433AA15659F1C6" xlink:to="loc_nmih_OrdinaryDividendsRestrictionwithRegardstoCapitalSurplus_EF636C6D092DC918E25C3AA1565A5893" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_OrdinaryDividendsRestrictionwithRegardstoCapitalSurplusNextFiscalYear" xlink:label="loc_nmih_OrdinaryDividendsRestrictionwithRegardstoCapitalSurplusNextFiscalYear_3BB898BDB36A3CA4E6EB3AA1565A717D" xlink:type="locator" />
    <link:definitionArc order="8" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatutoryAccountingPracticesLineItems_F30E2D8642AD542B8E433AA15659F1C6" xlink:to="loc_nmih_OrdinaryDividendsRestrictionwithRegardstoCapitalSurplusNextFiscalYear_3BB898BDB36A3CA4E6EB3AA1565A717D" xlink:type="arc" />
  </link:definitionLink>
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/RegulatoryInformationScheduleOfCombinedStatutoryNetLossStatutorySurplusContingencyReserveAndRtcRatiosDetails" xlink:type="extended">
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_StatutoryAccountingPracticesLineItems" xlink:label="loc_us-gaap_StatutoryAccountingPracticesLineItems_019665FAE5EE8FD886F93AA15665F638" xlink:type="locator" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_StatutoryAccountingPracticesTable" xlink:label="loc_us-gaap_StatutoryAccountingPracticesTable_D556679D3CFBA80C863C3AA156636683" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_StatutoryAccountingPracticesLineItems_019665FAE5EE8FD886F93AA15665F638" xlink:to="loc_us-gaap_StatutoryAccountingPracticesTable_D556679D3CFBA80C863C3AA156636683" xlink:type="arc" xbrldt:closed="true" xbrldt:contextElement="segment" />
    <link:loc xlink:href="https://xbrl.sec.gov/dei/2019/dei-2019-01-31.xsd#dei_LegalEntityAxis" xlink:label="loc_dei_LegalEntityAxis_D017AAAA99C87B2EC7343AA156642C55" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_StatutoryAccountingPracticesTable_D556679D3CFBA80C863C3AA156636683" xlink:to="loc_dei_LegalEntityAxis_D017AAAA99C87B2EC7343AA156642C55" xlink:type="arc" />
    <link:loc xlink:href="https://xbrl.sec.gov/dei/2019/dei-2019-01-31.xsd#dei_EntityDomain" xlink:label="loc_dei_EntityDomain_5BAC33F68FDABA4D2CE33AA15664DC50_default" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_dei_LegalEntityAxis_D017AAAA99C87B2EC7343AA156642C55" xlink:to="loc_dei_EntityDomain_5BAC33F68FDABA4D2CE33AA15664DC50_default" xlink:type="arc" />
    <link:loc xlink:href="https://xbrl.sec.gov/dei/2019/dei-2019-01-31.xsd#dei_EntityDomain" xlink:label="loc_dei_EntityDomain_5BAC33F68FDABA4D2CE33AA15664DC50" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_dei_LegalEntityAxis_D017AAAA99C87B2EC7343AA156642C55" xlink:to="loc_dei_EntityDomain_5BAC33F68FDABA4D2CE33AA15664DC50" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_NMicandReoneCombinedMember" xlink:label="loc_nmih_NMicandReoneCombinedMember_DF81C522250530DFC3423AA15664F558" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_dei_EntityDomain_5BAC33F68FDABA4D2CE33AA15664DC50" xlink:to="loc_nmih_NMicandReoneCombinedMember_DF81C522250530DFC3423AA15664F558" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_StatutoryAccountingPracticesStatutoryNetIncomeAmount" xlink:label="loc_us-gaap_StatutoryAccountingPracticesStatutoryNetIncomeAmount_864847F879493891D6473AA15665105F" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatutoryAccountingPracticesLineItems_019665FAE5EE8FD886F93AA15665F638" xlink:to="loc_us-gaap_StatutoryAccountingPracticesStatutoryNetIncomeAmount_864847F879493891D6473AA15665105F" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_StatutoryAccountingPracticesStatutoryCapitalAndSurplusBalance" xlink:label="loc_us-gaap_StatutoryAccountingPracticesStatutoryCapitalAndSurplusBalance_D3326AB52147E7AFA1383AA15666B9E9" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatutoryAccountingPracticesLineItems_019665FAE5EE8FD886F93AA15665F638" xlink:to="loc_us-gaap_StatutoryAccountingPracticesStatutoryCapitalAndSurplusBalance_D3326AB52147E7AFA1383AA15666B9E9" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_StatutoryAccountingPracticesContingencyReserve" xlink:label="loc_nmih_StatutoryAccountingPracticesContingencyReserve_FDE56C32F409C4D099DF3AA156668F79" xlink:type="locator" />
    <link:definitionArc order="3" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatutoryAccountingPracticesLineItems_019665FAE5EE8FD886F93AA15665F638" xlink:to="loc_nmih_StatutoryAccountingPracticesContingencyReserve_FDE56C32F409C4D099DF3AA156668F79" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_RiskToCapitalRatioRegulatoryActual" xlink:label="loc_nmih_RiskToCapitalRatioRegulatoryActual_E3ACC77BF678F9AFDD183AA15666B252" xlink:type="locator" />
    <link:definitionArc order="4" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_StatutoryAccountingPracticesLineItems_019665FAE5EE8FD886F93AA15665F638" xlink:to="loc_nmih_RiskToCapitalRatioRegulatoryActual_E3ACC77BF678F9AFDD183AA15666B252" xlink:type="arc" />
  </link:definitionLink>
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/RegulatoryInformationTables" xlink:type="extended" />
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/Reinsurance" xlink:type="extended" />
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/ReinsuranceAmountsCededRelatedToQsrTransactionsDetails" xlink:type="extended">
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_CededCreditRiskLineItems" xlink:label="loc_us-gaap_CededCreditRiskLineItems_F92678C68786C5AA2F073AA1589D19BD" xlink:type="locator" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_CededCreditRiskTable" xlink:label="loc_us-gaap_CededCreditRiskTable_363FF54352EC060E81A43AA1589B7E92" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_CededCreditRiskLineItems_F92678C68786C5AA2F073AA1589D19BD" xlink:to="loc_us-gaap_CededCreditRiskTable_363FF54352EC060E81A43AA1589B7E92" xlink:type="arc" xbrldt:closed="true" xbrldt:contextElement="segment" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_CededCreditRiskAxis" xlink:label="loc_us-gaap_CededCreditRiskAxis_9D4921A2F82F240E41DF3AA1589C32C4" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_CededCreditRiskTable_363FF54352EC060E81A43AA1589B7E92" xlink:to="loc_us-gaap_CededCreditRiskAxis_9D4921A2F82F240E41DF3AA1589C32C4" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_CededCreditRiskReinsurerDomain" xlink:label="loc_us-gaap_CededCreditRiskReinsurerDomain_896C4E89EBCE7EC088873AA1589CE933_default" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_CededCreditRiskAxis_9D4921A2F82F240E41DF3AA1589C32C4" xlink:to="loc_us-gaap_CededCreditRiskReinsurerDomain_896C4E89EBCE7EC088873AA1589CE933_default" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_CededCreditRiskReinsurerDomain" xlink:label="loc_us-gaap_CededCreditRiskReinsurerDomain_896C4E89EBCE7EC088873AA1589CE933" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_CededCreditRiskAxis_9D4921A2F82F240E41DF3AA1589C32C4" xlink:to="loc_us-gaap_CededCreditRiskReinsurerDomain_896C4E89EBCE7EC088873AA1589CE933" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_ThirdPartyReinsurersMember" xlink:label="loc_nmih_ThirdPartyReinsurersMember_897160EA4774493DDB473AA1589C77D6" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_CededCreditRiskReinsurerDomain_896C4E89EBCE7EC088873AA1589CE933" xlink:to="loc_nmih_ThirdPartyReinsurersMember_897160EA4774493DDB473AA1589C77D6" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_RiskInForceCeded" xlink:label="loc_nmih_RiskInForceCeded_24ADBA3A9A0968047E6D3AA1589DA0AE" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_CededCreditRiskLineItems_F92678C68786C5AA2F073AA1589D19BD" xlink:to="loc_nmih_RiskInForceCeded_24ADBA3A9A0968047E6D3AA1589DA0AE" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_CededPremiumsEarned" xlink:label="loc_us-gaap_CededPremiumsEarned_7B24BE8C9FC7DD8497D13AA1589D3E02" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_CededCreditRiskLineItems_F92678C68786C5AA2F073AA1589D19BD" xlink:to="loc_us-gaap_CededPremiumsEarned_7B24BE8C9FC7DD8497D13AA1589D3E02" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_ReinsuranceCededClaimsandClaimsExpenses" xlink:label="loc_nmih_ReinsuranceCededClaimsandClaimsExpenses_B218EA62014960A91FB03AA1589EC7FB" xlink:type="locator" />
    <link:definitionArc order="3" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_CededCreditRiskLineItems_F92678C68786C5AA2F073AA1589D19BD" xlink:to="loc_nmih_ReinsuranceCededClaimsandClaimsExpenses_B218EA62014960A91FB03AA1589EC7FB" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_ReinsuranceCedingCommissionEarned" xlink:label="loc_nmih_ReinsuranceCedingCommissionEarned_18B55221D415558060CC3AA1589E1043" xlink:type="locator" />
    <link:definitionArc order="4" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_CededCreditRiskLineItems_F92678C68786C5AA2F073AA1589D19BD" xlink:to="loc_nmih_ReinsuranceCedingCommissionEarned_18B55221D415558060CC3AA1589E1043" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_ReinsuranceProfitCommission" xlink:label="loc_nmih_ReinsuranceProfitCommission_0B2FAF66038CB2A2BD313AA158A39803" xlink:type="locator" />
    <link:definitionArc order="5" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_CededCreditRiskLineItems_F92678C68786C5AA2F073AA1589D19BD" xlink:to="loc_nmih_ReinsuranceProfitCommission_0B2FAF66038CB2A2BD313AA158A39803" xlink:type="arc" />
  </link:definitionLink>
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/ReinsuranceEffectOfReinsuranceAgreementsOnPremiumsWrittenAndEarnedDetails" xlink:type="extended" />
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/ReinsuranceIlnTransactionsDetails" xlink:type="extended">
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_DeferredCompensationArrangementWithIndividualExcludingShareBasedPaymentsAndPostretirementBenefitsLineItems" xlink:label="loc_us-gaap_DeferredCompensationArrangementWithIndividualExcludingShareBasedPaymentsAndPostretirementBenefitsLineItems_2EFDC7A37084BFFAB5BC3AA158B69AFC" xlink:type="locator" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ScheduleOfDeferredCompensationArrangementWithIndividualExcludingShareBasedPaymentsAndPostretirementBenefitsByTitleOfIndividualAndByTypeOfDeferredCompensationTable" xlink:label="loc_us-gaap_ScheduleOfDeferredCompensationArrangementWithIndividualExcludingShareBasedPaymentsAndPostretirementBenefitsByTitleOfIndividualAndByTypeOfDeferredCompensationTable_16775FBC8CA1FF0D3DE63AA158B5DA2B" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_DeferredCompensationArrangementWithIndividualExcludingShareBasedPaymentsAndPostretirementBenefitsLineItems_2EFDC7A37084BFFAB5BC3AA158B69AFC" xlink:to="loc_us-gaap_ScheduleOfDeferredCompensationArrangementWithIndividualExcludingShareBasedPaymentsAndPostretirementBenefitsByTitleOfIndividualAndByTypeOfDeferredCompensationTable_16775FBC8CA1FF0D3DE63AA158B5DA2B" xlink:type="arc" xbrldt:closed="true" xbrldt:contextElement="segment" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_TitleOfIndividualAxis" xlink:label="loc_srt_TitleOfIndividualAxis_233966B1231CFE30206D3AA158B5F66F" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfDeferredCompensationArrangementWithIndividualExcludingShareBasedPaymentsAndPostretirementBenefitsByTitleOfIndividualAndByTypeOfDeferredCompensationTable_16775FBC8CA1FF0D3DE63AA158B5DA2B" xlink:to="loc_srt_TitleOfIndividualAxis_233966B1231CFE30206D3AA158B5F66F" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_TitleOfIndividualWithRelationshipToEntityDomain" xlink:label="loc_srt_TitleOfIndividualWithRelationshipToEntityDomain_348FEBB346630DA9FD133AA158B51C57_default" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_TitleOfIndividualAxis_233966B1231CFE30206D3AA158B5F66F" xlink:to="loc_srt_TitleOfIndividualWithRelationshipToEntityDomain_348FEBB346630DA9FD133AA158B51C57_default" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_TitleOfIndividualWithRelationshipToEntityDomain" xlink:label="loc_srt_TitleOfIndividualWithRelationshipToEntityDomain_348FEBB346630DA9FD133AA158B51C57" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_TitleOfIndividualAxis_233966B1231CFE30206D3AA158B5F66F" xlink:to="loc_srt_TitleOfIndividualWithRelationshipToEntityDomain_348FEBB346630DA9FD133AA158B51C57" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_A2017ILNMember" xlink:label="loc_nmih_A2017ILNMember_40DB1BC8C04B0DBB72953AA158B52797" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_TitleOfIndividualWithRelationshipToEntityDomain_348FEBB346630DA9FD133AA158B51C57" xlink:to="loc_nmih_A2017ILNMember_40DB1BC8C04B0DBB72953AA158B52797" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_A2018ILNMember" xlink:label="loc_nmih_A2018ILNMember_DC1880B4D0113A2419FA3AA158B656EA" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_TitleOfIndividualWithRelationshipToEntityDomain_348FEBB346630DA9FD133AA158B51C57" xlink:to="loc_nmih_A2018ILNMember_DC1880B4D0113A2419FA3AA158B656EA" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_A2019ILNMember" xlink:label="loc_nmih_A2019ILNMember_C85A54118190A8477E413AA158B65CBF" xlink:type="locator" />
    <link:definitionArc order="3" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_TitleOfIndividualWithRelationshipToEntityDomain_348FEBB346630DA9FD133AA158B51C57" xlink:to="loc_nmih_A2019ILNMember_C85A54118190A8477E413AA158B65CBF" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_InitialReinsuranceCoverage" xlink:label="loc_nmih_InitialReinsuranceCoverage_E6C77483EA6A6FA67DC33AA158B7951A" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DeferredCompensationArrangementWithIndividualExcludingShareBasedPaymentsAndPostretirementBenefitsLineItems_2EFDC7A37084BFFAB5BC3AA158B69AFC" xlink:to="loc_nmih_InitialReinsuranceCoverage_E6C77483EA6A6FA67DC33AA158B7951A" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_CurrentReinsuranceCoverage" xlink:label="loc_nmih_CurrentReinsuranceCoverage_9FD5AFC46641838B67BD3AA158B7B47A" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DeferredCompensationArrangementWithIndividualExcludingShareBasedPaymentsAndPostretirementBenefitsLineItems_2EFDC7A37084BFFAB5BC3AA158B69AFC" xlink:to="loc_nmih_CurrentReinsuranceCoverage_9FD5AFC46641838B67BD3AA158B7B47A" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_InitialFirstLayerRetainedLoss" xlink:label="loc_nmih_InitialFirstLayerRetainedLoss_68557FBCA93F9A9B19D53AA158B7A83B" xlink:type="locator" />
    <link:definitionArc order="3" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DeferredCompensationArrangementWithIndividualExcludingShareBasedPaymentsAndPostretirementBenefitsLineItems_2EFDC7A37084BFFAB5BC3AA158B69AFC" xlink:to="loc_nmih_InitialFirstLayerRetainedLoss_68557FBCA93F9A9B19D53AA158B7A83B" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_CurrentFirstLayerRetainedLoss" xlink:label="loc_nmih_CurrentFirstLayerRetainedLoss_B5552FFB24CDF944124D3AA158B739E6" xlink:type="locator" />
    <link:definitionArc order="4" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_DeferredCompensationArrangementWithIndividualExcludingShareBasedPaymentsAndPostretirementBenefitsLineItems_2EFDC7A37084BFFAB5BC3AA158B69AFC" xlink:to="loc_nmih_CurrentFirstLayerRetainedLoss_B5552FFB24CDF944124D3AA158B739E6" xlink:type="arc" />
  </link:definitionLink>
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/ReinsuranceNarrativeDetails" xlink:type="extended">
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_CededCreditRiskLineItems" xlink:label="loc_us-gaap_CededCreditRiskLineItems_6069C1FAE870F804F10C3AA158E830E8" xlink:type="locator" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_CededCreditRiskTable" xlink:label="loc_us-gaap_CededCreditRiskTable_3CC6C585F42518948CB93AA158DDFF4E" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_CededCreditRiskLineItems_6069C1FAE870F804F10C3AA158E830E8" xlink:to="loc_us-gaap_CededCreditRiskTable_3CC6C585F42518948CB93AA158DDFF4E" xlink:type="arc" xbrldt:closed="true" xbrldt:contextElement="segment" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_CededCreditRiskAxis" xlink:label="loc_us-gaap_CededCreditRiskAxis_22B2446A24B333C4C1043AA158DEE9D1" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_CededCreditRiskTable_3CC6C585F42518948CB93AA158DDFF4E" xlink:to="loc_us-gaap_CededCreditRiskAxis_22B2446A24B333C4C1043AA158DEE9D1" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_CededCreditRiskReinsurerDomain" xlink:label="loc_us-gaap_CededCreditRiskReinsurerDomain_F356B796C6333FDEF4C93AA158DE6A33_default" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_CededCreditRiskAxis_22B2446A24B333C4C1043AA158DEE9D1" xlink:to="loc_us-gaap_CededCreditRiskReinsurerDomain_F356B796C6333FDEF4C93AA158DE6A33_default" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_CededCreditRiskReinsurerDomain" xlink:label="loc_us-gaap_CededCreditRiskReinsurerDomain_F356B796C6333FDEF4C93AA158DE6A33" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_CededCreditRiskAxis_22B2446A24B333C4C1043AA158DEE9D1" xlink:to="loc_us-gaap_CededCreditRiskReinsurerDomain_F356B796C6333FDEF4C93AA158DE6A33" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_ThirdPartyReinsurersMember" xlink:label="loc_nmih_ThirdPartyReinsurersMember_9B0E5F1FA1A4C3E3EF493AA158DEC5B4" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_CededCreditRiskReinsurerDomain_F356B796C6333FDEF4C93AA158DE6A33" xlink:to="loc_nmih_ThirdPartyReinsurersMember_9B0E5F1FA1A4C3E3EF493AA158DEC5B4" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_RangeAxis" xlink:label="loc_srt_RangeAxis_3218906E56C62FB0A5F93AA158DF690C" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_CededCreditRiskTable_3CC6C585F42518948CB93AA158DDFF4E" xlink:to="loc_srt_RangeAxis_3218906E56C62FB0A5F93AA158DF690C" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_RangeMember" xlink:label="loc_srt_RangeMember_0E4AF6F02052C04988AE3AA158DFCC32_default" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_RangeAxis_3218906E56C62FB0A5F93AA158DF690C" xlink:to="loc_srt_RangeMember_0E4AF6F02052C04988AE3AA158DFCC32_default" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_RangeMember" xlink:label="loc_srt_RangeMember_0E4AF6F02052C04988AE3AA158DFCC32" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_RangeAxis_3218906E56C62FB0A5F93AA158DF690C" xlink:to="loc_srt_RangeMember_0E4AF6F02052C04988AE3AA158DFCC32" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_MaximumMember" xlink:label="loc_srt_MaximumMember_417772D80A445DBBE7253AA158DFB253" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RangeMember_0E4AF6F02052C04988AE3AA158DFCC32" xlink:to="loc_srt_MaximumMember_417772D80A445DBBE7253AA158DFB253" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ReinsurancePolicyTypeAxis" xlink:label="loc_us-gaap_ReinsurancePolicyTypeAxis_DDADF49A3EFE882FF6243AA158E008E8" xlink:type="locator" />
    <link:definitionArc order="3" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_CededCreditRiskTable_3CC6C585F42518948CB93AA158DDFF4E" xlink:to="loc_us-gaap_ReinsurancePolicyTypeAxis_DDADF49A3EFE882FF6243AA158E008E8" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ReinsurancePolicyDomain" xlink:label="loc_us-gaap_ReinsurancePolicyDomain_5766AAFA9E19372AF86D3AA158E08930_default" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_ReinsurancePolicyTypeAxis_DDADF49A3EFE882FF6243AA158E008E8" xlink:to="loc_us-gaap_ReinsurancePolicyDomain_5766AAFA9E19372AF86D3AA158E08930_default" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ReinsurancePolicyDomain" xlink:label="loc_us-gaap_ReinsurancePolicyDomain_5766AAFA9E19372AF86D3AA158E08930" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_ReinsurancePolicyTypeAxis_DDADF49A3EFE882FF6243AA158E008E8" xlink:to="loc_us-gaap_ReinsurancePolicyDomain_5766AAFA9E19372AF86D3AA158E08930" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_ILNTransactionsMember" xlink:label="loc_nmih_ILNTransactionsMember_2D7795E44483EFEF02563AA158E0E2E7" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ReinsurancePolicyDomain_5766AAFA9E19372AF86D3AA158E08930" xlink:to="loc_nmih_ILNTransactionsMember_2D7795E44483EFEF02563AA158E0E2E7" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_TwoThousandSeventeenILNTransactionMember" xlink:label="loc_nmih_TwoThousandSeventeenILNTransactionMember_2C3E25E63D369A38953B3AA158E0C3D3" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_nmih_ILNTransactionsMember_2D7795E44483EFEF02563AA158E0E2E7" xlink:to="loc_nmih_TwoThousandSeventeenILNTransactionMember_2C3E25E63D369A38953B3AA158E0C3D3" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_TwoThousandEighteenILNTransactionMember" xlink:label="loc_nmih_TwoThousandEighteenILNTransactionMember_A5A19DF4CEB703EB6F973AA158E15147" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_nmih_ILNTransactionsMember_2D7795E44483EFEF02563AA158E0E2E7" xlink:to="loc_nmih_TwoThousandEighteenILNTransactionMember_A5A19DF4CEB703EB6F973AA158E15147" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_QSRTransactionsMember" xlink:label="loc_nmih_QSRTransactionsMember_F7B8F5234DCBEAFA5F1E3AA158E1B373" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ReinsurancePolicyDomain_5766AAFA9E19372AF86D3AA158E08930" xlink:to="loc_nmih_QSRTransactionsMember_F7B8F5234DCBEAFA5F1E3AA158E1B373" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_TwoThousandEighteenQSRTransactionMember" xlink:label="loc_nmih_TwoThousandEighteenQSRTransactionMember_70EF6C81FDA460E701D83AA158E1FB6F" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_nmih_QSRTransactionsMember_F7B8F5234DCBEAFA5F1E3AA158E1B373" xlink:to="loc_nmih_TwoThousandEighteenQSRTransactionMember_70EF6C81FDA460E701D83AA158E1FB6F" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_EligiblePoliciesPoolFourMember" xlink:label="loc_nmih_EligiblePoliciesPoolFourMember_937751F8CACD4A113E823AA158E22101" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_nmih_TwoThousandEighteenQSRTransactionMember_70EF6C81FDA460E701D83AA158E1FB6F" xlink:to="loc_nmih_EligiblePoliciesPoolFourMember_937751F8CACD4A113E823AA158E22101" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_EligiblePoliciesPoolFiveMember" xlink:label="loc_nmih_EligiblePoliciesPoolFiveMember_BF55CC90A8BE6712C6BE3AA158E26FF3" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_nmih_TwoThousandEighteenQSRTransactionMember_70EF6C81FDA460E701D83AA158E1FB6F" xlink:to="loc_nmih_EligiblePoliciesPoolFiveMember_BF55CC90A8BE6712C6BE3AA158E26FF3" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_TwoThousandSixteenQSRTransactionMember" xlink:label="loc_nmih_TwoThousandSixteenQSRTransactionMember_DEF51EB311B2A228D4293AA158E245EB" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_nmih_QSRTransactionsMember_F7B8F5234DCBEAFA5F1E3AA158E1B373" xlink:to="loc_nmih_TwoThousandSixteenQSRTransactionMember_DEF51EB311B2A228D4293AA158E245EB" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_EligiblePoliciesPoolOneMember" xlink:label="loc_nmih_EligiblePoliciesPoolOneMember_4229881171024F84A2C13AA158E77CB5" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_nmih_TwoThousandSixteenQSRTransactionMember_DEF51EB311B2A228D4293AA158E245EB" xlink:to="loc_nmih_EligiblePoliciesPoolOneMember_4229881171024F84A2C13AA158E77CB5" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_EligiblePoliciesPoolTwoMember" xlink:label="loc_nmih_EligiblePoliciesPoolTwoMember_FDB9A400E6ED85F42C0B3AA158E84126" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_nmih_EligiblePoliciesPoolOneMember_4229881171024F84A2C13AA158E77CB5" xlink:to="loc_nmih_EligiblePoliciesPoolTwoMember_FDB9A400E6ED85F42C0B3AA158E84126" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_ReinsuranceRetentionPolicyTermOfUnderlyingMortgageAmortization" xlink:label="loc_nmih_ReinsuranceRetentionPolicyTermOfUnderlyingMortgageAmortization_27F9E9565393382311163AA158E9DF90" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_CededCreditRiskLineItems_6069C1FAE870F804F10C3AA158E830E8" xlink:to="loc_nmih_ReinsuranceRetentionPolicyTermOfUnderlyingMortgageAmortization_27F9E9565393382311163AA158E9DF90" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_AnticipatedOperatingExpensePaymentsAnnual" xlink:label="loc_nmih_AnticipatedOperatingExpensePaymentsAnnual_3CDB54CC2180C25EFC093AA158E98090" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_CededCreditRiskLineItems_6069C1FAE870F804F10C3AA158E830E8" xlink:to="loc_nmih_AnticipatedOperatingExpensePaymentsAnnual_3CDB54CC2180C25EFC093AA158E98090" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_ReinsuranceRetentionRiskPremiumsPaid" xlink:label="loc_nmih_ReinsuranceRetentionRiskPremiumsPaid_1AAF1655EC7FEE0DD5D23AA158E98B8E" xlink:type="locator" />
    <link:definitionArc order="3" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_CededCreditRiskLineItems_6069C1FAE870F804F10C3AA158E830E8" xlink:to="loc_nmih_ReinsuranceRetentionRiskPremiumsPaid_1AAF1655EC7FEE0DD5D23AA158E98B8E" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_ReinsuranceAgreementOptionalTerminationRightPercentOfReinsuranceCoverageThreshold" xlink:label="loc_nmih_ReinsuranceAgreementOptionalTerminationRightPercentOfReinsuranceCoverageThreshold_96C9212238D26AF356C03AA158E93073" xlink:type="locator" />
    <link:definitionArc order="4" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_CededCreditRiskLineItems_6069C1FAE870F804F10C3AA158E830E8" xlink:to="loc_nmih_ReinsuranceAgreementOptionalTerminationRightPercentOfReinsuranceCoverageThreshold_96C9212238D26AF356C03AA158E93073" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_RestrictedCash" xlink:label="loc_us-gaap_RestrictedCash_4FF6085B2B7666E96A7E3AA158E9F163" xlink:type="locator" />
    <link:definitionArc order="5" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_CededCreditRiskLineItems_6069C1FAE870F804F10C3AA158E830E8" xlink:to="loc_us-gaap_RestrictedCash_4FF6085B2B7666E96A7E3AA158E9F163" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ReinsuranceRetentionPolicyReinsuredRiskPercentage" xlink:label="loc_us-gaap_ReinsuranceRetentionPolicyReinsuredRiskPercentage_101872087DC2BDC327CF3AA158EA97E9" xlink:type="locator" />
    <link:definitionArc order="6" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_CededCreditRiskLineItems_6069C1FAE870F804F10C3AA158E830E8" xlink:to="loc_us-gaap_ReinsuranceRetentionPolicyReinsuredRiskPercentage_101872087DC2BDC327CF3AA158EA97E9" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_PremiumsEarnedPercentOfRisk" xlink:label="loc_nmih_PremiumsEarnedPercentOfRisk_1668C11B2DEDA508D4473AA158EAC015" xlink:type="locator" />
    <link:definitionArc order="7" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_CededCreditRiskLineItems_6069C1FAE870F804F10C3AA158E830E8" xlink:to="loc_nmih_PremiumsEarnedPercentOfRisk_1668C11B2DEDA508D4473AA158EAC015" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_PreviouslyCededPrimaryRiskInForceRecaptured" xlink:label="loc_nmih_PreviouslyCededPrimaryRiskInForceRecaptured_2E7C87EB72865A1D19173AA158EA6F9A" xlink:type="locator" />
    <link:definitionArc order="8" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_CededCreditRiskLineItems_6069C1FAE870F804F10C3AA158E830E8" xlink:to="loc_nmih_PreviouslyCededPrimaryRiskInForceRecaptured_2E7C87EB72865A1D19173AA158EA6F9A" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_CededCreditRiskCommissionEarnedPercentage" xlink:label="loc_nmih_CededCreditRiskCommissionEarnedPercentage_F58605E683D6F17308203AA158EABC51" xlink:type="locator" />
    <link:definitionArc order="9" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_CededCreditRiskLineItems_6069C1FAE870F804F10C3AA158E830E8" xlink:to="loc_nmih_CededCreditRiskCommissionEarnedPercentage_F58605E683D6F17308203AA158EABC51" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_CededCreditRiskProfitCommissionLossRatioOnLoansThreshold" xlink:label="loc_nmih_CededCreditRiskProfitCommissionLossRatioOnLoansThreshold_F9604CC80CCDE2A528E13AA158EB86A6" xlink:type="locator" />
    <link:definitionArc order="10" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_CededCreditRiskLineItems_6069C1FAE870F804F10C3AA158E830E8" xlink:to="loc_nmih_CededCreditRiskProfitCommissionLossRatioOnLoansThreshold_F9604CC80CCDE2A528E13AA158EB86A6" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ReinsuranceRecoverablesOnPaidAndUnpaidLosses" xlink:label="loc_us-gaap_ReinsuranceRecoverablesOnPaidAndUnpaidLosses_F1851CEBAFA15B543F193AA158EB0EB4" xlink:type="locator" />
    <link:definitionArc order="11" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_CededCreditRiskLineItems_6069C1FAE870F804F10C3AA158E830E8" xlink:to="loc_us-gaap_ReinsuranceRecoverablesOnPaidAndUnpaidLosses_F1851CEBAFA15B543F193AA158EB0EB4" xlink:type="arc" />
  </link:definitionLink>
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/ReinsuranceTables" xlink:type="extended" />
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/ReserveForInsuranceClaimsAndClaimExpenses" xlink:type="extended" />
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/ReservesForInsuranceClaimsAndClaimExpensesAverageAnnualPercentagePayoutOfIncurredClaimsByAgeNetOfReinsuranceDetails" xlink:type="extended">
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ShortdurationInsuranceContractsHistoricalClaimsDurationLineItems" xlink:label="loc_us-gaap_ShortdurationInsuranceContractsHistoricalClaimsDurationLineItems_F892B189641BE22549433AA157EE6481" xlink:type="locator" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ShortdurationInsuranceContractsHistoricalClaimsDurationTable" xlink:label="loc_us-gaap_ShortdurationInsuranceContractsHistoricalClaimsDurationTable_651D97515E4472390B463AA157ECA26A" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_ShortdurationInsuranceContractsHistoricalClaimsDurationLineItems_F892B189641BE22549433AA157EE6481" xlink:to="loc_us-gaap_ShortdurationInsuranceContractsHistoricalClaimsDurationTable_651D97515E4472390B463AA157ECA26A" xlink:type="arc" xbrldt:closed="true" xbrldt:contextElement="segment" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_ProductOrServiceAxis" xlink:label="loc_srt_ProductOrServiceAxis_1E95B3C74C145E48AC993AA157ED8677" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ShortdurationInsuranceContractsHistoricalClaimsDurationTable_651D97515E4472390B463AA157ECA26A" xlink:to="loc_srt_ProductOrServiceAxis_1E95B3C74C145E48AC993AA157ED8677" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_ProductsAndServicesDomain" xlink:label="loc_srt_ProductsAndServicesDomain_9A802DCF8EA82527861A3AA157ED2F60_default" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_ProductOrServiceAxis_1E95B3C74C145E48AC993AA157ED8677" xlink:to="loc_srt_ProductsAndServicesDomain_9A802DCF8EA82527861A3AA157ED2F60_default" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_ProductsAndServicesDomain" xlink:label="loc_srt_ProductsAndServicesDomain_9A802DCF8EA82527861A3AA157ED2F60" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_ProductOrServiceAxis_1E95B3C74C145E48AC993AA157ED8677" xlink:to="loc_srt_ProductsAndServicesDomain_9A802DCF8EA82527861A3AA157ED2F60" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_FinancialGuaranteeInsuranceSegmentMember" xlink:label="loc_us-gaap_FinancialGuaranteeInsuranceSegmentMember_6C32E80F8245508C24093AA157EE854A" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_ProductsAndServicesDomain_9A802DCF8EA82527861A3AA157ED2F60" xlink:to="loc_us-gaap_FinancialGuaranteeInsuranceSegmentMember_6C32E80F8245508C24093AA157EE854A" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ShortdurationInsuranceContractsHistoricalClaimsDurationYearOne" xlink:label="loc_us-gaap_ShortdurationInsuranceContractsHistoricalClaimsDurationYearOne_12A11BD3639BB7EBBA7C3AA157EE486A" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShortdurationInsuranceContractsHistoricalClaimsDurationLineItems_F892B189641BE22549433AA157EE6481" xlink:to="loc_us-gaap_ShortdurationInsuranceContractsHistoricalClaimsDurationYearOne_12A11BD3639BB7EBBA7C3AA157EE486A" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ShortdurationInsuranceContractsHistoricalClaimsDurationYearTwo" xlink:label="loc_us-gaap_ShortdurationInsuranceContractsHistoricalClaimsDurationYearTwo_D0D10C45690F018B2B253AA157EF78A5" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShortdurationInsuranceContractsHistoricalClaimsDurationLineItems_F892B189641BE22549433AA157EE6481" xlink:to="loc_us-gaap_ShortdurationInsuranceContractsHistoricalClaimsDurationYearTwo_D0D10C45690F018B2B253AA157EF78A5" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ShortdurationInsuranceContractsHistoricalClaimsDurationYearThree" xlink:label="loc_us-gaap_ShortdurationInsuranceContractsHistoricalClaimsDurationYearThree_42BD2661095F0605A8623AA157EF7FB2" xlink:type="locator" />
    <link:definitionArc order="3" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShortdurationInsuranceContractsHistoricalClaimsDurationLineItems_F892B189641BE22549433AA157EE6481" xlink:to="loc_us-gaap_ShortdurationInsuranceContractsHistoricalClaimsDurationYearThree_42BD2661095F0605A8623AA157EF7FB2" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ShortdurationInsuranceContractsHistoricalClaimsDurationYearFour" xlink:label="loc_us-gaap_ShortdurationInsuranceContractsHistoricalClaimsDurationYearFour_BB36EB6517B929AC18983AA157EFD88D" xlink:type="locator" />
    <link:definitionArc order="4" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShortdurationInsuranceContractsHistoricalClaimsDurationLineItems_F892B189641BE22549433AA157EE6481" xlink:to="loc_us-gaap_ShortdurationInsuranceContractsHistoricalClaimsDurationYearFour_BB36EB6517B929AC18983AA157EFD88D" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ShortdurationInsuranceContractsHistoricalClaimsDurationYearFive" xlink:label="loc_us-gaap_ShortdurationInsuranceContractsHistoricalClaimsDurationYearFive_C9B4FFF8E05EE2239D363AA157EF8A9C" xlink:type="locator" />
    <link:definitionArc order="5" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShortdurationInsuranceContractsHistoricalClaimsDurationLineItems_F892B189641BE22549433AA157EE6481" xlink:to="loc_us-gaap_ShortdurationInsuranceContractsHistoricalClaimsDurationYearFive_C9B4FFF8E05EE2239D363AA157EF8A9C" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ShortdurationInsuranceContractsHistoricalClaimsDurationYearSix" xlink:label="loc_us-gaap_ShortdurationInsuranceContractsHistoricalClaimsDurationYearSix_3DB72DD2AA8B32482FA93AA157EF7568" xlink:type="locator" />
    <link:definitionArc order="6" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShortdurationInsuranceContractsHistoricalClaimsDurationLineItems_F892B189641BE22549433AA157EE6481" xlink:to="loc_us-gaap_ShortdurationInsuranceContractsHistoricalClaimsDurationYearSix_3DB72DD2AA8B32482FA93AA157EF7568" xlink:type="arc" />
  </link:definitionLink>
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/ReservesForInsuranceClaimsAndClaimExpensesClaimDevelopmentByAccidentYearAndReconciliationOfReserveForInsuranceClaimsAndClaimsExpenseDetails" xlink:type="extended">
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ClaimsDevelopmentLineItems" xlink:label="loc_us-gaap_ClaimsDevelopmentLineItems_1B1E85D4C053536CB3B43AA1582761C6" xlink:type="locator" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ShortdurationInsuranceContractsClaimsDevelopmentTable" xlink:label="loc_us-gaap_ShortdurationInsuranceContractsClaimsDevelopmentTable_5DEA440824353642C58E3AA158237542" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_ClaimsDevelopmentLineItems_1B1E85D4C053536CB3B43AA1582761C6" xlink:to="loc_us-gaap_ShortdurationInsuranceContractsClaimsDevelopmentTable_5DEA440824353642C58E3AA158237542" xlink:type="arc" xbrldt:closed="true" xbrldt:contextElement="segment" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_ProductOrServiceAxis" xlink:label="loc_srt_ProductOrServiceAxis_31C72BF99E8E78B80E3B3AA1582438DE" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ShortdurationInsuranceContractsClaimsDevelopmentTable_5DEA440824353642C58E3AA158237542" xlink:to="loc_srt_ProductOrServiceAxis_31C72BF99E8E78B80E3B3AA1582438DE" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_ProductsAndServicesDomain" xlink:label="loc_srt_ProductsAndServicesDomain_2AE5E489BB028A0F7D383AA15824EB56_default" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_ProductOrServiceAxis_31C72BF99E8E78B80E3B3AA1582438DE" xlink:to="loc_srt_ProductsAndServicesDomain_2AE5E489BB028A0F7D383AA15824EB56_default" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_ProductsAndServicesDomain" xlink:label="loc_srt_ProductsAndServicesDomain_2AE5E489BB028A0F7D383AA15824EB56" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_ProductOrServiceAxis_31C72BF99E8E78B80E3B3AA1582438DE" xlink:to="loc_srt_ProductsAndServicesDomain_2AE5E489BB028A0F7D383AA15824EB56" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_FinancialGuaranteeInsuranceSegmentMember" xlink:label="loc_us-gaap_FinancialGuaranteeInsuranceSegmentMember_6078DED130FB4C8315893AA1582465F3" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_ProductsAndServicesDomain_2AE5E489BB028A0F7D383AA15824EB56" xlink:to="loc_us-gaap_FinancialGuaranteeInsuranceSegmentMember_6078DED130FB4C8315893AA1582465F3" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ShortdurationInsuranceContractsAccidentYearAxis" xlink:label="loc_us-gaap_ShortdurationInsuranceContractsAccidentYearAxis_24484B99171C90FA20FC3AA15825CC6E" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ShortdurationInsuranceContractsClaimsDevelopmentTable_5DEA440824353642C58E3AA158237542" xlink:to="loc_us-gaap_ShortdurationInsuranceContractsAccidentYearAxis_24484B99171C90FA20FC3AA15825CC6E" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ShortdurationInsuranceContractsAccidentYearDomain" xlink:label="loc_us-gaap_ShortdurationInsuranceContractsAccidentYearDomain_EF9512BAF26C5260CC803AA158251E09_default" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_ShortdurationInsuranceContractsAccidentYearAxis_24484B99171C90FA20FC3AA15825CC6E" xlink:to="loc_us-gaap_ShortdurationInsuranceContractsAccidentYearDomain_EF9512BAF26C5260CC803AA158251E09_default" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ShortdurationInsuranceContractsAccidentYearDomain" xlink:label="loc_us-gaap_ShortdurationInsuranceContractsAccidentYearDomain_EF9512BAF26C5260CC803AA158251E09" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_ShortdurationInsuranceContractsAccidentYearAxis_24484B99171C90FA20FC3AA15825CC6E" xlink:to="loc_us-gaap_ShortdurationInsuranceContractsAccidentYearDomain_EF9512BAF26C5260CC803AA158251E09" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ShortdurationInsuranceContractsAccidentYear2013Member" xlink:label="loc_us-gaap_ShortdurationInsuranceContractsAccidentYear2013Member_CCCC9DDC6C9A479E2C3F3AA15825BD1D" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShortdurationInsuranceContractsAccidentYearDomain_EF9512BAF26C5260CC803AA158251E09" xlink:to="loc_us-gaap_ShortdurationInsuranceContractsAccidentYear2013Member_CCCC9DDC6C9A479E2C3F3AA15825BD1D" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ShortdurationInsuranceContractsAccidentYear2014Member" xlink:label="loc_us-gaap_ShortdurationInsuranceContractsAccidentYear2014Member_2DA6DD8C7DEBCB1709863AA15826E330" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShortdurationInsuranceContractsAccidentYearDomain_EF9512BAF26C5260CC803AA158251E09" xlink:to="loc_us-gaap_ShortdurationInsuranceContractsAccidentYear2014Member_2DA6DD8C7DEBCB1709863AA15826E330" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ShortdurationInsuranceContractsAccidentYear2015Member" xlink:label="loc_us-gaap_ShortdurationInsuranceContractsAccidentYear2015Member_8E99DE305E3EFDAF55D33AA158264255" xlink:type="locator" />
    <link:definitionArc order="3" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShortdurationInsuranceContractsAccidentYearDomain_EF9512BAF26C5260CC803AA158251E09" xlink:to="loc_us-gaap_ShortdurationInsuranceContractsAccidentYear2015Member_8E99DE305E3EFDAF55D33AA158264255" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ShortdurationInsuranceContractsAccidentYear2016Member" xlink:label="loc_us-gaap_ShortdurationInsuranceContractsAccidentYear2016Member_96C2E0E274E075DAA8F03AA158260FA9" xlink:type="locator" />
    <link:definitionArc order="4" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShortdurationInsuranceContractsAccidentYearDomain_EF9512BAF26C5260CC803AA158251E09" xlink:to="loc_us-gaap_ShortdurationInsuranceContractsAccidentYear2016Member_96C2E0E274E075DAA8F03AA158260FA9" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ShortDurationInsuranceContractsAccidentYear2017Member" xlink:label="loc_us-gaap_ShortDurationInsuranceContractsAccidentYear2017Member_FE06B190B7FC678765B33AA158268035" xlink:type="locator" />
    <link:definitionArc order="5" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShortdurationInsuranceContractsAccidentYearDomain_EF9512BAF26C5260CC803AA158251E09" xlink:to="loc_us-gaap_ShortDurationInsuranceContractsAccidentYear2017Member_FE06B190B7FC678765B33AA158268035" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ShortDurationInsuranceContractsAccidentYear2018Member" xlink:label="loc_us-gaap_ShortDurationInsuranceContractsAccidentYear2018Member_418D13D9C0BFC83F6A523AA15827040E" xlink:type="locator" />
    <link:definitionArc order="6" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShortdurationInsuranceContractsAccidentYearDomain_EF9512BAF26C5260CC803AA158251E09" xlink:to="loc_us-gaap_ShortDurationInsuranceContractsAccidentYear2018Member_418D13D9C0BFC83F6A523AA15827040E" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ShortDurationInsuranceContractAccidentYear2019Member" xlink:label="loc_us-gaap_ShortDurationInsuranceContractAccidentYear2019Member_097860FCEAE399D451D23AA15827EC6F" xlink:type="locator" />
    <link:definitionArc order="7" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShortdurationInsuranceContractsAccidentYearDomain_EF9512BAF26C5260CC803AA158251E09" xlink:to="loc_us-gaap_ShortDurationInsuranceContractAccidentYear2019Member_097860FCEAE399D451D23AA15827EC6F" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ShortdurationInsuranceContractsIncurredClaimsAndAllocatedClaimAdjustmentExpenseNet" xlink:label="loc_us-gaap_ShortdurationInsuranceContractsIncurredClaimsAndAllocatedClaimAdjustmentExpenseNet_50C1DE5F87E01B08C6EB3AA1582795CB" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClaimsDevelopmentLineItems_1B1E85D4C053536CB3B43AA1582761C6" xlink:to="loc_us-gaap_ShortdurationInsuranceContractsIncurredClaimsAndAllocatedClaimAdjustmentExpenseNet_50C1DE5F87E01B08C6EB3AA1582795CB" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ShortdurationInsuranceContractsIncurredButNotReportedIbnrClaimsLiabilityNet" xlink:label="loc_us-gaap_ShortdurationInsuranceContractsIncurredButNotReportedIbnrClaimsLiabilityNet_3E77E9E8DDD7A8CB2F4A3AA158288989" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClaimsDevelopmentLineItems_1B1E85D4C053536CB3B43AA1582761C6" xlink:to="loc_us-gaap_ShortdurationInsuranceContractsIncurredButNotReportedIbnrClaimsLiabilityNet_3E77E9E8DDD7A8CB2F4A3AA158288989" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ShortdurationInsuranceContractsNumberOfReportedClaims" xlink:label="loc_us-gaap_ShortdurationInsuranceContractsNumberOfReportedClaims_CB908218ABE27953E6D73AA1582D24BE" xlink:type="locator" />
    <link:definitionArc order="3" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClaimsDevelopmentLineItems_1B1E85D4C053536CB3B43AA1582761C6" xlink:to="loc_us-gaap_ShortdurationInsuranceContractsNumberOfReportedClaims_CB908218ABE27953E6D73AA1582D24BE" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ShortdurationInsuranceContractsCumulativePaidClaimsAndAllocatedClaimAdjustmentExpenseNet" xlink:label="loc_us-gaap_ShortdurationInsuranceContractsCumulativePaidClaimsAndAllocatedClaimAdjustmentExpenseNet_5940EACB16704128267E3AA1582D21F9" xlink:type="locator" />
    <link:definitionArc order="4" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClaimsDevelopmentLineItems_1B1E85D4C053536CB3B43AA1582761C6" xlink:to="loc_us-gaap_ShortdurationInsuranceContractsCumulativePaidClaimsAndAllocatedClaimAdjustmentExpenseNet_5940EACB16704128267E3AA1582D21F9" xlink:type="arc" />
  </link:definitionLink>
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/ReservesForInsuranceClaimsAndClaimExpensesNarrativeDetails" xlink:type="extended">
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_LiabilityForClaimsAndClaimsAdjustmentExpenseLineItems" xlink:label="loc_us-gaap_LiabilityForClaimsAndClaimsAdjustmentExpenseLineItems_F0DCD2CC92FC5F34BDD53AA1586D5F8B" xlink:type="locator" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_LiabilityForClaimsAndClaimsAdjustmentExpenseTable" xlink:label="loc_us-gaap_LiabilityForClaimsAndClaimsAdjustmentExpenseTable_BFD4A5FE05757F9D736E3AA1586A4199" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_LiabilityForClaimsAndClaimsAdjustmentExpenseLineItems_F0DCD2CC92FC5F34BDD53AA1586D5F8B" xlink:to="loc_us-gaap_LiabilityForClaimsAndClaimsAdjustmentExpenseTable_BFD4A5FE05757F9D736E3AA1586A4199" xlink:type="arc" xbrldt:closed="true" xbrldt:contextElement="segment" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ReinsurancePolicyTypeAxis" xlink:label="loc_us-gaap_ReinsurancePolicyTypeAxis_02EB5970BAE263CA95843AA1586BB790" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_LiabilityForClaimsAndClaimsAdjustmentExpenseTable_BFD4A5FE05757F9D736E3AA1586A4199" xlink:to="loc_us-gaap_ReinsurancePolicyTypeAxis_02EB5970BAE263CA95843AA1586BB790" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ReinsurancePolicyDomain" xlink:label="loc_us-gaap_ReinsurancePolicyDomain_730E2026E322B7AE1DD63AA1586BC281_default" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_ReinsurancePolicyTypeAxis_02EB5970BAE263CA95843AA1586BB790" xlink:to="loc_us-gaap_ReinsurancePolicyDomain_730E2026E322B7AE1DD63AA1586BC281_default" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ReinsurancePolicyDomain" xlink:label="loc_us-gaap_ReinsurancePolicyDomain_730E2026E322B7AE1DD63AA1586BC281" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_ReinsurancePolicyTypeAxis_02EB5970BAE263CA95843AA1586BB790" xlink:to="loc_us-gaap_ReinsurancePolicyDomain_730E2026E322B7AE1DD63AA1586BC281" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_TwoThousandSixteenQSRTransactionMember" xlink:label="loc_nmih_TwoThousandSixteenQSRTransactionMember_768FCED1EEEE722383FD3AA1586BA02D" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ReinsurancePolicyDomain_730E2026E322B7AE1DD63AA1586BC281" xlink:to="loc_nmih_TwoThousandSixteenQSRTransactionMember_768FCED1EEEE722383FD3AA1586BA02D" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_CounterpartyNameAxis" xlink:label="loc_srt_CounterpartyNameAxis_9F7D4194CD558F3DD4073AA1586C492E" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_LiabilityForClaimsAndClaimsAdjustmentExpenseTable_BFD4A5FE05757F9D736E3AA1586A4199" xlink:to="loc_srt_CounterpartyNameAxis_9F7D4194CD558F3DD4073AA1586C492E" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_RepurchaseAgreementCounterpartyNameDomain" xlink:label="loc_srt_RepurchaseAgreementCounterpartyNameDomain_DB8EF20F40514256FBAF3AA1586CD2C5_default" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_CounterpartyNameAxis_9F7D4194CD558F3DD4073AA1586C492E" xlink:to="loc_srt_RepurchaseAgreementCounterpartyNameDomain_DB8EF20F40514256FBAF3AA1586CD2C5_default" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_RepurchaseAgreementCounterpartyNameDomain" xlink:label="loc_srt_RepurchaseAgreementCounterpartyNameDomain_DB8EF20F40514256FBAF3AA1586CD2C5" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_CounterpartyNameAxis_9F7D4194CD558F3DD4073AA1586C492E" xlink:to="loc_srt_RepurchaseAgreementCounterpartyNameDomain_DB8EF20F40514256FBAF3AA1586CD2C5" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_FannieMaeMember" xlink:label="loc_nmih_FannieMaeMember_46E05F42CDFEDA26CC743AA1586C5EE9" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RepurchaseAgreementCounterpartyNameDomain_DB8EF20F40514256FBAF3AA1586CD2C5" xlink:to="loc_nmih_FannieMaeMember_46E05F42CDFEDA26CC743AA1586C5EE9" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_LiabilityforUnpaidClaimsandClaimsAdjustmentExpenseIncurredbutNotReportedIBNRClaimsDefaultPeriod" xlink:label="loc_nmih_LiabilityforUnpaidClaimsandClaimsAdjustmentExpenseIncurredbutNotReportedIBNRClaimsDefaultPeriod_6059B15F39B904C535D73AA1586D537C" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LiabilityForClaimsAndClaimsAdjustmentExpenseLineItems_F0DCD2CC92FC5F34BDD53AA1586D5F8B" xlink:to="loc_nmih_LiabilityforUnpaidClaimsandClaimsAdjustmentExpenseIncurredbutNotReportedIBNRClaimsDefaultPeriod_6059B15F39B904C535D73AA1586D537C" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_LiabilityForClaimsAndClaimsAdjustmentExpense" xlink:label="loc_us-gaap_LiabilityForClaimsAndClaimsAdjustmentExpense_E05E971DC952925403AF3AA1586D7CD1" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LiabilityForClaimsAndClaimsAdjustmentExpenseLineItems_F0DCD2CC92FC5F34BDD53AA1586D5F8B" xlink:to="loc_us-gaap_LiabilityForClaimsAndClaimsAdjustmentExpense_E05E971DC952925403AF3AA1586D7CD1" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_LiabilityforUnpaidClaimsandClaimsAdjustmentExpenseIncurredbutNotReportedIBNRClaimsNumberofPrimaryLoansinDefault" xlink:label="loc_nmih_LiabilityforUnpaidClaimsandClaimsAdjustmentExpenseIncurredbutNotReportedIBNRClaimsNumberofPrimaryLoansinDefault_B0CA4E59B7B4E6B942063AA1586D5776" xlink:type="locator" />
    <link:definitionArc order="3" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LiabilityForClaimsAndClaimsAdjustmentExpenseLineItems_F0DCD2CC92FC5F34BDD53AA1586D5F8B" xlink:to="loc_nmih_LiabilityforUnpaidClaimsandClaimsAdjustmentExpenseIncurredbutNotReportedIBNRClaimsNumberofPrimaryLoansinDefault_B0CA4E59B7B4E6B942063AA1586D5776" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_LiabilityforPaidClaimsandClaimsAdjustmentExpenseNumberofPaidClaims" xlink:label="loc_nmih_LiabilityforPaidClaimsandClaimsAdjustmentExpenseNumberofPaidClaims_195F62640DEB1E6898BF3AA1586EDDE0" xlink:type="locator" />
    <link:definitionArc order="4" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LiabilityForClaimsAndClaimsAdjustmentExpenseLineItems_F0DCD2CC92FC5F34BDD53AA1586D5F8B" xlink:to="loc_nmih_LiabilityforPaidClaimsandClaimsAdjustmentExpenseNumberofPaidClaims_195F62640DEB1E6898BF3AA1586EDDE0" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_LiabilityforUnpaidClaimsandClaimsAdjustmentExpenseClaimsPaidIncludingAmountsCoveredByInsurance" xlink:label="loc_nmih_LiabilityforUnpaidClaimsandClaimsAdjustmentExpenseClaimsPaidIncludingAmountsCoveredByInsurance_13842205CD4E0633D4F73AA1586E5B59" xlink:type="locator" />
    <link:definitionArc order="5" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LiabilityForClaimsAndClaimsAdjustmentExpenseLineItems_F0DCD2CC92FC5F34BDD53AA1586D5F8B" xlink:to="loc_nmih_LiabilityforUnpaidClaimsandClaimsAdjustmentExpenseClaimsPaidIncludingAmountsCoveredByInsurance_13842205CD4E0633D4F73AA1586E5B59" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_LiabilityforPaidClaimsandClaimsAdjustmentExpenseNumberofCoveredClaimsIncludedInNumberofPaidClaims" xlink:label="loc_nmih_LiabilityforPaidClaimsandClaimsAdjustmentExpenseNumberofCoveredClaimsIncludedInNumberofPaidClaims_517FAAE6F6CF52D4AC8D3AA1586E129E" xlink:type="locator" />
    <link:definitionArc order="6" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LiabilityForClaimsAndClaimsAdjustmentExpenseLineItems_F0DCD2CC92FC5F34BDD53AA1586D5F8B" xlink:to="loc_nmih_LiabilityforPaidClaimsandClaimsAdjustmentExpenseNumberofCoveredClaimsIncludedInNumberofPaidClaims_517FAAE6F6CF52D4AC8D3AA1586E129E" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_LoansInPoolPastDue60DaysOrMoreNumberOfLoans" xlink:label="loc_nmih_LoansInPoolPastDue60DaysOrMoreNumberOfLoans_F6F529854A50FEB0F5C53AA1586E4AD7" xlink:type="locator" />
    <link:definitionArc order="7" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LiabilityForClaimsAndClaimsAdjustmentExpenseLineItems_F0DCD2CC92FC5F34BDD53AA1586D5F8B" xlink:to="loc_nmih_LoansInPoolPastDue60DaysOrMoreNumberOfLoans_F6F529854A50FEB0F5C53AA1586E4AD7" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_LoansInPoolPastDue60DaysOrMoreLoanRiskinForce" xlink:label="loc_nmih_LoansInPoolPastDue60DaysOrMoreLoanRiskinForce_C713244821BAF8ADA12D3AA1586F7B90" xlink:type="locator" />
    <link:definitionArc order="8" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LiabilityForClaimsAndClaimsAdjustmentExpenseLineItems_F0DCD2CC92FC5F34BDD53AA1586D5F8B" xlink:to="loc_nmih_LoansInPoolPastDue60DaysOrMoreLoanRiskinForce_C713244821BAF8ADA12D3AA1586F7B90" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_LoansInPoolLoanToValueRatio" xlink:label="loc_nmih_LoansInPoolLoanToValueRatio_11A519BB38500668763B3AA1586F823E" xlink:type="locator" />
    <link:definitionArc order="9" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LiabilityForClaimsAndClaimsAdjustmentExpenseLineItems_F0DCD2CC92FC5F34BDD53AA1586D5F8B" xlink:to="loc_nmih_LoansInPoolLoanToValueRatio_11A519BB38500668763B3AA1586F823E" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_LiabilityforUnpaidClaimsandClaimsAdjustmentExpenseClaimsAppliedtoDeductible" xlink:label="loc_nmih_LiabilityforUnpaidClaimsandClaimsAdjustmentExpenseClaimsAppliedtoDeductible_27C2265BD84C49B5853E3AA1586FDE56" xlink:type="locator" />
    <link:definitionArc order="10" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LiabilityForClaimsAndClaimsAdjustmentExpenseLineItems_F0DCD2CC92FC5F34BDD53AA1586D5F8B" xlink:to="loc_nmih_LiabilityforUnpaidClaimsandClaimsAdjustmentExpenseClaimsAppliedtoDeductible_27C2265BD84C49B5853E3AA1586FDE56" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_MortgagePoolInsuranceClaimDeductible" xlink:label="loc_nmih_MortgagePoolInsuranceClaimDeductible_38B43C1EAB8EA38537CB3AA1586F9B56" xlink:type="locator" />
    <link:definitionArc order="11" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LiabilityForClaimsAndClaimsAdjustmentExpenseLineItems_F0DCD2CC92FC5F34BDD53AA1586D5F8B" xlink:to="loc_nmih_MortgagePoolInsuranceClaimDeductible_38B43C1EAB8EA38537CB3AA1586F9B56" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ReinsuranceRetentionPolicyReinsuredRiskPercentage" xlink:label="loc_us-gaap_ReinsuranceRetentionPolicyReinsuredRiskPercentage_887EE022FD61A47FB3DB3AA1586FE57C" xlink:type="locator" />
    <link:definitionArc order="12" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LiabilityForClaimsAndClaimsAdjustmentExpenseLineItems_F0DCD2CC92FC5F34BDD53AA1586D5F8B" xlink:to="loc_us-gaap_ReinsuranceRetentionPolicyReinsuredRiskPercentage_887EE022FD61A47FB3DB3AA1586FE57C" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_SupplementalInformationForPropertyCasualtyInsuranceUnderwritersPriorYearClaimsAndClaimsAdjustmentExpense" xlink:label="loc_us-gaap_SupplementalInformationForPropertyCasualtyInsuranceUnderwritersPriorYearClaimsAndClaimsAdjustmentExpense_9104CD43C0809E7CBEB63AA1587067C6" xlink:type="locator" />
    <link:definitionArc order="13" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LiabilityForClaimsAndClaimsAdjustmentExpenseLineItems_F0DCD2CC92FC5F34BDD53AA1586D5F8B" xlink:to="loc_us-gaap_SupplementalInformationForPropertyCasualtyInsuranceUnderwritersPriorYearClaimsAndClaimsAdjustmentExpense_9104CD43C0809E7CBEB63AA1587067C6" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_LiabilityforPriorYearClaimsandClaimsAdjustmentExpense" xlink:label="loc_nmih_LiabilityforPriorYearClaimsandClaimsAdjustmentExpense_1B560D8021556CBC2B223AA15870215A" xlink:type="locator" />
    <link:definitionArc order="14" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LiabilityForClaimsAndClaimsAdjustmentExpenseLineItems_F0DCD2CC92FC5F34BDD53AA1586D5F8B" xlink:to="loc_nmih_LiabilityforPriorYearClaimsandClaimsAdjustmentExpense_1B560D8021556CBC2B223AA15870215A" xlink:type="arc" />
  </link:definitionLink>
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/ReservesForInsuranceClaimsAndClaimExpensesReconciliationOfDisclosureOfIncurredAndPaidClaimsDevelopmentToLiabilityForUnpaidClaimsAndClaimsAdjustmentExpensesDetails" xlink:type="extended">
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ShortdurationInsuranceContractsReconciliationOfClaimsDevelopmentToLiabilityLineItems" xlink:label="loc_us-gaap_ShortdurationInsuranceContractsReconciliationOfClaimsDevelopmentToLiabilityLineItems_F9ACBCF36D1BF88187C33AA158091EDF" xlink:type="locator" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ShortdurationInsuranceContractsReconciliationOfClaimsDevelopmentToLiabilityTable" xlink:label="loc_us-gaap_ShortdurationInsuranceContractsReconciliationOfClaimsDevelopmentToLiabilityTable_751E9EBA2DF4FE64EDE63AA15807FF1D" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_ShortdurationInsuranceContractsReconciliationOfClaimsDevelopmentToLiabilityLineItems_F9ACBCF36D1BF88187C33AA158091EDF" xlink:to="loc_us-gaap_ShortdurationInsuranceContractsReconciliationOfClaimsDevelopmentToLiabilityTable_751E9EBA2DF4FE64EDE63AA15807FF1D" xlink:type="arc" xbrldt:closed="true" xbrldt:contextElement="segment" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_ProductOrServiceAxis" xlink:label="loc_srt_ProductOrServiceAxis_39CFF06B8575A824E4FD3AA15807D891" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ShortdurationInsuranceContractsReconciliationOfClaimsDevelopmentToLiabilityTable_751E9EBA2DF4FE64EDE63AA15807FF1D" xlink:to="loc_srt_ProductOrServiceAxis_39CFF06B8575A824E4FD3AA15807D891" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_ProductsAndServicesDomain" xlink:label="loc_srt_ProductsAndServicesDomain_6A1FCCCE99589810A43D3AA15808CFAC_default" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_ProductOrServiceAxis_39CFF06B8575A824E4FD3AA15807D891" xlink:to="loc_srt_ProductsAndServicesDomain_6A1FCCCE99589810A43D3AA15808CFAC_default" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_ProductsAndServicesDomain" xlink:label="loc_srt_ProductsAndServicesDomain_6A1FCCCE99589810A43D3AA15808CFAC" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_ProductOrServiceAxis_39CFF06B8575A824E4FD3AA15807D891" xlink:to="loc_srt_ProductsAndServicesDomain_6A1FCCCE99589810A43D3AA15808CFAC" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_FinancialGuaranteeInsuranceSegmentMember" xlink:label="loc_us-gaap_FinancialGuaranteeInsuranceSegmentMember_2CFC3658020FFA93B5563AA158084D85" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_ProductsAndServicesDomain_6A1FCCCE99589810A43D3AA15808CFAC" xlink:to="loc_us-gaap_FinancialGuaranteeInsuranceSegmentMember_2CFC3658020FFA93B5563AA158084D85" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ShortdurationInsuranceContractsIncurredClaimsAndAllocatedClaimAdjustmentExpenseNet" xlink:label="loc_us-gaap_ShortdurationInsuranceContractsIncurredClaimsAndAllocatedClaimAdjustmentExpenseNet_4577F8301E650EB1D2873AA1580943E9" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShortdurationInsuranceContractsReconciliationOfClaimsDevelopmentToLiabilityLineItems_F9ACBCF36D1BF88187C33AA158091EDF" xlink:to="loc_us-gaap_ShortdurationInsuranceContractsIncurredClaimsAndAllocatedClaimAdjustmentExpenseNet_4577F8301E650EB1D2873AA1580943E9" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ShortdurationInsuranceContractsCumulativePaidClaimsAndAllocatedClaimAdjustmentExpenseNet" xlink:label="loc_us-gaap_ShortdurationInsuranceContractsCumulativePaidClaimsAndAllocatedClaimAdjustmentExpenseNet_95CBCEBC4AD6B1543CCD3AA158097146" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShortdurationInsuranceContractsReconciliationOfClaimsDevelopmentToLiabilityLineItems_F9ACBCF36D1BF88187C33AA158091EDF" xlink:to="loc_us-gaap_ShortdurationInsuranceContractsCumulativePaidClaimsAndAllocatedClaimAdjustmentExpenseNet_95CBCEBC4AD6B1543CCD3AA158097146" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ShortdurationInsuranceContractsLiabilityForUnpaidClaimsAndAllocatedClaimAdjustmentExpenseNet" xlink:label="loc_us-gaap_ShortdurationInsuranceContractsLiabilityForUnpaidClaimsAndAllocatedClaimAdjustmentExpenseNet_DC7FFDE1061EB83590983AA15809F547" xlink:type="locator" />
    <link:definitionArc order="3" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShortdurationInsuranceContractsReconciliationOfClaimsDevelopmentToLiabilityLineItems_F9ACBCF36D1BF88187C33AA158091EDF" xlink:to="loc_us-gaap_ShortdurationInsuranceContractsLiabilityForUnpaidClaimsAndAllocatedClaimAdjustmentExpenseNet_DC7FFDE1061EB83590983AA15809F547" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ReinsuranceRecoverablesOnPaidAndUnpaidLosses" xlink:label="loc_us-gaap_ReinsuranceRecoverablesOnPaidAndUnpaidLosses_B4E477092F5E99FE2E6D3AA1580A10AC" xlink:type="locator" />
    <link:definitionArc order="4" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShortdurationInsuranceContractsReconciliationOfClaimsDevelopmentToLiabilityLineItems_F9ACBCF36D1BF88187C33AA158091EDF" xlink:to="loc_us-gaap_ReinsuranceRecoverablesOnPaidAndUnpaidLosses_B4E477092F5E99FE2E6D3AA1580A10AC" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ShortdurationInsuranceContractsLiabilityForUnpaidClaimsAndClaimsAdjustmentExpenseAccumulatedUnallocatedClaimAdjustmentExpense" xlink:label="loc_us-gaap_ShortdurationInsuranceContractsLiabilityForUnpaidClaimsAndClaimsAdjustmentExpenseAccumulatedUnallocatedClaimAdjustmentExpense_678B62926DC68065AC133AA1580A9674" xlink:type="locator" />
    <link:definitionArc order="5" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShortdurationInsuranceContractsReconciliationOfClaimsDevelopmentToLiabilityLineItems_F9ACBCF36D1BF88187C33AA158091EDF" xlink:to="loc_us-gaap_ShortdurationInsuranceContractsLiabilityForUnpaidClaimsAndClaimsAdjustmentExpenseAccumulatedUnallocatedClaimAdjustmentExpense_678B62926DC68065AC133AA1580A9674" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_LiabilityForClaimsAndClaimsAdjustmentExpense" xlink:label="loc_us-gaap_LiabilityForClaimsAndClaimsAdjustmentExpense_DAEC78898AECEF0A93633AA1580B763E" xlink:type="locator" />
    <link:definitionArc order="6" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShortdurationInsuranceContractsReconciliationOfClaimsDevelopmentToLiabilityLineItems_F9ACBCF36D1BF88187C33AA158091EDF" xlink:to="loc_us-gaap_LiabilityForClaimsAndClaimsAdjustmentExpense_DAEC78898AECEF0A93633AA1580B763E" xlink:type="arc" />
  </link:definitionLink>
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/ReservesForInsuranceClaimsAndClaimExpensesReconciliationOfReserveBalancesForInsuranceClaimsExpensesDetails" xlink:type="extended" />
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/ReservesForInsuranceClaimsAndClaimExpensesTables" xlink:type="extended" />
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/ScheduleISummaryOfInvestmentsOtherThanInvestmentsInRelatedParties" xlink:type="extended" />
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/ScheduleISummaryOfInvestmentsOtherThanInvestmentsInRelatedPartiesDetails" xlink:type="extended">
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_SummaryOfInvestmentsOtherThanInvestmentsInRelatedPartiesReportableDataLineItems" xlink:label="loc_srt_SummaryOfInvestmentsOtherThanInvestmentsInRelatedPartiesReportableDataLineItems_DE3275F6866BD250383C3B290ACED55B" xlink:type="locator" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_SummaryOfInvestmentsOtherThanInvestmentsInRelatedPartiesTable" xlink:label="loc_srt_SummaryOfInvestmentsOtherThanInvestmentsInRelatedPartiesTable_1A9DE70DB371790677523B290ACC8628" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_srt_SummaryOfInvestmentsOtherThanInvestmentsInRelatedPartiesReportableDataLineItems_DE3275F6866BD250383C3B290ACED55B" xlink:to="loc_srt_SummaryOfInvestmentsOtherThanInvestmentsInRelatedPartiesTable_1A9DE70DB371790677523B290ACC8628" xlink:type="arc" xbrldt:closed="true" xbrldt:contextElement="segment" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_FinancialInstrumentAxis" xlink:label="loc_us-gaap_FinancialInstrumentAxis_4583464C57D7FE1B12AF3B290ACDDFB8" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_srt_SummaryOfInvestmentsOtherThanInvestmentsInRelatedPartiesTable_1A9DE70DB371790677523B290ACC8628" xlink:to="loc_us-gaap_FinancialInstrumentAxis_4583464C57D7FE1B12AF3B290ACDDFB8" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain" xlink:label="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_2E9DE82EEB8126AF1C4D3B290ACD41DB_default" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_FinancialInstrumentAxis_4583464C57D7FE1B12AF3B290ACDDFB8" xlink:to="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_2E9DE82EEB8126AF1C4D3B290ACD41DB_default" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain" xlink:label="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_2E9DE82EEB8126AF1C4D3B290ACD41DB" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_FinancialInstrumentAxis_4583464C57D7FE1B12AF3B290ACDDFB8" xlink:to="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_2E9DE82EEB8126AF1C4D3B290ACD41DB" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_USTreasuryAndGovernmentMember" xlink:label="loc_us-gaap_USTreasuryAndGovernmentMember_2B5D47FD79B9FF160C363B290ACD8718" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_2E9DE82EEB8126AF1C4D3B290ACD41DB" xlink:to="loc_us-gaap_USTreasuryAndGovernmentMember_2B5D47FD79B9FF160C363B290ACD8718" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_USStatesAndPoliticalSubdivisionsMember" xlink:label="loc_us-gaap_USStatesAndPoliticalSubdivisionsMember_4904B9440CAB269625D53B290ACE2A2E" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_2E9DE82EEB8126AF1C4D3B290ACD41DB" xlink:to="loc_us-gaap_USStatesAndPoliticalSubdivisionsMember_4904B9440CAB269625D53B290ACE2A2E" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_CorporateDebtSecuritiesMember" xlink:label="loc_us-gaap_CorporateDebtSecuritiesMember_70DD0279C875A929CE793B290ACEB4B9" xlink:type="locator" />
    <link:definitionArc order="3" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_2E9DE82EEB8126AF1C4D3B290ACD41DB" xlink:to="loc_us-gaap_CorporateDebtSecuritiesMember_70DD0279C875A929CE793B290ACEB4B9" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_AssetBackedSecuritiesMember" xlink:label="loc_us-gaap_AssetBackedSecuritiesMember_F4721CDBD11D117427BF3B290ACED8C8" xlink:type="locator" />
    <link:definitionArc order="4" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_2E9DE82EEB8126AF1C4D3B290ACD41DB" xlink:to="loc_us-gaap_AssetBackedSecuritiesMember_F4721CDBD11D117427BF3B290ACED8C8" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_BondsMember" xlink:label="loc_us-gaap_BondsMember_33080F7E1819E25000613B290ACECC91" xlink:type="locator" />
    <link:definitionArc order="5" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_2E9DE82EEB8126AF1C4D3B290ACD41DB" xlink:to="loc_us-gaap_BondsMember_33080F7E1819E25000613B290ACECC91" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ShortTermInvestmentsMember" xlink:label="loc_us-gaap_ShortTermInvestmentsMember_5BA79BC0EF42F16936003B290ACE9B0E" xlink:type="locator" />
    <link:definitionArc order="6" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TransfersAndServicingOfFinancialInstrumentsTypesOfFinancialInstrumentsDomain_2E9DE82EEB8126AF1C4D3B290ACD41DB" xlink:to="loc_us-gaap_ShortTermInvestmentsMember_5BA79BC0EF42F16936003B290ACE9B0E" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_SummaryOfInvestmentsOtherThanInvestmentsInRelatedPartiesCost" xlink:label="loc_us-gaap_SummaryOfInvestmentsOtherThanInvestmentsInRelatedPartiesCost_D048205D6EF2C45FA6BE3B290ACEA641" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_SummaryOfInvestmentsOtherThanInvestmentsInRelatedPartiesReportableDataLineItems_DE3275F6866BD250383C3B290ACED55B" xlink:to="loc_us-gaap_SummaryOfInvestmentsOtherThanInvestmentsInRelatedPartiesCost_D048205D6EF2C45FA6BE3B290ACEA641" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_SummaryOfInvestmentsOtherThanInvestmentsInRelatedPartiesFairValue" xlink:label="loc_us-gaap_SummaryOfInvestmentsOtherThanInvestmentsInRelatedPartiesFairValue_89508AB251CAEE4F07853B290AD48409" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_SummaryOfInvestmentsOtherThanInvestmentsInRelatedPartiesReportableDataLineItems_DE3275F6866BD250383C3B290ACED55B" xlink:to="loc_us-gaap_SummaryOfInvestmentsOtherThanInvestmentsInRelatedPartiesFairValue_89508AB251CAEE4F07853B290AD48409" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_SummaryOfInvestmentsOtherThanInvestmentsInRelatedPartiesCarryingAmount" xlink:label="loc_us-gaap_SummaryOfInvestmentsOtherThanInvestmentsInRelatedPartiesCarryingAmount_6080C814B93D83D58B533B290AD4E195" xlink:type="locator" />
    <link:definitionArc order="3" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_SummaryOfInvestmentsOtherThanInvestmentsInRelatedPartiesReportableDataLineItems_DE3275F6866BD250383C3B290ACED55B" xlink:to="loc_us-gaap_SummaryOfInvestmentsOtherThanInvestmentsInRelatedPartiesCarryingAmount_6080C814B93D83D58B533B290AD4E195" xlink:type="arc" />
  </link:definitionLink>
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/ScheduleIiFinancialInformationOfRegistrantParentCompanyOnly" xlink:type="extended" />
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/ScheduleIiFinancialInformationOfRegistrantParentCompanyOnlyBalanceSheetsAdditionalInformationParentCompanyOnlyDetails" xlink:type="extended">
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_CondensedBalanceSheetStatementsCaptionsLineItems" xlink:label="loc_srt_CondensedBalanceSheetStatementsCaptionsLineItems_DF6204327CF570E84A6D3B30344FC4A8" xlink:type="locator" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_CondensedBalanceSheetStatementTable" xlink:label="loc_srt_CondensedBalanceSheetStatementTable_3E5EEFD39CBCE1E160973B3034484329" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_srt_CondensedBalanceSheetStatementsCaptionsLineItems_DF6204327CF570E84A6D3B30344FC4A8" xlink:to="loc_srt_CondensedBalanceSheetStatementTable_3E5EEFD39CBCE1E160973B3034484329" xlink:type="arc" xbrldt:closed="true" xbrldt:contextElement="segment" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_ConsolidatedEntitiesAxis" xlink:label="loc_srt_ConsolidatedEntitiesAxis_5136DD825A8A265AD94D3B290A98A817" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_srt_CondensedBalanceSheetStatementTable_3E5EEFD39CBCE1E160973B3034484329" xlink:to="loc_srt_ConsolidatedEntitiesAxis_5136DD825A8A265AD94D3B290A98A817" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_ConsolidatedEntitiesDomain" xlink:label="loc_srt_ConsolidatedEntitiesDomain_5C0E2A4E0FA32192BE5C3B290A986EDE_default" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_ConsolidatedEntitiesAxis_5136DD825A8A265AD94D3B290A98A817" xlink:to="loc_srt_ConsolidatedEntitiesDomain_5C0E2A4E0FA32192BE5C3B290A986EDE_default" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_ConsolidatedEntitiesDomain" xlink:label="loc_srt_ConsolidatedEntitiesDomain_5C0E2A4E0FA32192BE5C3B290A986EDE" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_ConsolidatedEntitiesAxis_5136DD825A8A265AD94D3B290A98A817" xlink:to="loc_srt_ConsolidatedEntitiesDomain_5C0E2A4E0FA32192BE5C3B290A986EDE" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_ParentCompanyMember" xlink:label="loc_srt_ParentCompanyMember_65C9A655C134B7D69B3D3B290A98EE78" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_ConsolidatedEntitiesDomain_5C0E2A4E0FA32192BE5C3B290A986EDE" xlink:to="loc_srt_ParentCompanyMember_65C9A655C134B7D69B3D3B290A98EE78" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_CommonStockParOrStatedValuePerShare" xlink:label="loc_us-gaap_CommonStockParOrStatedValuePerShare_7BDA9331D0B432D751053B290A995019" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_CondensedBalanceSheetStatementsCaptionsLineItems_DF6204327CF570E84A6D3B30344FC4A8" xlink:to="loc_us-gaap_CommonStockParOrStatedValuePerShare_7BDA9331D0B432D751053B290A995019" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_CommonStockSharesIssued" xlink:label="loc_us-gaap_CommonStockSharesIssued_903B764364F74ABB89273B290A992987" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_CondensedBalanceSheetStatementsCaptionsLineItems_DF6204327CF570E84A6D3B30344FC4A8" xlink:to="loc_us-gaap_CommonStockSharesIssued_903B764364F74ABB89273B290A992987" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_CommonStockSharesOutstanding" xlink:label="loc_us-gaap_CommonStockSharesOutstanding_F7F958E897DD469E7A0A3B290A99158E" xlink:type="locator" />
    <link:definitionArc order="3" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_CondensedBalanceSheetStatementsCaptionsLineItems_DF6204327CF570E84A6D3B30344FC4A8" xlink:to="loc_us-gaap_CommonStockSharesOutstanding_F7F958E897DD469E7A0A3B290A99158E" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_CommonStockSharesAuthorized" xlink:label="loc_us-gaap_CommonStockSharesAuthorized_38FD6DF437B95BB669313B290A99BDC3" xlink:type="locator" />
    <link:definitionArc order="4" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_CondensedBalanceSheetStatementsCaptionsLineItems_DF6204327CF570E84A6D3B30344FC4A8" xlink:to="loc_us-gaap_CommonStockSharesAuthorized_38FD6DF437B95BB669313B290A99BDC3" xlink:type="arc" />
  </link:definitionLink>
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/ScheduleIiFinancialInformationOfRegistrantParentCompanyOnlyBalanceSheetsParentCompanyOnlyDetails" xlink:type="extended">
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_CondensedBalanceSheetStatementsCaptionsLineItems" xlink:label="loc_srt_CondensedBalanceSheetStatementsCaptionsLineItems_70256A0417E6AD2101FB3AA1561B4468" xlink:type="locator" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_CondensedBalanceSheetStatementTable" xlink:label="loc_srt_CondensedBalanceSheetStatementTable_4949D43306F07ECC13E33AA1561ADF3A" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_srt_CondensedBalanceSheetStatementsCaptionsLineItems_70256A0417E6AD2101FB3AA1561B4468" xlink:to="loc_srt_CondensedBalanceSheetStatementTable_4949D43306F07ECC13E33AA1561ADF3A" xlink:type="arc" xbrldt:closed="true" xbrldt:contextElement="segment" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_ConsolidatedEntitiesAxis" xlink:label="loc_srt_ConsolidatedEntitiesAxis_F1C543FB3B142352BA213AA1561A8CA4" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_srt_CondensedBalanceSheetStatementTable_4949D43306F07ECC13E33AA1561ADF3A" xlink:to="loc_srt_ConsolidatedEntitiesAxis_F1C543FB3B142352BA213AA1561A8CA4" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_ConsolidatedEntitiesDomain" xlink:label="loc_srt_ConsolidatedEntitiesDomain_D0D45721937F119759F13AA1561BD630_default" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_ConsolidatedEntitiesAxis_F1C543FB3B142352BA213AA1561A8CA4" xlink:to="loc_srt_ConsolidatedEntitiesDomain_D0D45721937F119759F13AA1561BD630_default" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_ConsolidatedEntitiesDomain" xlink:label="loc_srt_ConsolidatedEntitiesDomain_D0D45721937F119759F13AA1561BD630" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_ConsolidatedEntitiesAxis_F1C543FB3B142352BA213AA1561A8CA4" xlink:to="loc_srt_ConsolidatedEntitiesDomain_D0D45721937F119759F13AA1561BD630" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_ParentCompanyMember" xlink:label="loc_srt_ParentCompanyMember_F186728C6E6351A5FF5D3AA1561BB64F" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_ConsolidatedEntitiesDomain_D0D45721937F119759F13AA1561BD630" xlink:to="loc_srt_ParentCompanyMember_F186728C6E6351A5FF5D3AA1561BB64F" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_AssetsAbstract" xlink:label="loc_us-gaap_AssetsAbstract_AC8E766472FA742276383AA1561C73E2" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_CondensedBalanceSheetStatementsCaptionsLineItems_70256A0417E6AD2101FB3AA1561B4468" xlink:to="loc_us-gaap_AssetsAbstract_AC8E766472FA742276383AA1561C73E2" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_AvailableForSaleSecuritiesDebtSecurities" xlink:label="loc_us-gaap_AvailableForSaleSecuritiesDebtSecurities_804311DF2FA42EE2620A3AA1561C8F49" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AssetsAbstract_AC8E766472FA742276383AA1561C73E2" xlink:to="loc_us-gaap_AvailableForSaleSecuritiesDebtSecurities_804311DF2FA42EE2620A3AA1561C8F49" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents" xlink:label="loc_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents_1BB7B49A2D9D02E078AE3AA1561C320C" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AssetsAbstract_AC8E766472FA742276383AA1561C73E2" xlink:to="loc_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents_1BB7B49A2D9D02E078AE3AA1561C320C" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_InvestmentsInAffiliatesSubsidiariesAssociatesAndJointVentures" xlink:label="loc_us-gaap_InvestmentsInAffiliatesSubsidiariesAssociatesAndJointVentures_80DE6A16F0A09FF4E7DB3AA1561D4394" xlink:type="locator" />
    <link:definitionArc order="3" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AssetsAbstract_AC8E766472FA742276383AA1561C73E2" xlink:to="loc_us-gaap_InvestmentsInAffiliatesSubsidiariesAssociatesAndJointVentures_80DE6A16F0A09FF4E7DB3AA1561D4394" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_AccruedInvestmentIncomeReceivable" xlink:label="loc_us-gaap_AccruedInvestmentIncomeReceivable_FD117CB062F998AB19A23AA1561DDC73" xlink:type="locator" />
    <link:definitionArc order="4" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AssetsAbstract_AC8E766472FA742276383AA1561C73E2" xlink:to="loc_us-gaap_AccruedInvestmentIncomeReceivable_FD117CB062F998AB19A23AA1561DDC73" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_PrepaidExpenseCurrentAndNoncurrent" xlink:label="loc_us-gaap_PrepaidExpenseCurrentAndNoncurrent_DEE0908C81DEF1C97EEA3AA1561D001E" xlink:type="locator" />
    <link:definitionArc order="5" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AssetsAbstract_AC8E766472FA742276383AA1561C73E2" xlink:to="loc_us-gaap_PrepaidExpenseCurrentAndNoncurrent_DEE0908C81DEF1C97EEA3AA1561D001E" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_DueFromAffiliates" xlink:label="loc_us-gaap_DueFromAffiliates_6D75FFB38E2A8F0D90F23AA1561DA022" xlink:type="locator" />
    <link:definitionArc order="6" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AssetsAbstract_AC8E766472FA742276383AA1561C73E2" xlink:to="loc_us-gaap_DueFromAffiliates_6D75FFB38E2A8F0D90F23AA1561DA022" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_PropertyPlantAndEquipmentNet" xlink:label="loc_us-gaap_PropertyPlantAndEquipmentNet_EB5DD78F7767ACE0805F3AA1561D2485" xlink:type="locator" />
    <link:definitionArc order="7" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AssetsAbstract_AC8E766472FA742276383AA1561C73E2" xlink:to="loc_us-gaap_PropertyPlantAndEquipmentNet_EB5DD78F7767ACE0805F3AA1561D2485" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_OtherAssets" xlink:label="loc_us-gaap_OtherAssets_9ECE4E9F242E66880DBB3AA1561EED3C" xlink:type="locator" />
    <link:definitionArc order="8" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AssetsAbstract_AC8E766472FA742276383AA1561C73E2" xlink:to="loc_us-gaap_OtherAssets_9ECE4E9F242E66880DBB3AA1561EED3C" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_Assets" xlink:label="loc_us-gaap_Assets_FA9CAC5D1F5F41FFA3BB3AA1561EB7D9" xlink:type="locator" />
    <link:definitionArc order="9" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AssetsAbstract_AC8E766472FA742276383AA1561C73E2" xlink:to="loc_us-gaap_Assets_FA9CAC5D1F5F41FFA3BB3AA1561EB7D9" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_LiabilitiesAbstract" xlink:label="loc_us-gaap_LiabilitiesAbstract_2057FF0CB6F411DAD03C3AA1561E4388" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_CondensedBalanceSheetStatementsCaptionsLineItems_70256A0417E6AD2101FB3AA1561B4468" xlink:to="loc_us-gaap_LiabilitiesAbstract_2057FF0CB6F411DAD03C3AA1561E4388" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_LongTermDebt" xlink:label="loc_us-gaap_LongTermDebt_21DC32D0FB8A92F5B6A03AA1561FD00C" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LiabilitiesAbstract_2057FF0CB6F411DAD03C3AA1561E4388" xlink:to="loc_us-gaap_LongTermDebt_21DC32D0FB8A92F5B6A03AA1561FD00C" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_AccountsPayableAndAccruedLiabilitiesCurrentAndNoncurrent" xlink:label="loc_us-gaap_AccountsPayableAndAccruedLiabilitiesCurrentAndNoncurrent_2D47BD6C61B87B14DABC3AA1561FD9D3" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LiabilitiesAbstract_2057FF0CB6F411DAD03C3AA1561E4388" xlink:to="loc_us-gaap_AccountsPayableAndAccruedLiabilitiesCurrentAndNoncurrent_2D47BD6C61B87B14DABC3AA1561FD9D3" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_WarrantsAndRightsOutstanding" xlink:label="loc_us-gaap_WarrantsAndRightsOutstanding_1580BAE2D4F3BFB835D03AA1561F0E2E" xlink:type="locator" />
    <link:definitionArc order="3" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LiabilitiesAbstract_2057FF0CB6F411DAD03C3AA1561E4388" xlink:to="loc_us-gaap_WarrantsAndRightsOutstanding_1580BAE2D4F3BFB835D03AA1561F0E2E" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_DeferredIncomeTaxLiabilitiesNet" xlink:label="loc_us-gaap_DeferredIncomeTaxLiabilitiesNet_FB7003E803E270D7BC663AA1561FE8F3" xlink:type="locator" />
    <link:definitionArc order="4" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LiabilitiesAbstract_2057FF0CB6F411DAD03C3AA1561E4388" xlink:to="loc_us-gaap_DeferredIncomeTaxLiabilitiesNet_FB7003E803E270D7BC663AA1561FE8F3" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_OtherLiabilities" xlink:label="loc_us-gaap_OtherLiabilities_BB2AF7820F9F7F36487F3AA1561FF7D7" xlink:type="locator" />
    <link:definitionArc order="5" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LiabilitiesAbstract_2057FF0CB6F411DAD03C3AA1561E4388" xlink:to="loc_us-gaap_OtherLiabilities_BB2AF7820F9F7F36487F3AA1561FF7D7" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_Liabilities" xlink:label="loc_us-gaap_Liabilities_04BBECA6FC8474CF9F063AA1562096C1" xlink:type="locator" />
    <link:definitionArc order="6" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_LiabilitiesAbstract_2057FF0CB6F411DAD03C3AA1561E4388" xlink:to="loc_us-gaap_Liabilities_04BBECA6FC8474CF9F063AA1562096C1" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_EquityAbstract" xlink:label="loc_us-gaap_EquityAbstract_00BB2CFD28D42351373A3AA156202589" xlink:type="locator" />
    <link:definitionArc order="3" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_CondensedBalanceSheetStatementsCaptionsLineItems_70256A0417E6AD2101FB3AA1561B4468" xlink:to="loc_us-gaap_EquityAbstract_00BB2CFD28D42351373A3AA156202589" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_CommonStockValueOutstanding" xlink:label="loc_us-gaap_CommonStockValueOutstanding_2EAEDEA82CB358664F043AA15620E24D" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquityAbstract_00BB2CFD28D42351373A3AA156202589" xlink:to="loc_us-gaap_CommonStockValueOutstanding_2EAEDEA82CB358664F043AA15620E24D" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_AdditionalPaidInCapital" xlink:label="loc_us-gaap_AdditionalPaidInCapital_93F041F0544500B621D03AA15621CB42" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquityAbstract_00BB2CFD28D42351373A3AA156202589" xlink:to="loc_us-gaap_AdditionalPaidInCapital_93F041F0544500B621D03AA15621CB42" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_AccumulatedOtherComprehensiveIncomeLossNetOfTax" xlink:label="loc_us-gaap_AccumulatedOtherComprehensiveIncomeLossNetOfTax_9F9D3365637A13D6CF243AA156213292" xlink:type="locator" />
    <link:definitionArc order="3" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquityAbstract_00BB2CFD28D42351373A3AA156202589" xlink:to="loc_us-gaap_AccumulatedOtherComprehensiveIncomeLossNetOfTax_9F9D3365637A13D6CF243AA156213292" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_RetainedEarningsAccumulatedDeficit" xlink:label="loc_us-gaap_RetainedEarningsAccumulatedDeficit_6A30724110077C32BCC23AA15621161F" xlink:type="locator" />
    <link:definitionArc order="4" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquityAbstract_00BB2CFD28D42351373A3AA156202589" xlink:to="loc_us-gaap_RetainedEarningsAccumulatedDeficit_6A30724110077C32BCC23AA15621161F" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_StockholdersEquity" xlink:label="loc_us-gaap_StockholdersEquity_157DCB10E3FBB2C648E43AA1562152E7" xlink:type="locator" />
    <link:definitionArc order="5" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_EquityAbstract_00BB2CFD28D42351373A3AA156202589" xlink:to="loc_us-gaap_StockholdersEquity_157DCB10E3FBB2C648E43AA1562152E7" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_LiabilitiesAndStockholdersEquity" xlink:label="loc_us-gaap_LiabilitiesAndStockholdersEquity_FFD8CDAC61FE6D80F4E73AA156217A5C" xlink:type="locator" />
    <link:definitionArc order="4" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_CondensedBalanceSheetStatementsCaptionsLineItems_70256A0417E6AD2101FB3AA1561B4468" xlink:to="loc_us-gaap_LiabilitiesAndStockholdersEquity_FFD8CDAC61FE6D80F4E73AA156217A5C" xlink:type="arc" />
  </link:definitionLink>
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/ScheduleIiFinancialInformationOfRegistrantParentCompanyOnlyStatementOfOperationsAdditionalInformationParentCompanyOnlyDetails" xlink:type="extended">
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_CondensedIncomeStatementsCaptionsLineItems" xlink:label="loc_srt_CondensedIncomeStatementsCaptionsLineItems_FCBFB0CDE000BF1D55AB3AA155F12615" xlink:type="locator" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_CondensedIncomeStatementTable" xlink:label="loc_srt_CondensedIncomeStatementTable_BC849D6102584E2CE9E33AA155EFECD7" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_srt_CondensedIncomeStatementsCaptionsLineItems_FCBFB0CDE000BF1D55AB3AA155F12615" xlink:to="loc_srt_CondensedIncomeStatementTable_BC849D6102584E2CE9E33AA155EFECD7" xlink:type="arc" xbrldt:closed="true" xbrldt:contextElement="segment" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_ConsolidatedEntitiesAxis" xlink:label="loc_srt_ConsolidatedEntitiesAxis_D91F6E94F838431C3E703AA155EF8D0F" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_srt_CondensedIncomeStatementTable_BC849D6102584E2CE9E33AA155EFECD7" xlink:to="loc_srt_ConsolidatedEntitiesAxis_D91F6E94F838431C3E703AA155EF8D0F" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_ConsolidatedEntitiesDomain" xlink:label="loc_srt_ConsolidatedEntitiesDomain_1ECFAA8C405123566F0A3AA155F038DA_default" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_ConsolidatedEntitiesAxis_D91F6E94F838431C3E703AA155EF8D0F" xlink:to="loc_srt_ConsolidatedEntitiesDomain_1ECFAA8C405123566F0A3AA155F038DA_default" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_ConsolidatedEntitiesDomain" xlink:label="loc_srt_ConsolidatedEntitiesDomain_1ECFAA8C405123566F0A3AA155F038DA" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_ConsolidatedEntitiesAxis_D91F6E94F838431C3E703AA155EF8D0F" xlink:to="loc_srt_ConsolidatedEntitiesDomain_1ECFAA8C405123566F0A3AA155F038DA" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_ParentCompanyMember" xlink:label="loc_srt_ParentCompanyMember_E8BE44E8EBC801A89F043AA155F0035D" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_ConsolidatedEntitiesDomain_1ECFAA8C405123566F0A3AA155F038DA" xlink:to="loc_srt_ParentCompanyMember_E8BE44E8EBC801A89F043AA155F0035D" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_OtherComprehensiveIncomeUnrealizedHoldingGainLossOnSecuritiesArisingDuringPeriodTax" xlink:label="loc_us-gaap_OtherComprehensiveIncomeUnrealizedHoldingGainLossOnSecuritiesArisingDuringPeriodTax_904D2A46E4C8B033521D3AA155F1BF06" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_CondensedIncomeStatementsCaptionsLineItems_FCBFB0CDE000BF1D55AB3AA155F12615" xlink:to="loc_us-gaap_OtherComprehensiveIncomeUnrealizedHoldingGainLossOnSecuritiesArisingDuringPeriodTax_904D2A46E4C8B033521D3AA155F1BF06" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_OtherComprehensiveIncomeLossReclassificationAdjustmentFromAOCIForSaleOfSecuritiesTax" xlink:label="loc_us-gaap_OtherComprehensiveIncomeLossReclassificationAdjustmentFromAOCIForSaleOfSecuritiesTax_5B61B206078D444AE98F3AA155F1F863" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_CondensedIncomeStatementsCaptionsLineItems_FCBFB0CDE000BF1D55AB3AA155F12615" xlink:to="loc_us-gaap_OtherComprehensiveIncomeLossReclassificationAdjustmentFromAOCIForSaleOfSecuritiesTax_5B61B206078D444AE98F3AA155F1F863" xlink:type="arc" />
  </link:definitionLink>
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/ScheduleIiFinancialInformationOfRegistrantParentCompanyOnlyStatementOfOperationsParentCompanyOnlyDetails" xlink:type="extended">
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_CondensedIncomeStatementsCaptionsLineItems" xlink:label="loc_srt_CondensedIncomeStatementsCaptionsLineItems_DA5B1320A41A391F5EFB3B290A85B35A" xlink:type="locator" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_CondensedIncomeStatementTable" xlink:label="loc_srt_CondensedIncomeStatementTable_A3EC26EB50EEBB9CBDAD3B290A830669" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_srt_CondensedIncomeStatementsCaptionsLineItems_DA5B1320A41A391F5EFB3B290A85B35A" xlink:to="loc_srt_CondensedIncomeStatementTable_A3EC26EB50EEBB9CBDAD3B290A830669" xlink:type="arc" xbrldt:closed="true" xbrldt:contextElement="segment" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_ConsolidatedEntitiesAxis" xlink:label="loc_srt_ConsolidatedEntitiesAxis_5D86914A4471A987E4A63B290A846106" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_srt_CondensedIncomeStatementTable_A3EC26EB50EEBB9CBDAD3B290A830669" xlink:to="loc_srt_ConsolidatedEntitiesAxis_5D86914A4471A987E4A63B290A846106" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_ConsolidatedEntitiesDomain" xlink:label="loc_srt_ConsolidatedEntitiesDomain_126E917BC1508D8EF2613B290A84B10D_default" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_ConsolidatedEntitiesAxis_5D86914A4471A987E4A63B290A846106" xlink:to="loc_srt_ConsolidatedEntitiesDomain_126E917BC1508D8EF2613B290A84B10D_default" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_ConsolidatedEntitiesDomain" xlink:label="loc_srt_ConsolidatedEntitiesDomain_126E917BC1508D8EF2613B290A84B10D" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_ConsolidatedEntitiesAxis_5D86914A4471A987E4A63B290A846106" xlink:to="loc_srt_ConsolidatedEntitiesDomain_126E917BC1508D8EF2613B290A84B10D" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_ParentCompanyMember" xlink:label="loc_srt_ParentCompanyMember_98C7905CCB20710BA4CC3B290A84D74C" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_ConsolidatedEntitiesDomain_126E917BC1508D8EF2613B290A84B10D" xlink:to="loc_srt_ParentCompanyMember_98C7905CCB20710BA4CC3B290A84D74C" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_RevenuesAbstract" xlink:label="loc_us-gaap_RevenuesAbstract_7D7284AC355A34F2B4203B290A85591D" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_CondensedIncomeStatementsCaptionsLineItems_DA5B1320A41A391F5EFB3B290A85B35A" xlink:to="loc_us-gaap_RevenuesAbstract_7D7284AC355A34F2B4203B290A85591D" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_NetInvestmentIncome" xlink:label="loc_us-gaap_NetInvestmentIncome_EE6EF11904512018655F3B290A850A3E" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_RevenuesAbstract_7D7284AC355A34F2B4203B290A85591D" xlink:to="loc_us-gaap_NetInvestmentIncome_EE6EF11904512018655F3B290A850A3E" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_GainLossOnInvestments" xlink:label="loc_us-gaap_GainLossOnInvestments_8BADD17CB1F85EDB7BC93B290A8526E3" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_RevenuesAbstract_7D7284AC355A34F2B4203B290A85591D" xlink:to="loc_us-gaap_GainLossOnInvestments_8BADD17CB1F85EDB7BC93B290A8526E3" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_Revenues" xlink:label="loc_us-gaap_Revenues_69E5F7AF9D6394A051D63B290A86F002" xlink:type="locator" />
    <link:definitionArc order="3" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_RevenuesAbstract_7D7284AC355A34F2B4203B290A85591D" xlink:to="loc_us-gaap_Revenues_69E5F7AF9D6394A051D63B290A86F002" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_CostsAndExpensesAbstract" xlink:label="loc_us-gaap_CostsAndExpensesAbstract_964FE79F802D1D2B84073B290A866928" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_CondensedIncomeStatementsCaptionsLineItems_DA5B1320A41A391F5EFB3B290A85B35A" xlink:to="loc_us-gaap_CostsAndExpensesAbstract_964FE79F802D1D2B84073B290A866928" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_OtherExpenses" xlink:label="loc_us-gaap_OtherExpenses_09C64A560462BC684BCA3B290A860E4E" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_CostsAndExpensesAbstract_964FE79F802D1D2B84073B290A866928" xlink:to="loc_us-gaap_OtherExpenses_09C64A560462BC684BCA3B290A860E4E" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_InterestExpense" xlink:label="loc_us-gaap_InterestExpense_A4A1E42C91F0C180A8673B290A861046" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_CostsAndExpensesAbstract_964FE79F802D1D2B84073B290A866928" xlink:to="loc_us-gaap_InterestExpense_A4A1E42C91F0C180A8673B290A861046" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_GainLossonChangeinFairValueofWarrantLiability" xlink:label="loc_nmih_GainLossonChangeinFairValueofWarrantLiability_A34670022D80455E282A3B290A86FF86" xlink:type="locator" />
    <link:definitionArc order="3" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_CostsAndExpensesAbstract_964FE79F802D1D2B84073B290A866928" xlink:to="loc_nmih_GainLossonChangeinFairValueofWarrantLiability_A34670022D80455E282A3B290A86FF86" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_CostsAndExpenses" xlink:label="loc_us-gaap_CostsAndExpenses_B279AB05E8FC2859789B3B290A868C15" xlink:type="locator" />
    <link:definitionArc order="4" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_CostsAndExpensesAbstract_964FE79F802D1D2B84073B290A866928" xlink:to="loc_us-gaap_CostsAndExpenses_B279AB05E8FC2859789B3B290A868C15" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_IncomeLossFromEquityMethodInvestments" xlink:label="loc_us-gaap_IncomeLossFromEquityMethodInvestments_7FDD2287A0D079E96DF93B290A8704E4" xlink:type="locator" />
    <link:definitionArc order="3" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_CondensedIncomeStatementsCaptionsLineItems_DA5B1320A41A391F5EFB3B290A85B35A" xlink:to="loc_us-gaap_IncomeLossFromEquityMethodInvestments_7FDD2287A0D079E96DF93B290A8704E4" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest" xlink:label="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest_600DFF289EF6D2A76BC93B290A871850" xlink:type="locator" />
    <link:definitionArc order="4" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_CondensedIncomeStatementsCaptionsLineItems_DA5B1320A41A391F5EFB3B290A85B35A" xlink:to="loc_us-gaap_IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest_600DFF289EF6D2A76BC93B290A871850" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_IncomeTaxExpenseBenefit" xlink:label="loc_us-gaap_IncomeTaxExpenseBenefit_C197B9E0023160DBF5E73B290A87BAFE" xlink:type="locator" />
    <link:definitionArc order="5" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_CondensedIncomeStatementsCaptionsLineItems_DA5B1320A41A391F5EFB3B290A85B35A" xlink:to="loc_us-gaap_IncomeTaxExpenseBenefit_C197B9E0023160DBF5E73B290A87BAFE" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_NetIncomeLoss" xlink:label="loc_us-gaap_NetIncomeLoss_DE9FFF3BCB908B6B6ED83B290A874B8A" xlink:type="locator" />
    <link:definitionArc order="6" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_CondensedIncomeStatementsCaptionsLineItems_DA5B1320A41A391F5EFB3B290A85B35A" xlink:to="loc_us-gaap_NetIncomeLoss_DE9FFF3BCB908B6B6ED83B290A874B8A" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_OtherComprehensiveIncomeLossNetOfTaxPeriodIncreaseDecreaseAbstract" xlink:label="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTaxPeriodIncreaseDecreaseAbstract_A04AEE72B6061802B51C3B290A875A85" xlink:type="locator" />
    <link:definitionArc order="7" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_CondensedIncomeStatementsCaptionsLineItems_DA5B1320A41A391F5EFB3B290A85B35A" xlink:to="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTaxPeriodIncreaseDecreaseAbstract_A04AEE72B6061802B51C3B290A875A85" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_OtherComprehensiveIncomeUnrealizedHoldingGainLossOnSecuritiesArisingDuringPeriodNetOfTax" xlink:label="loc_us-gaap_OtherComprehensiveIncomeUnrealizedHoldingGainLossOnSecuritiesArisingDuringPeriodNetOfTax_D89FAA4DDED55BD444253B290A878141" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTaxPeriodIncreaseDecreaseAbstract_A04AEE72B6061802B51C3B290A875A85" xlink:to="loc_us-gaap_OtherComprehensiveIncomeUnrealizedHoldingGainLossOnSecuritiesArisingDuringPeriodNetOfTax_D89FAA4DDED55BD444253B290A878141" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_OtherComprehensiveIncomeLossReclassificationAdjustmentFromAOCIForSaleOfSecuritiesNetOfTax" xlink:label="loc_us-gaap_OtherComprehensiveIncomeLossReclassificationAdjustmentFromAOCIForSaleOfSecuritiesNetOfTax_3EA454E95A5DFFB72DEC3B290A88B336" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTaxPeriodIncreaseDecreaseAbstract_A04AEE72B6061802B51C3B290A875A85" xlink:to="loc_us-gaap_OtherComprehensiveIncomeLossReclassificationAdjustmentFromAOCIForSaleOfSecuritiesNetOfTax_3EA454E95A5DFFB72DEC3B290A88B336" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_OtherComprehensiveIncomeLossNetofTaxPortionAttributabletoSubsidiary" xlink:label="loc_nmih_OtherComprehensiveIncomeLossNetofTaxPortionAttributabletoSubsidiary_A5F563744E2FED5833CB3B290A88DDC6" xlink:type="locator" />
    <link:definitionArc order="3" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTaxPeriodIncreaseDecreaseAbstract_A04AEE72B6061802B51C3B290A875A85" xlink:to="loc_nmih_OtherComprehensiveIncomeLossNetofTaxPortionAttributabletoSubsidiary_A5F563744E2FED5833CB3B290A88DDC6" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent" xlink:label="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent_960AD9134C5D8EF9BD6D3B290A889052" xlink:type="locator" />
    <link:definitionArc order="4" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTaxPeriodIncreaseDecreaseAbstract_A04AEE72B6061802B51C3B290A875A85" xlink:to="loc_us-gaap_OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent_960AD9134C5D8EF9BD6D3B290A889052" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ComprehensiveIncomeNetOfTax" xlink:label="loc_us-gaap_ComprehensiveIncomeNetOfTax_1D9FEBB03EB8EC9745FC3B290A886F3C" xlink:type="locator" />
    <link:definitionArc order="8" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_CondensedIncomeStatementsCaptionsLineItems_DA5B1320A41A391F5EFB3B290A85B35A" xlink:to="loc_us-gaap_ComprehensiveIncomeNetOfTax_1D9FEBB03EB8EC9745FC3B290A886F3C" xlink:type="arc" />
  </link:definitionLink>
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/ScheduleIiFinancialInformationOfRegistrantParentCompanyOnlyStatementsOfCashFlowsParentCompanyOnlyDetails" xlink:type="extended">
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_CondensedCashFlowStatementsCaptionsLineItems" xlink:label="loc_srt_CondensedCashFlowStatementsCaptionsLineItems_8EEE6A6B9BC5E1DEAC873B84429A1D2A" xlink:type="locator" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_CondensedCashFlowStatementTable" xlink:label="loc_srt_CondensedCashFlowStatementTable_69998FCFD59B1679649B3B8442981828" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_srt_CondensedCashFlowStatementsCaptionsLineItems_8EEE6A6B9BC5E1DEAC873B84429A1D2A" xlink:to="loc_srt_CondensedCashFlowStatementTable_69998FCFD59B1679649B3B8442981828" xlink:type="arc" xbrldt:closed="true" xbrldt:contextElement="segment" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_AdjustmentsForNewAccountingPronouncementsAxis" xlink:label="loc_us-gaap_AdjustmentsForNewAccountingPronouncementsAxis_4E6F48167716A035014B3B84429857AD" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_srt_CondensedCashFlowStatementTable_69998FCFD59B1679649B3B8442981828" xlink:to="loc_us-gaap_AdjustmentsForNewAccountingPronouncementsAxis_4E6F48167716A035014B3B84429857AD" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_TypeOfAdoptionMember" xlink:label="loc_us-gaap_TypeOfAdoptionMember_0170A32BC0C9686051173B8442989AB3_default" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_AdjustmentsForNewAccountingPronouncementsAxis_4E6F48167716A035014B3B84429857AD" xlink:to="loc_us-gaap_TypeOfAdoptionMember_0170A32BC0C9686051173B8442989AB3_default" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_TypeOfAdoptionMember" xlink:label="loc_us-gaap_TypeOfAdoptionMember_0170A32BC0C9686051173B8442989AB3" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_AdjustmentsForNewAccountingPronouncementsAxis_4E6F48167716A035014B3B84429857AD" xlink:to="loc_us-gaap_TypeOfAdoptionMember_0170A32BC0C9686051173B8442989AB3" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_AccountingStandardsUpdate201802Member" xlink:label="loc_us-gaap_AccountingStandardsUpdate201802Member_EB9B24D159CD3E5CB6323B8442980384" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TypeOfAdoptionMember_0170A32BC0C9686051173B8442989AB3" xlink:to="loc_us-gaap_AccountingStandardsUpdate201802Member_EB9B24D159CD3E5CB6323B8442980384" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_ConsolidatedEntitiesAxis" xlink:label="loc_srt_ConsolidatedEntitiesAxis_1D26FDC2FE6240DC1F5E3B844299CF7F" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_srt_CondensedCashFlowStatementTable_69998FCFD59B1679649B3B8442981828" xlink:to="loc_srt_ConsolidatedEntitiesAxis_1D26FDC2FE6240DC1F5E3B844299CF7F" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_ConsolidatedEntitiesDomain" xlink:label="loc_srt_ConsolidatedEntitiesDomain_73FBF4D732910A48D68E3B844299E5DC_default" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_ConsolidatedEntitiesAxis_1D26FDC2FE6240DC1F5E3B844299CF7F" xlink:to="loc_srt_ConsolidatedEntitiesDomain_73FBF4D732910A48D68E3B844299E5DC_default" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_ConsolidatedEntitiesDomain" xlink:label="loc_srt_ConsolidatedEntitiesDomain_73FBF4D732910A48D68E3B844299E5DC" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_ConsolidatedEntitiesAxis_1D26FDC2FE6240DC1F5E3B844299CF7F" xlink:to="loc_srt_ConsolidatedEntitiesDomain_73FBF4D732910A48D68E3B844299E5DC" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_ParentCompanyMember" xlink:label="loc_srt_ParentCompanyMember_399B38B80948B9F97E8A3B8442993583" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_ConsolidatedEntitiesDomain_73FBF4D732910A48D68E3B844299E5DC" xlink:to="loc_srt_ParentCompanyMember_399B38B80948B9F97E8A3B8442993583" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_NetCashProvidedByUsedInOperatingActivitiesAbstract" xlink:label="loc_us-gaap_NetCashProvidedByUsedInOperatingActivitiesAbstract_56692092180174B34A323B84429A19EF" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_CondensedCashFlowStatementsCaptionsLineItems_8EEE6A6B9BC5E1DEAC873B84429A1D2A" xlink:to="loc_us-gaap_NetCashProvidedByUsedInOperatingActivitiesAbstract_56692092180174B34A323B84429A19EF" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_NetIncomeLoss" xlink:label="loc_us-gaap_NetIncomeLoss_806A85A312D9FD4C76A73B84429AA179" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivitiesAbstract_56692092180174B34A323B84429A19EF" xlink:to="loc_us-gaap_NetIncomeLoss_806A85A312D9FD4C76A73B84429AA179" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_AdjustmentsToReconcileNetIncomeLossToCashProvidedByUsedInOperatingActivitiesAbstract" xlink:label="loc_us-gaap_AdjustmentsToReconcileNetIncomeLossToCashProvidedByUsedInOperatingActivitiesAbstract_B0F51B53BECB079E58853B84429B3D1E" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivitiesAbstract_56692092180174B34A323B84429A19EF" xlink:to="loc_us-gaap_AdjustmentsToReconcileNetIncomeLossToCashProvidedByUsedInOperatingActivitiesAbstract_B0F51B53BECB079E58853B84429B3D1E" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_FairValueAdjustmentOfWarrants" xlink:label="loc_us-gaap_FairValueAdjustmentOfWarrants_B41D630098A807AFCF8B3B84429BC826" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AdjustmentsToReconcileNetIncomeLossToCashProvidedByUsedInOperatingActivitiesAbstract_B0F51B53BECB079E58853B84429B3D1E" xlink:to="loc_us-gaap_FairValueAdjustmentOfWarrants_B41D630098A807AFCF8B3B84429BC826" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_DebtSecuritiesAvailableForSaleRealizedGainLoss" xlink:label="loc_us-gaap_DebtSecuritiesAvailableForSaleRealizedGainLoss_2E88C7162C8293D0B29A3B84429CFF2F" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AdjustmentsToReconcileNetIncomeLossToCashProvidedByUsedInOperatingActivitiesAbstract_B0F51B53BECB079E58853B84429B3D1E" xlink:to="loc_us-gaap_DebtSecuritiesAvailableForSaleRealizedGainLoss_2E88C7162C8293D0B29A3B84429CFF2F" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_DepreciationAmortizationAndAccretionNet" xlink:label="loc_us-gaap_DepreciationAmortizationAndAccretionNet_2E09EBD0E9B15FFE423B3B84429C3A8D" xlink:type="locator" />
    <link:definitionArc order="3" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AdjustmentsToReconcileNetIncomeLossToCashProvidedByUsedInOperatingActivitiesAbstract_B0F51B53BECB079E58853B84429B3D1E" xlink:to="loc_us-gaap_DepreciationAmortizationAndAccretionNet_2E09EBD0E9B15FFE423B3B84429C3A8D" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_AmortizationOfFinancingCostsAndDiscounts" xlink:label="loc_us-gaap_AmortizationOfFinancingCostsAndDiscounts_9D4498677B505171E68F3B84429CB127" xlink:type="locator" />
    <link:definitionArc order="4" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AdjustmentsToReconcileNetIncomeLossToCashProvidedByUsedInOperatingActivitiesAbstract_B0F51B53BECB079E58853B84429B3D1E" xlink:to="loc_us-gaap_AmortizationOfFinancingCostsAndDiscounts_9D4498677B505171E68F3B84429CB127" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_DeferredIncomeTaxesAndTaxCredits" xlink:label="loc_us-gaap_DeferredIncomeTaxesAndTaxCredits_9BDE86B98E39C6FB6ED23B84429D1C71" xlink:type="locator" />
    <link:definitionArc order="5" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AdjustmentsToReconcileNetIncomeLossToCashProvidedByUsedInOperatingActivitiesAbstract_B0F51B53BECB079E58853B84429B3D1E" xlink:to="loc_us-gaap_DeferredIncomeTaxesAndTaxCredits_9BDE86B98E39C6FB6ED23B84429D1C71" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ShareBasedCompensation" xlink:label="loc_us-gaap_ShareBasedCompensation_6D032177210A60D3FD443B84429D23F3" xlink:type="locator" />
    <link:definitionArc order="6" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AdjustmentsToReconcileNetIncomeLossToCashProvidedByUsedInOperatingActivitiesAbstract_B0F51B53BECB079E58853B84429B3D1E" xlink:to="loc_us-gaap_ShareBasedCompensation_6D032177210A60D3FD443B84429D23F3" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_IncreaseDecreaseInOtherOperatingAssetsAndLiabilitiesNetAbstract" xlink:label="loc_us-gaap_IncreaseDecreaseInOtherOperatingAssetsAndLiabilitiesNetAbstract_4D01D01362A4745F26B13B84429D1B43" xlink:type="locator" />
    <link:definitionArc order="7" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_AdjustmentsToReconcileNetIncomeLossToCashProvidedByUsedInOperatingActivitiesAbstract_B0F51B53BECB079E58853B84429B3D1E" xlink:to="loc_us-gaap_IncreaseDecreaseInOtherOperatingAssetsAndLiabilitiesNetAbstract_4D01D01362A4745F26B13B84429D1B43" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_GainLossOnSaleOfStockInSubsidiaryOrEquityMethodInvestee" xlink:label="loc_us-gaap_GainLossOnSaleOfStockInSubsidiaryOrEquityMethodInvestee_936CAF72359050D85A413B84429D1996" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInOtherOperatingAssetsAndLiabilitiesNetAbstract_4D01D01362A4745F26B13B84429D1B43" xlink:to="loc_us-gaap_GainLossOnSaleOfStockInSubsidiaryOrEquityMethodInvestee_936CAF72359050D85A413B84429D1996" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_IncreaseDecreaseInAccruedInvestmentIncomeReceivable" xlink:label="loc_us-gaap_IncreaseDecreaseInAccruedInvestmentIncomeReceivable_149B463EBFB0C56BC9613B84429E303B" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInOtherOperatingAssetsAndLiabilitiesNetAbstract_4D01D01362A4745F26B13B84429D1B43" xlink:to="loc_us-gaap_IncreaseDecreaseInAccruedInvestmentIncomeReceivable_149B463EBFB0C56BC9613B84429E303B" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_IncreaseDecreaseDueFromAffiliates" xlink:label="loc_us-gaap_IncreaseDecreaseDueFromAffiliates_2DD3A1B86124A7E1CC2E3B84429E0EEA" xlink:type="locator" />
    <link:definitionArc order="3" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInOtherOperatingAssetsAndLiabilitiesNetAbstract_4D01D01362A4745F26B13B84429D1B43" xlink:to="loc_us-gaap_IncreaseDecreaseDueFromAffiliates_2DD3A1B86124A7E1CC2E3B84429E0EEA" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_IncreaseDecreaseInPrepaidExpense" xlink:label="loc_us-gaap_IncreaseDecreaseInPrepaidExpense_1ADA62F9F5BD96B0714B3B84429EBF93" xlink:type="locator" />
    <link:definitionArc order="4" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInOtherOperatingAssetsAndLiabilitiesNetAbstract_4D01D01362A4745F26B13B84429D1B43" xlink:to="loc_us-gaap_IncreaseDecreaseInPrepaidExpense_1ADA62F9F5BD96B0714B3B84429EBF93" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_IncreaseDecreaseInPrepaidDeferredExpenseAndOtherAssets" xlink:label="loc_us-gaap_IncreaseDecreaseInPrepaidDeferredExpenseAndOtherAssets_6C1C8EA1E8A73B419C4E3B84429FCAA3" xlink:type="locator" />
    <link:definitionArc order="5" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInOtherOperatingAssetsAndLiabilitiesNetAbstract_4D01D01362A4745F26B13B84429D1B43" xlink:to="loc_us-gaap_IncreaseDecreaseInPrepaidDeferredExpenseAndOtherAssets_6C1C8EA1E8A73B419C4E3B84429FCAA3" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_IncreaseDecreaseInAccountsPayableAndAccruedLiabilities" xlink:label="loc_us-gaap_IncreaseDecreaseInAccountsPayableAndAccruedLiabilities_384B87653224C81B34953B84429FB6B1" xlink:type="locator" />
    <link:definitionArc order="6" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_IncreaseDecreaseInOtherOperatingAssetsAndLiabilitiesNetAbstract_4D01D01362A4745F26B13B84429D1B43" xlink:to="loc_us-gaap_IncreaseDecreaseInAccountsPayableAndAccruedLiabilities_384B87653224C81B34953B84429FB6B1" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_NetCashProvidedByUsedInOperatingActivities" xlink:label="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_B62CE0F948207AB386D63B84429F32B8" xlink:type="locator" />
    <link:definitionArc order="3" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_NetCashProvidedByUsedInOperatingActivitiesAbstract_56692092180174B34A323B84429A19EF" xlink:to="loc_us-gaap_NetCashProvidedByUsedInOperatingActivities_B62CE0F948207AB386D63B84429F32B8" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_NetCashProvidedByUsedInInvestingActivitiesAbstract" xlink:label="loc_us-gaap_NetCashProvidedByUsedInInvestingActivitiesAbstract_1EC7147AF5F1723A66E43B84429F8F71" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_CondensedCashFlowStatementsCaptionsLineItems_8EEE6A6B9BC5E1DEAC873B84429A1D2A" xlink:to="loc_us-gaap_NetCashProvidedByUsedInInvestingActivitiesAbstract_1EC7147AF5F1723A66E43B84429F8F71" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_PaymentsToAcquireInterestInSubsidiariesAndAffiliates" xlink:label="loc_us-gaap_PaymentsToAcquireInterestInSubsidiariesAndAffiliates_609BFA8AE7F957E5AEFE3B8442A0FB20" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_NetCashProvidedByUsedInInvestingActivitiesAbstract_1EC7147AF5F1723A66E43B84429F8F71" xlink:to="loc_us-gaap_PaymentsToAcquireInterestInSubsidiariesAndAffiliates_609BFA8AE7F957E5AEFE3B8442A0FB20" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_PaymentsToAcquireShortTermInvestments" xlink:label="loc_us-gaap_PaymentsToAcquireShortTermInvestments_40A9E449A2A5DF02256C3B8442A017AE" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_NetCashProvidedByUsedInInvestingActivitiesAbstract_1EC7147AF5F1723A66E43B84429F8F71" xlink:to="loc_us-gaap_PaymentsToAcquireShortTermInvestments_40A9E449A2A5DF02256C3B8442A017AE" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_PaymentsToAcquireAvailableForSaleSecuritiesDebt" xlink:label="loc_us-gaap_PaymentsToAcquireAvailableForSaleSecuritiesDebt_C610C2762DC8DE4D49093B8442A09A18" xlink:type="locator" />
    <link:definitionArc order="3" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_NetCashProvidedByUsedInInvestingActivitiesAbstract_1EC7147AF5F1723A66E43B84429F8F71" xlink:to="loc_us-gaap_PaymentsToAcquireAvailableForSaleSecuritiesDebt_C610C2762DC8DE4D49093B8442A09A18" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ProceedsFromSaleOfShortTermInvestments" xlink:label="loc_us-gaap_ProceedsFromSaleOfShortTermInvestments_34308969BBA6D078411D3B8442A00B43" xlink:type="locator" />
    <link:definitionArc order="4" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_NetCashProvidedByUsedInInvestingActivitiesAbstract_1EC7147AF5F1723A66E43B84429F8F71" xlink:to="loc_us-gaap_ProceedsFromSaleOfShortTermInvestments_34308969BBA6D078411D3B8442A00B43" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ProceedsFromSaleAndMaturityOfAvailableForSaleSecurities" xlink:label="loc_us-gaap_ProceedsFromSaleAndMaturityOfAvailableForSaleSecurities_B30256707F03E1F3966A3B8442A114BF" xlink:type="locator" />
    <link:definitionArc order="5" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_NetCashProvidedByUsedInInvestingActivitiesAbstract_1EC7147AF5F1723A66E43B84429F8F71" xlink:to="loc_us-gaap_ProceedsFromSaleAndMaturityOfAvailableForSaleSecurities_B30256707F03E1F3966A3B8442A114BF" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_PaymentsToAcquirePropertyPlantAndEquipment" xlink:label="loc_us-gaap_PaymentsToAcquirePropertyPlantAndEquipment_DB3C1DC56062DF14E44F3B8442A1387D" xlink:type="locator" />
    <link:definitionArc order="6" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_NetCashProvidedByUsedInInvestingActivitiesAbstract_1EC7147AF5F1723A66E43B84429F8F71" xlink:to="loc_us-gaap_PaymentsToAcquirePropertyPlantAndEquipment_DB3C1DC56062DF14E44F3B8442A1387D" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_NetCashProvidedByUsedInInvestingActivities" xlink:label="loc_us-gaap_NetCashProvidedByUsedInInvestingActivities_DA69F6E2C0D5F57BE3CE3B8442A108AA" xlink:type="locator" />
    <link:definitionArc order="7" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_NetCashProvidedByUsedInInvestingActivitiesAbstract_1EC7147AF5F1723A66E43B84429F8F71" xlink:to="loc_us-gaap_NetCashProvidedByUsedInInvestingActivities_DA69F6E2C0D5F57BE3CE3B8442A108AA" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_NetCashProvidedByUsedInFinancingActivitiesAbstract" xlink:label="loc_us-gaap_NetCashProvidedByUsedInFinancingActivitiesAbstract_A2C7F518157EE6E6678D3B8442A242EC" xlink:type="locator" />
    <link:definitionArc order="3" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_CondensedCashFlowStatementsCaptionsLineItems_8EEE6A6B9BC5E1DEAC873B84429A1D2A" xlink:to="loc_us-gaap_NetCashProvidedByUsedInFinancingActivitiesAbstract_A2C7F518157EE6E6678D3B8442A242EC" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ProceedsFromIssuanceOfCommonStock" xlink:label="loc_us-gaap_ProceedsFromIssuanceOfCommonStock_51141A2188F23BD8008E3B8442A28D19" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_NetCashProvidedByUsedInFinancingActivitiesAbstract_A2C7F518157EE6E6678D3B8442A242EC" xlink:to="loc_us-gaap_ProceedsFromIssuanceOfCommonStock_51141A2188F23BD8008E3B8442A28D19" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ProceedsFromIssuanceOfSharesUnderIncentiveAndShareBasedCompensationPlansIncludingStockOptions" xlink:label="loc_us-gaap_ProceedsFromIssuanceOfSharesUnderIncentiveAndShareBasedCompensationPlansIncludingStockOptions_CFD3B7D710CFA104D3883B8442A2A8BC" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_NetCashProvidedByUsedInFinancingActivitiesAbstract_A2C7F518157EE6E6678D3B8442A242EC" xlink:to="loc_us-gaap_ProceedsFromIssuanceOfSharesUnderIncentiveAndShareBasedCompensationPlansIncludingStockOptions_CFD3B7D710CFA104D3883B8442A2A8BC" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ProceedsFromWarrantExercises" xlink:label="loc_us-gaap_ProceedsFromWarrantExercises_F9F3E1F725AE719968A33B8442A2790F" xlink:type="locator" />
    <link:definitionArc order="3" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_NetCashProvidedByUsedInFinancingActivitiesAbstract_A2C7F518157EE6E6678D3B8442A242EC" xlink:to="loc_us-gaap_ProceedsFromWarrantExercises_F9F3E1F725AE719968A33B8442A2790F" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_PaymentsRelatedToTaxWithholdingForShareBasedCompensation" xlink:label="loc_us-gaap_PaymentsRelatedToTaxWithholdingForShareBasedCompensation_39DEE0407CC97F0963E13B8442A29CFB" xlink:type="locator" />
    <link:definitionArc order="4" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_NetCashProvidedByUsedInFinancingActivitiesAbstract_A2C7F518157EE6E6678D3B8442A242EC" xlink:to="loc_us-gaap_PaymentsRelatedToTaxWithholdingForShareBasedCompensation_39DEE0407CC97F0963E13B8442A29CFB" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ProceedsFromIssuanceOfLongTermDebt" xlink:label="loc_us-gaap_ProceedsFromIssuanceOfLongTermDebt_9B7AEBC2946ADDC727723B8442A36270" xlink:type="locator" />
    <link:definitionArc order="5" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_NetCashProvidedByUsedInFinancingActivitiesAbstract_A2C7F518157EE6E6678D3B8442A242EC" xlink:to="loc_us-gaap_ProceedsFromIssuanceOfLongTermDebt_9B7AEBC2946ADDC727723B8442A36270" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_RepaymentsOfLongTermDebt" xlink:label="loc_us-gaap_RepaymentsOfLongTermDebt_46D981B3835BD8FA9FC03B8442A3F0DA" xlink:type="locator" />
    <link:definitionArc order="6" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_NetCashProvidedByUsedInFinancingActivitiesAbstract_A2C7F518157EE6E6678D3B8442A242EC" xlink:to="loc_us-gaap_RepaymentsOfLongTermDebt_46D981B3835BD8FA9FC03B8442A3F0DA" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_PaymentsOfDebtIssuanceCosts" xlink:label="loc_us-gaap_PaymentsOfDebtIssuanceCosts_34CBB6AA32222CD435523B8442A3D1F8" xlink:type="locator" />
    <link:definitionArc order="7" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_NetCashProvidedByUsedInFinancingActivitiesAbstract_A2C7F518157EE6E6678D3B8442A242EC" xlink:to="loc_us-gaap_PaymentsOfDebtIssuanceCosts_34CBB6AA32222CD435523B8442A3D1F8" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_NetCashProvidedByUsedInFinancingActivities" xlink:label="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_5705A042E7F3F02D81D33B8442A34CCD" xlink:type="locator" />
    <link:definitionArc order="8" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_NetCashProvidedByUsedInFinancingActivitiesAbstract_A2C7F518157EE6E6678D3B8442A242EC" xlink:to="loc_us-gaap_NetCashProvidedByUsedInFinancingActivities_5705A042E7F3F02D81D33B8442A34CCD" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsPeriodIncreaseDecreaseIncludingExchangeRateEffect" xlink:label="loc_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsPeriodIncreaseDecreaseIncludingExchangeRateEffect_DD49CE1C675171462B253B8442A37F4E" xlink:type="locator" />
    <link:definitionArc order="4" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_CondensedCashFlowStatementsCaptionsLineItems_8EEE6A6B9BC5E1DEAC873B84429A1D2A" xlink:to="loc_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsPeriodIncreaseDecreaseIncludingExchangeRateEffect_DD49CE1C675171462B253B8442A37F4E" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents" xlink:label="loc_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents_D7D4AED4191D7700B1A93B8442A466D7" xlink:type="locator" />
    <link:definitionArc order="5" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_CondensedCashFlowStatementsCaptionsLineItems_8EEE6A6B9BC5E1DEAC873B84429A1D2A" xlink:to="loc_us-gaap_CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents_D7D4AED4191D7700B1A93B8442A466D7" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_CumulativeEffectOfNewAccountingPrincipleInPeriodOfAdoption" xlink:label="loc_us-gaap_CumulativeEffectOfNewAccountingPrincipleInPeriodOfAdoption_A8E91FE0846799A5CE6C3B8442A44EFC" xlink:type="locator" />
    <link:definitionArc order="7" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_CondensedCashFlowStatementsCaptionsLineItems_8EEE6A6B9BC5E1DEAC873B84429A1D2A" xlink:to="loc_us-gaap_CumulativeEffectOfNewAccountingPrincipleInPeriodOfAdoption_A8E91FE0846799A5CE6C3B8442A44EFC" xlink:type="arc" />
  </link:definitionLink>
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/ScheduleIiFinancialInformationOfRegistrantParentCompanyOnlySupplementalNotesParentCompanyOnlyDetails" xlink:type="extended">
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_CondensedFinancialStatementsCaptionsLineItems" xlink:label="loc_srt_CondensedFinancialStatementsCaptionsLineItems_6C7B59DA7F6F9E709B7A3B290A418C92" xlink:type="locator" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_ScheduleOfCondensedFinancialStatementsTable" xlink:label="loc_srt_ScheduleOfCondensedFinancialStatementsTable_3F09E80F9B2F585B120C3B290A409398" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_srt_CondensedFinancialStatementsCaptionsLineItems_6C7B59DA7F6F9E709B7A3B290A418C92" xlink:to="loc_srt_ScheduleOfCondensedFinancialStatementsTable_3F09E80F9B2F585B120C3B290A409398" xlink:type="arc" xbrldt:closed="true" xbrldt:contextElement="segment" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_ConsolidatedEntitiesAxis" xlink:label="loc_srt_ConsolidatedEntitiesAxis_749A69611E846B656C6A3B290A40B310" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_srt_ScheduleOfCondensedFinancialStatementsTable_3F09E80F9B2F585B120C3B290A409398" xlink:to="loc_srt_ConsolidatedEntitiesAxis_749A69611E846B656C6A3B290A40B310" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_ConsolidatedEntitiesDomain" xlink:label="loc_srt_ConsolidatedEntitiesDomain_3C99F8C14642D5582D8F3B290A40CCEA_default" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_ConsolidatedEntitiesAxis_749A69611E846B656C6A3B290A40B310" xlink:to="loc_srt_ConsolidatedEntitiesDomain_3C99F8C14642D5582D8F3B290A40CCEA_default" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_ConsolidatedEntitiesDomain" xlink:label="loc_srt_ConsolidatedEntitiesDomain_3C99F8C14642D5582D8F3B290A40CCEA" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_ConsolidatedEntitiesAxis_749A69611E846B656C6A3B290A40B310" xlink:to="loc_srt_ConsolidatedEntitiesDomain_3C99F8C14642D5582D8F3B290A40CCEA" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_SubsidiariesMember" xlink:label="loc_srt_SubsidiariesMember_2EB95166CF4F591A1FAA3B290A41C5B0" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_ConsolidatedEntitiesDomain_3C99F8C14642D5582D8F3B290A40CCEA" xlink:to="loc_srt_SubsidiariesMember_2EB95166CF4F591A1FAA3B290A41C5B0" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_OrdinaryDividendsRestrictionwithRegardstoCapitalSurplus" xlink:label="loc_nmih_OrdinaryDividendsRestrictionwithRegardstoCapitalSurplus_2EDD7516B525B9DCC7EB3B290A41E6FE" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_CondensedFinancialStatementsCaptionsLineItems_6C7B59DA7F6F9E709B7A3B290A418C92" xlink:to="loc_nmih_OrdinaryDividendsRestrictionwithRegardstoCapitalSurplus_2EDD7516B525B9DCC7EB3B290A41E6FE" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_OrdinaryDividendsRestrictionwithRegardstoCapitalSurplusNextFiscalYear" xlink:label="loc_nmih_OrdinaryDividendsRestrictionwithRegardstoCapitalSurplusNextFiscalYear_749E2F2D408FDF53D7533B290A418177" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_CondensedFinancialStatementsCaptionsLineItems_6C7B59DA7F6F9E709B7A3B290A418C92" xlink:to="loc_nmih_OrdinaryDividendsRestrictionwithRegardstoCapitalSurplusNextFiscalYear_749E2F2D408FDF53D7533B290A418177" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_RestrictedNetAssetsLessAggregateDividendCapacity" xlink:label="loc_nmih_RestrictedNetAssetsLessAggregateDividendCapacity_44458CF06373F25DC1FB3B290A42820B" xlink:type="locator" />
    <link:definitionArc order="3" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_CondensedFinancialStatementsCaptionsLineItems_6C7B59DA7F6F9E709B7A3B290A418C92" xlink:to="loc_nmih_RestrictedNetAssetsLessAggregateDividendCapacity_44458CF06373F25DC1FB3B290A42820B" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_OperatingExpenses" xlink:label="loc_us-gaap_OperatingExpenses_27AC3F5B9B5FE74CD77C3B290A428988" xlink:type="locator" />
    <link:definitionArc order="4" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_CondensedFinancialStatementsCaptionsLineItems_6C7B59DA7F6F9E709B7A3B290A418C92" xlink:to="loc_us-gaap_OperatingExpenses_27AC3F5B9B5FE74CD77C3B290A428988" xlink:type="arc" />
  </link:definitionLink>
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/ScheduleIvFinancialInformationOfRegistrantReinsurance" xlink:type="extended" />
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/ScheduleIvFinancialInformationOfRegistrantReinsuranceDetails" xlink:type="extended">
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_ReinsurancePremiumsForInsuranceCompaniesByProductSegmentLineItems" xlink:label="loc_srt_ReinsurancePremiumsForInsuranceCompaniesByProductSegmentLineItems_BDCD278DEA240253A8CD3B290A39FB45" xlink:type="locator" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_ReinsurancePremiumsForInsuranceCompaniesByProductSegmentTable" xlink:label="loc_srt_ReinsurancePremiumsForInsuranceCompaniesByProductSegmentTable_69C733EE241B37D621403B290A387116" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_srt_ReinsurancePremiumsForInsuranceCompaniesByProductSegmentLineItems_BDCD278DEA240253A8CD3B290A39FB45" xlink:to="loc_srt_ReinsurancePremiumsForInsuranceCompaniesByProductSegmentTable_69C733EE241B37D621403B290A387116" xlink:type="arc" xbrldt:closed="true" xbrldt:contextElement="segment" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_ConsolidatedEntitiesAxis" xlink:label="loc_srt_ConsolidatedEntitiesAxis_9139456907301870BC4B3B290A38B380" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_srt_ReinsurancePremiumsForInsuranceCompaniesByProductSegmentTable_69C733EE241B37D621403B290A387116" xlink:to="loc_srt_ConsolidatedEntitiesAxis_9139456907301870BC4B3B290A38B380" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_ConsolidatedEntitiesDomain" xlink:label="loc_srt_ConsolidatedEntitiesDomain_153B6CAA5749DFA7A4D03B290A397FCB_default" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_ConsolidatedEntitiesAxis_9139456907301870BC4B3B290A38B380" xlink:to="loc_srt_ConsolidatedEntitiesDomain_153B6CAA5749DFA7A4D03B290A397FCB_default" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_ConsolidatedEntitiesDomain" xlink:label="loc_srt_ConsolidatedEntitiesDomain_153B6CAA5749DFA7A4D03B290A397FCB" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_ConsolidatedEntitiesAxis_9139456907301870BC4B3B290A38B380" xlink:to="loc_srt_ConsolidatedEntitiesDomain_153B6CAA5749DFA7A4D03B290A397FCB" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_ParentCompanyMember" xlink:label="loc_srt_ParentCompanyMember_99996D02911D010BE1ED3B290A39A673" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_ConsolidatedEntitiesDomain_153B6CAA5749DFA7A4D03B290A397FCB" xlink:to="loc_srt_ParentCompanyMember_99996D02911D010BE1ED3B290A39A673" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_DirectPremiumsEarned" xlink:label="loc_us-gaap_DirectPremiumsEarned_D56FE154DA923FE417B13B290A397298" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_ReinsurancePremiumsForInsuranceCompaniesByProductSegmentLineItems_BDCD278DEA240253A8CD3B290A39FB45" xlink:to="loc_us-gaap_DirectPremiumsEarned_D56FE154DA923FE417B13B290A397298" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_CededPremiumsEarned" xlink:label="loc_us-gaap_CededPremiumsEarned_837413C8E0B8223E0BD73B290A3A3C50" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_ReinsurancePremiumsForInsuranceCompaniesByProductSegmentLineItems_BDCD278DEA240253A8CD3B290A39FB45" xlink:to="loc_us-gaap_CededPremiumsEarned_837413C8E0B8223E0BD73B290A3A3C50" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_AssumedPremiumsEarned" xlink:label="loc_us-gaap_AssumedPremiumsEarned_C4A035A3E4C24921C8D63B290A3AD1C5" xlink:type="locator" />
    <link:definitionArc order="3" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_ReinsurancePremiumsForInsuranceCompaniesByProductSegmentLineItems_BDCD278DEA240253A8CD3B290A39FB45" xlink:to="loc_us-gaap_AssumedPremiumsEarned_C4A035A3E4C24921C8D63B290A3AD1C5" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_PremiumsEarnedNet" xlink:label="loc_us-gaap_PremiumsEarnedNet_A458747B10F63CCB80483B290A3ADFA6" xlink:type="locator" />
    <link:definitionArc order="4" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_ReinsurancePremiumsForInsuranceCompaniesByProductSegmentLineItems_BDCD278DEA240253A8CD3B290A39FB45" xlink:to="loc_us-gaap_PremiumsEarnedNet_A458747B10F63CCB80483B290A3ADFA6" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_PremiumsPercentageAssumedToNet" xlink:label="loc_us-gaap_PremiumsPercentageAssumedToNet_6C8E7638054594F236B73B290A3AE88F" xlink:type="locator" />
    <link:definitionArc order="5" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_ReinsurancePremiumsForInsuranceCompaniesByProductSegmentLineItems_BDCD278DEA240253A8CD3B290A39FB45" xlink:to="loc_us-gaap_PremiumsPercentageAssumedToNet_6C8E7638054594F236B73B290A3AE88F" xlink:type="arc" />
  </link:definitionLink>
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/ShareBasedCompensation" xlink:type="extended" />
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/ShareBasedCompensationNarrativeDetails" xlink:type="extended">
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_25915480C1CB149A6E923AA1577105D4" xlink:type="locator" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable" xlink:label="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_EF641C69A95118167BCC3AA1576659EC" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_25915480C1CB149A6E923AA1577105D4" xlink:to="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_EF641C69A95118167BCC3AA1576659EC" xlink:type="arc" xbrldt:closed="true" xbrldt:contextElement="segment" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_PlanNameAxis" xlink:label="loc_us-gaap_PlanNameAxis_CDD18490714CAA36E7A73AA15766E799" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_EF641C69A95118167BCC3AA1576659EC" xlink:to="loc_us-gaap_PlanNameAxis_CDD18490714CAA36E7A73AA15766E799" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_PlanNameDomain" xlink:label="loc_us-gaap_PlanNameDomain_28F4AF64933788B591393AA1576753ED_default" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_PlanNameAxis_CDD18490714CAA36E7A73AA15766E799" xlink:to="loc_us-gaap_PlanNameDomain_28F4AF64933788B591393AA1576753ED_default" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_PlanNameDomain" xlink:label="loc_us-gaap_PlanNameDomain_28F4AF64933788B591393AA1576753ED" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_PlanNameAxis_CDD18490714CAA36E7A73AA15766E799" xlink:to="loc_us-gaap_PlanNameDomain_28F4AF64933788B591393AA1576753ED" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_The2012StockIncentivePlanMember" xlink:label="loc_nmih_The2012StockIncentivePlanMember_2B8CD139A28BDDB0005C3AA15767090D" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_PlanNameDomain_28F4AF64933788B591393AA1576753ED" xlink:to="loc_nmih_The2012StockIncentivePlanMember_2B8CD139A28BDDB0005C3AA15767090D" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_NMIH2014OmnibusIncentivePlanMember" xlink:label="loc_nmih_NMIH2014OmnibusIncentivePlanMember_6506D9074E59564179D83AA157680462" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_PlanNameDomain_28F4AF64933788B591393AA1576753ED" xlink:to="loc_nmih_NMIH2014OmnibusIncentivePlanMember_6506D9074E59564179D83AA157680462" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_StatementClassOfStockAxis" xlink:label="loc_us-gaap_StatementClassOfStockAxis_DEF1C4DB7FD06E9ADC063AA15768DA3F" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_EF641C69A95118167BCC3AA1576659EC" xlink:to="loc_us-gaap_StatementClassOfStockAxis_DEF1C4DB7FD06E9ADC063AA15768DA3F" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ClassOfStockDomain" xlink:label="loc_us-gaap_ClassOfStockDomain_01B9255DF07C5B9F3BCB3AA157685DD1_default" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_StatementClassOfStockAxis_DEF1C4DB7FD06E9ADC063AA15768DA3F" xlink:to="loc_us-gaap_ClassOfStockDomain_01B9255DF07C5B9F3BCB3AA157685DD1_default" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ClassOfStockDomain" xlink:label="loc_us-gaap_ClassOfStockDomain_01B9255DF07C5B9F3BCB3AA157685DD1" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_StatementClassOfStockAxis_DEF1C4DB7FD06E9ADC063AA15768DA3F" xlink:to="loc_us-gaap_ClassOfStockDomain_01B9255DF07C5B9F3BCB3AA157685DD1" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_CommonClassAMember" xlink:label="loc_us-gaap_CommonClassAMember_10661B164DB88B2AD0D03AA15768E549" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ClassOfStockDomain_01B9255DF07C5B9F3BCB3AA157685DD1" xlink:to="loc_us-gaap_CommonClassAMember_10661B164DB88B2AD0D03AA15768E549" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_AwardTypeAxis" xlink:label="loc_us-gaap_AwardTypeAxis_A30D2410CF4D7B183F453AA15769A046" xlink:type="locator" />
    <link:definitionArc order="3" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_EF641C69A95118167BCC3AA1576659EC" xlink:to="loc_us-gaap_AwardTypeAxis_A30D2410CF4D7B183F453AA15769A046" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_B172D5D1FC8C8197CA1F3AA15769220E_default" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_AwardTypeAxis_A30D2410CF4D7B183F453AA15769A046" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_B172D5D1FC8C8197CA1F3AA15769220E_default" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_B172D5D1FC8C8197CA1F3AA15769220E" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_AwardTypeAxis_A30D2410CF4D7B183F453AA15769A046" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_B172D5D1FC8C8197CA1F3AA15769220E" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_EmployeeStockOptionMember" xlink:label="loc_us-gaap_EmployeeStockOptionMember_8D61FA38CEBD6ECCAE603AA15769E213" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_B172D5D1FC8C8197CA1F3AA15769220E" xlink:to="loc_us-gaap_EmployeeStockOptionMember_8D61FA38CEBD6ECCAE603AA15769E213" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_RestrictedStockUnitsRSUMember" xlink:label="loc_us-gaap_RestrictedStockUnitsRSUMember_186A7834D3306435E7CA3AA1576A47EE" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_B172D5D1FC8C8197CA1F3AA15769220E" xlink:to="loc_us-gaap_RestrictedStockUnitsRSUMember_186A7834D3306435E7CA3AA1576A47EE" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_RestrictedStockUnitsRSUsSubjecttoServiceConditionsMember" xlink:label="loc_nmih_RestrictedStockUnitsRSUsSubjecttoServiceConditionsMember_52ADD055A854FDB3E2C63AA1576A6113" xlink:type="locator" />
    <link:definitionArc order="3" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_B172D5D1FC8C8197CA1F3AA15769220E" xlink:to="loc_nmih_RestrictedStockUnitsRSUsSubjecttoServiceConditionsMember_52ADD055A854FDB3E2C63AA1576A6113" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_RestrictedStockUnitsRSUsSubjecttoServiceAndPerformanceConditionsMember" xlink:label="loc_nmih_RestrictedStockUnitsRSUsSubjecttoServiceAndPerformanceConditionsMember_17A19F25D2B65DF53D3C3AA1576AABC6" xlink:type="locator" />
    <link:definitionArc order="4" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_B172D5D1FC8C8197CA1F3AA15769220E" xlink:to="loc_nmih_RestrictedStockUnitsRSUsSubjecttoServiceAndPerformanceConditionsMember_17A19F25D2B65DF53D3C3AA1576AABC6" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_RangeAxis" xlink:label="loc_srt_RangeAxis_82F6E32321F5DD782FCE3AA1576AC0BE" xlink:type="locator" />
    <link:definitionArc order="4" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_EF641C69A95118167BCC3AA1576659EC" xlink:to="loc_srt_RangeAxis_82F6E32321F5DD782FCE3AA1576AC0BE" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_RangeMember" xlink:label="loc_srt_RangeMember_DF7CBCC4D0168FD001F03AA1576A4C98_default" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_RangeAxis_82F6E32321F5DD782FCE3AA1576AC0BE" xlink:to="loc_srt_RangeMember_DF7CBCC4D0168FD001F03AA1576A4C98_default" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_RangeMember" xlink:label="loc_srt_RangeMember_DF7CBCC4D0168FD001F03AA1576A4C98" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_RangeAxis_82F6E32321F5DD782FCE3AA1576AC0BE" xlink:to="loc_srt_RangeMember_DF7CBCC4D0168FD001F03AA1576A4C98" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_MinimumMember" xlink:label="loc_srt_MinimumMember_81497D035703AE3A274B3AA1576B8AF0" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RangeMember_DF7CBCC4D0168FD001F03AA1576A4C98" xlink:to="loc_srt_MinimumMember_81497D035703AE3A274B3AA1576B8AF0" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_MaximumMember" xlink:label="loc_srt_MaximumMember_A83E376B6A2B75B9DB1F3AA157701329" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RangeMember_DF7CBCC4D0168FD001F03AA1576A4C98" xlink:to="loc_srt_MaximumMember_A83E376B6A2B75B9DB1F3AA157701329" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNumberOfSharesAuthorized" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNumberOfSharesAuthorized_C1C9AB6277E4B151214C3AA157719A3F" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_25915480C1CB149A6E923AA1577105D4" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNumberOfSharesAuthorized_C1C9AB6277E4B151214C3AA157719A3F" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardExpirationPeriod" xlink:label="loc_us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardExpirationPeriod_CCBF42B8C5669052CDDF3AA15771FD75" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_25915480C1CB149A6E923AA1577105D4" xlink:to="loc_us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardExpirationPeriod_CCBF42B8C5669052CDDF3AA15771FD75" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardAwardRequisiteServicePeriod1" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardAwardRequisiteServicePeriod1_504739DD7247F04E43DA3AA15771BBE9" xlink:type="locator" />
    <link:definitionArc order="3" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_25915480C1CB149A6E923AA1577105D4" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardAwardRequisiteServicePeriod1_504739DD7247F04E43DA3AA15771BBE9" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNumberOfAdditionalSharesAuthorized" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNumberOfAdditionalSharesAuthorized_7F9606E14A03D77633093AA157726E03" xlink:type="locator" />
    <link:definitionArc order="4" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_25915480C1CB149A6E923AA1577105D4" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardNumberOfAdditionalSharesAuthorized_7F9606E14A03D77633093AA157726E03" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ShareBasedCompensation" xlink:label="loc_us-gaap_ShareBasedCompensation_4225F14929B675FD52653AA157722F46" xlink:type="locator" />
    <link:definitionArc order="5" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_25915480C1CB149A6E923AA1577105D4" xlink:to="loc_us-gaap_ShareBasedCompensation_4225F14929B675FD52653AA157722F46" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_EmployeeServiceShareBasedCompensationTaxBenefitFromCompensationExpense" xlink:label="loc_us-gaap_EmployeeServiceShareBasedCompensationTaxBenefitFromCompensationExpense_DFD3FF3F95355C91ECF53AA15772BFDC" xlink:type="locator" />
    <link:definitionArc order="6" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_25915480C1CB149A6E923AA1577105D4" xlink:to="loc_us-gaap_EmployeeServiceShareBasedCompensationTaxBenefitFromCompensationExpense_DFD3FF3F95355C91ECF53AA15772BFDC" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsVestedAndExpectedToVestExercisableNumber" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsVestedAndExpectedToVestExercisableNumber_95E907DF198AFD9DB2CD3AA157727190" xlink:type="locator" />
    <link:definitionArc order="7" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_25915480C1CB149A6E923AA1577105D4" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsVestedAndExpectedToVestExercisableNumber_95E907DF198AFD9DB2CD3AA157727190" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_StockIssuedDuringPeriodSharesStockOptionsExercised" xlink:label="loc_us-gaap_StockIssuedDuringPeriodSharesStockOptionsExercised_9A67899639FBBB72AF513AA15772B28C" xlink:type="locator" />
    <link:definitionArc order="8" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_25915480C1CB149A6E923AA1577105D4" xlink:to="loc_us-gaap_StockIssuedDuringPeriodSharesStockOptionsExercised_9A67899639FBBB72AF513AA15772B28C" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsExercisesInPeriodTotalIntrinsicValue" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsExercisesInPeriodTotalIntrinsicValue_A8898FEFB25F5CD62F083AA15773CA7F" xlink:type="locator" />
    <link:definitionArc order="9" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_25915480C1CB149A6E923AA1577105D4" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsExercisesInPeriodTotalIntrinsicValue_A8898FEFB25F5CD62F083AA15773CA7F" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsVestedAndExpectedToVestExercisableWeightedAverageExercisePrice" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsVestedAndExpectedToVestExercisableWeightedAverageExercisePrice_C022163BA771299008993AA157738C65" xlink:type="locator" />
    <link:definitionArc order="10" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_25915480C1CB149A6E923AA1577105D4" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsVestedAndExpectedToVestExercisableWeightedAverageExercisePrice_C022163BA771299008993AA157738C65" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardOptionsVestedAndExpectedToVestExercisableWeightedAverageRemainingContractualTerm1" xlink:label="loc_us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardOptionsVestedAndExpectedToVestExercisableWeightedAverageRemainingContractualTerm1_5D1265874D81E8C265483AA15773BC1D" xlink:type="locator" />
    <link:definitionArc order="11" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_25915480C1CB149A6E923AA1577105D4" xlink:to="loc_us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardOptionsVestedAndExpectedToVestExercisableWeightedAverageRemainingContractualTerm1_5D1265874D81E8C265483AA15773BC1D" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsVestedAndExpectedToVestExercisableAggregateIntrinsicValue" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsVestedAndExpectedToVestExercisableAggregateIntrinsicValue_43BD2C83CA7EA9907D3B3AA157735557" xlink:type="locator" />
    <link:definitionArc order="12" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_25915480C1CB149A6E923AA1577105D4" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsVestedAndExpectedToVestExercisableAggregateIntrinsicValue_43BD2C83CA7EA9907D3B3AA157735557" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognizedStockOptions" xlink:label="loc_us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognizedStockOptions_23917BBAE4CCEFCD8B033AA15773BE27" xlink:type="locator" />
    <link:definitionArc order="13" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_25915480C1CB149A6E923AA1577105D4" xlink:to="loc_us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognizedStockOptions_23917BBAE4CCEFCD8B033AA15773BE27" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognizedPeriodForRecognition1" xlink:label="loc_us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognizedPeriodForRecognition1_0D273A71FEAA6CD6B2CF3AA1577439D4" xlink:type="locator" />
    <link:definitionArc order="14" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_25915480C1CB149A6E923AA1577105D4" xlink:to="loc_us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognizedPeriodForRecognition1_0D273A71FEAA6CD6B2CF3AA1577439D4" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedNumber" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedNumber_770A8C33EF374EFC12923AA157747BF3" xlink:type="locator" />
    <link:definitionArc order="15" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_25915480C1CB149A6E923AA1577105D4" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedNumber_770A8C33EF374EFC12923AA157747BF3" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriodTotalFairValue" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriodTotalFairValue_4A83881C03332DC6D3473AA15774C0F3" xlink:type="locator" />
    <link:definitionArc order="16" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_25915480C1CB149A6E923AA1577105D4" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriodTotalFairValue_4A83881C03332DC6D3473AA15774C0F3" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsOutstandingWeightedAverageRemainingContractualTerms" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsOutstandingWeightedAverageRemainingContractualTerms_18D0F9D32D9245B8B6FB3AA15774398B" xlink:type="locator" />
    <link:definitionArc order="17" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_25915480C1CB149A6E923AA1577105D4" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsOutstandingWeightedAverageRemainingContractualTerms_18D0F9D32D9245B8B6FB3AA15774398B" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognizedShareBasedAwardsOtherThanOptions" xlink:label="loc_us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognizedShareBasedAwardsOtherThanOptions_8000ABEA3464DB10738F3AA15775ED50" xlink:type="locator" />
    <link:definitionArc order="18" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_25915480C1CB149A6E923AA1577105D4" xlink:to="loc_us-gaap_EmployeeServiceShareBasedCompensationNonvestedAwardsTotalCompensationCostNotYetRecognizedShareBasedAwardsOtherThanOptions_8000ABEA3464DB10738F3AA15775ED50" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardAwardVestingPeriod1" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardAwardVestingPeriod1_FA0A95C3A618889148083AA15775FDC1" xlink:type="locator" />
    <link:definitionArc order="19" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_25915480C1CB149A6E923AA1577105D4" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardAwardVestingPeriod1_FA0A95C3A618889148083AA15775FDC1" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_DefinedContributionPlanEmployerMatchingContributionPercentOfMatch" xlink:label="loc_us-gaap_DefinedContributionPlanEmployerMatchingContributionPercentOfMatch_077BAD466598E1EF00463AA15775B165" xlink:type="locator" />
    <link:definitionArc order="20" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_25915480C1CB149A6E923AA1577105D4" xlink:to="loc_us-gaap_DefinedContributionPlanEmployerMatchingContributionPercentOfMatch_077BAD466598E1EF00463AA15775B165" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_DefinedContributionPlanEmployerMatchingContributionPercent" xlink:label="loc_us-gaap_DefinedContributionPlanEmployerMatchingContributionPercent_6227B0340933E69F2B653AA157751168" xlink:type="locator" />
    <link:definitionArc order="21" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_25915480C1CB149A6E923AA1577105D4" xlink:to="loc_us-gaap_DefinedContributionPlanEmployerMatchingContributionPercent_6227B0340933E69F2B653AA157751168" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_DefinedContributionPlanEmployerDiscretionaryContributionAmount" xlink:label="loc_us-gaap_DefinedContributionPlanEmployerDiscretionaryContributionAmount_C63E8D9C6D911068A19F3AA157751DE4" xlink:type="locator" />
    <link:definitionArc order="22" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_25915480C1CB149A6E923AA1577105D4" xlink:to="loc_us-gaap_DefinedContributionPlanEmployerDiscretionaryContributionAmount_C63E8D9C6D911068A19F3AA157751DE4" xlink:type="arc" />
  </link:definitionLink>
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/ShareBasedCompensationRestrictedStockUnitsActivityDetails" xlink:type="extended">
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_354EDB5851126E45516F3AA157256004" xlink:type="locator" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable" xlink:label="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_7C86EB4571BE9101D6A33AA1572474D1" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_354EDB5851126E45516F3AA157256004" xlink:to="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_7C86EB4571BE9101D6A33AA1572474D1" xlink:type="arc" xbrldt:closed="true" xbrldt:contextElement="segment" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_AwardTypeAxis" xlink:label="loc_us-gaap_AwardTypeAxis_9A923CB0C396E568BD5C3AA15724FA7A" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_7C86EB4571BE9101D6A33AA1572474D1" xlink:to="loc_us-gaap_AwardTypeAxis_9A923CB0C396E568BD5C3AA15724FA7A" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_28E61C00D8DE61F5FF443AA157248D3D_default" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_AwardTypeAxis_9A923CB0C396E568BD5C3AA15724FA7A" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_28E61C00D8DE61F5FF443AA157248D3D_default" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_28E61C00D8DE61F5FF443AA157248D3D" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_AwardTypeAxis_9A923CB0C396E568BD5C3AA15724FA7A" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_28E61C00D8DE61F5FF443AA157248D3D" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_RestrictedStockUnitsRSUMember" xlink:label="loc_us-gaap_RestrictedStockUnitsRSUMember_B4D60AAF2AB082A0436B3AA15725DDF1" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_28E61C00D8DE61F5FF443AA157248D3D" xlink:to="loc_us-gaap_RestrictedStockUnitsRSUMember_B4D60AAF2AB082A0436B3AA15725DDF1" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedRollForward" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedRollForward_8B47AD9C1E6AE383B46A3AA157253D70" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_354EDB5851126E45516F3AA157256004" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedRollForward_8B47AD9C1E6AE383B46A3AA157253D70" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedNumber" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedNumber_CD6C798D04E664BDA3B43AA15726F513" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedRollForward_8B47AD9C1E6AE383B46A3AA157253D70" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedNumber_CD6C798D04E664BDA3B43AA15726F513" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriod" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriod_C7EC0952DE48CBF549B43AA1572658DE" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedRollForward_8B47AD9C1E6AE383B46A3AA157253D70" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriod_C7EC0952DE48CBF549B43AA1572658DE" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriod" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriod_9F7B0F21F51DC3C648DD3AA157276629" xlink:type="locator" />
    <link:definitionArc order="3" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedRollForward_8B47AD9C1E6AE383B46A3AA157253D70" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriod_9F7B0F21F51DC3C648DD3AA157276629" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeitedInPeriod" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeitedInPeriod_FC4DC59E6306860C14A33AA15727ECED" xlink:type="locator" />
    <link:definitionArc order="4" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedRollForward_8B47AD9C1E6AE383B46A3AA157253D70" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeitedInPeriod_FC4DC59E6306860C14A33AA15727ECED" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValueRollForward" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValueRollForward_E0DFAEB737F4F3A975D63AA15727EEFD" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_354EDB5851126E45516F3AA157256004" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValueRollForward_E0DFAEB737F4F3A975D63AA15727EEFD" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValue" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValue_96677178C79CC8B83D4E3AA15728AB8D" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValueRollForward_E0DFAEB737F4F3A975D63AA15727EEFD" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValue_96677178C79CC8B83D4E3AA15728AB8D" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriodWeightedAverageGrantDateFairValue" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriodWeightedAverageGrantDateFairValue_DD6A41F0064F70E249E43AA15728A703" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValueRollForward_E0DFAEB737F4F3A975D63AA15727EEFD" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsGrantsInPeriodWeightedAverageGrantDateFairValue_DD6A41F0064F70E249E43AA15728A703" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriodWeightedAverageGrantDateFairValue" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriodWeightedAverageGrantDateFairValue_1C15126CC2705440FBFC3AA1572817CE" xlink:type="locator" />
    <link:definitionArc order="3" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValueRollForward_E0DFAEB737F4F3A975D63AA15727EEFD" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsVestedInPeriodWeightedAverageGrantDateFairValue_1C15126CC2705440FBFC3AA1572817CE" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeituresWeightedAverageGrantDateFairValue" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeituresWeightedAverageGrantDateFairValue_D993481380DC8FA157B43AA157285958" xlink:type="locator" />
    <link:definitionArc order="4" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsNonvestedWeightedAverageGrantDateFairValueRollForward_E0DFAEB737F4F3A975D63AA15727EEFD" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardEquityInstrumentsOtherThanOptionsForfeituresWeightedAverageGrantDateFairValue_D993481380DC8FA157B43AA157285958" xlink:type="arc" />
  </link:definitionLink>
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/ShareBasedCompensationStockOptionActivityDetails" xlink:type="extended" />
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/ShareBasedCompensationStockOptionValuationAssumptionsDetails" xlink:type="extended">
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_A8752755502C3DB0D8BF3AA15732AC22" xlink:type="locator" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable" xlink:label="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_AB8B13A008C6D7CF03F63AA157304356" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_A8752755502C3DB0D8BF3AA15732AC22" xlink:to="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_AB8B13A008C6D7CF03F63AA157304356" xlink:type="arc" xbrldt:closed="true" xbrldt:contextElement="segment" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_AwardTypeAxis" xlink:label="loc_us-gaap_AwardTypeAxis_05C2A54B2D8E359751283AA15731D3A6" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfShareBasedCompensationArrangementsByShareBasedPaymentAwardTable_AB8B13A008C6D7CF03F63AA157304356" xlink:to="loc_us-gaap_AwardTypeAxis_05C2A54B2D8E359751283AA15731D3A6" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_313A34055045A924E6703AA15731C355_default" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_AwardTypeAxis_05C2A54B2D8E359751283AA15731D3A6" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_313A34055045A924E6703AA15731C355_default" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_313A34055045A924E6703AA15731C355" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_AwardTypeAxis_05C2A54B2D8E359751283AA15731D3A6" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_313A34055045A924E6703AA15731C355" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_EmployeeStockOptionMember" xlink:label="loc_us-gaap_EmployeeStockOptionMember_2901D3F08265DC5B01003AA157317AD0" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementsByShareBasedPaymentAwardAwardTypeAndPlanNameDomain_313A34055045A924E6703AA15731C355" xlink:to="loc_us-gaap_EmployeeStockOptionMember_2901D3F08265DC5B01003AA157317AD0" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardFairValueAssumptionsExpectedTerm1" xlink:label="loc_us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardFairValueAssumptionsExpectedTerm1_14CDF60BC1B00871F3A23AA157329383" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_A8752755502C3DB0D8BF3AA15732AC22" xlink:to="loc_us-gaap_SharebasedCompensationArrangementBySharebasedPaymentAwardFairValueAssumptionsExpectedTerm1_14CDF60BC1B00871F3A23AA157329383" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsRiskFreeInterestRateMinimum" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsRiskFreeInterestRateMinimum_D811B3A788CA42AFBE033AA15732EF8C" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_A8752755502C3DB0D8BF3AA15732AC22" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsRiskFreeInterestRateMinimum_D811B3A788CA42AFBE033AA15732EF8C" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsRiskFreeInterestRateMaximum" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsRiskFreeInterestRateMaximum_2194498C4E24D21BAB413AA15732577D" xlink:type="locator" />
    <link:definitionArc order="3" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_A8752755502C3DB0D8BF3AA15732AC22" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsRiskFreeInterestRateMaximum_2194498C4E24D21BAB413AA15732577D" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedDividendRate" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedDividendRate_FE28DCFA28190F3243233AA15733FE72" xlink:type="locator" />
    <link:definitionArc order="4" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_A8752755502C3DB0D8BF3AA15732AC22" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedDividendRate_FE28DCFA28190F3243233AA15733FE72" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedVolatilityRateMinimum" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedVolatilityRateMinimum_39C82ABC929553F52CD03AA15733C72F" xlink:type="locator" />
    <link:definitionArc order="5" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_A8752755502C3DB0D8BF3AA15732AC22" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedVolatilityRateMinimum_39C82ABC929553F52CD03AA15733C72F" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedVolatilityRateMaximum" xlink:label="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedVolatilityRateMaximum_600879EBD442B97319053AA15733AFD7" xlink:type="locator" />
    <link:definitionArc order="6" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardLineItems_A8752755502C3DB0D8BF3AA15732AC22" xlink:to="loc_us-gaap_ShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsExpectedVolatilityRateMaximum_600879EBD442B97319053AA15733AFD7" xlink:type="arc" />
  </link:definitionLink>
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/ShareBasedCompensationTables" xlink:type="extended" />
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/SoftwareAndEquipment" xlink:type="extended" />
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/SoftwareAndEquipmentNarrativeDetails" xlink:type="extended" />
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/SoftwareAndEquipmentNetBalancesDetails" xlink:type="extended">
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_PropertyPlantAndEquipmentLineItems" xlink:label="loc_us-gaap_PropertyPlantAndEquipmentLineItems_650D218BF2D175F75E1C3AA156D50F06" xlink:type="locator" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ScheduleOfPropertyPlantAndEquipmentTable" xlink:label="loc_us-gaap_ScheduleOfPropertyPlantAndEquipmentTable_7B9E6C60C0076324D59C3AA156D33D87" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_PropertyPlantAndEquipmentLineItems_650D218BF2D175F75E1C3AA156D50F06" xlink:to="loc_us-gaap_ScheduleOfPropertyPlantAndEquipmentTable_7B9E6C60C0076324D59C3AA156D33D87" xlink:type="arc" xbrldt:closed="true" xbrldt:contextElement="segment" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_PropertyPlantAndEquipmentByTypeAxis" xlink:label="loc_us-gaap_PropertyPlantAndEquipmentByTypeAxis_C1DEFE8DBB6A012E2B593AA156D3289A" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfPropertyPlantAndEquipmentTable_7B9E6C60C0076324D59C3AA156D33D87" xlink:to="loc_us-gaap_PropertyPlantAndEquipmentByTypeAxis_C1DEFE8DBB6A012E2B593AA156D3289A" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_PropertyPlantAndEquipmentTypeDomain" xlink:label="loc_us-gaap_PropertyPlantAndEquipmentTypeDomain_27D02C22A147B853F84A3AA156D4AD8F_default" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_PropertyPlantAndEquipmentByTypeAxis_C1DEFE8DBB6A012E2B593AA156D3289A" xlink:to="loc_us-gaap_PropertyPlantAndEquipmentTypeDomain_27D02C22A147B853F84A3AA156D4AD8F_default" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_PropertyPlantAndEquipmentTypeDomain" xlink:label="loc_us-gaap_PropertyPlantAndEquipmentTypeDomain_27D02C22A147B853F84A3AA156D4AD8F" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_PropertyPlantAndEquipmentByTypeAxis_C1DEFE8DBB6A012E2B593AA156D3289A" xlink:to="loc_us-gaap_PropertyPlantAndEquipmentTypeDomain_27D02C22A147B853F84A3AA156D4AD8F" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_SoftwareAndSoftwareDevelopmentCostsMember" xlink:label="loc_us-gaap_SoftwareAndSoftwareDevelopmentCostsMember_AAEC1A07E9B7F7369B083AA156D4FF3C" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_PropertyPlantAndEquipmentTypeDomain_27D02C22A147B853F84A3AA156D4AD8F" xlink:to="loc_us-gaap_SoftwareAndSoftwareDevelopmentCostsMember_AAEC1A07E9B7F7369B083AA156D4FF3C" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_EquipmentMember" xlink:label="loc_us-gaap_EquipmentMember_8E064B73AEFE2CD6CC633AA156D4DBD2" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_PropertyPlantAndEquipmentTypeDomain_27D02C22A147B853F84A3AA156D4AD8F" xlink:to="loc_us-gaap_EquipmentMember_8E064B73AEFE2CD6CC633AA156D4DBD2" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_LeaseholdImprovementsMember" xlink:label="loc_us-gaap_LeaseholdImprovementsMember_E7D3A9B5D59CD092B7253AA156D434C8" xlink:type="locator" />
    <link:definitionArc order="3" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_PropertyPlantAndEquipmentTypeDomain_27D02C22A147B853F84A3AA156D4AD8F" xlink:to="loc_us-gaap_LeaseholdImprovementsMember_E7D3A9B5D59CD092B7253AA156D434C8" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_PropertyPlantAndEquipmentGross" xlink:label="loc_us-gaap_PropertyPlantAndEquipmentGross_41D56E75AE2192E1A5493AA156D59724" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_PropertyPlantAndEquipmentLineItems_650D218BF2D175F75E1C3AA156D50F06" xlink:to="loc_us-gaap_PropertyPlantAndEquipmentGross_41D56E75AE2192E1A5493AA156D59724" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_AccumulatedDepreciationDepletionAndAmortizationPropertyPlantAndEquipment" xlink:label="loc_us-gaap_AccumulatedDepreciationDepletionAndAmortizationPropertyPlantAndEquipment_E0C8747D9B0C8777D36C3AA156D5E135" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_PropertyPlantAndEquipmentLineItems_650D218BF2D175F75E1C3AA156D50F06" xlink:to="loc_us-gaap_AccumulatedDepreciationDepletionAndAmortizationPropertyPlantAndEquipment_E0C8747D9B0C8777D36C3AA156D5E135" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_PropertyPlantAndEquipmentNet" xlink:label="loc_us-gaap_PropertyPlantAndEquipmentNet_28D2CEC3C2465BE809253AA156D66F0F" xlink:type="locator" />
    <link:definitionArc order="3" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_PropertyPlantAndEquipmentLineItems_650D218BF2D175F75E1C3AA156D50F06" xlink:to="loc_us-gaap_PropertyPlantAndEquipmentNet_28D2CEC3C2465BE809253AA156D66F0F" xlink:type="arc" />
  </link:definitionLink>
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/SoftwareAndEquipmentTables" xlink:type="extended" />
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/SummaryOfAccountingPolicies" xlink:type="extended" />
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/SummaryOfAccountingPoliciesDetails" xlink:type="extended">
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_FiniteLivedIntangibleAssetsLineItems" xlink:label="loc_us-gaap_FiniteLivedIntangibleAssetsLineItems_5B59A61CFA5F3D0CB8FC3AA15AA1C633" xlink:type="locator" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ScheduleOfFiniteLivedIntangibleAssetsTable" xlink:label="loc_us-gaap_ScheduleOfFiniteLivedIntangibleAssetsTable_D46F043D34C2F9B013F93AA15A9B952A" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/all" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsLineItems_5B59A61CFA5F3D0CB8FC3AA15AA1C633" xlink:to="loc_us-gaap_ScheduleOfFiniteLivedIntangibleAssetsTable_D46F043D34C2F9B013F93AA15A9B952A" xlink:type="arc" xbrldt:closed="true" xbrldt:contextElement="segment" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ConcentrationRiskByTypeAxis" xlink:label="loc_us-gaap_ConcentrationRiskByTypeAxis_32C761DADF72785DB09A3AA15A9B6B28" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfFiniteLivedIntangibleAssetsTable_D46F043D34C2F9B013F93AA15A9B952A" xlink:to="loc_us-gaap_ConcentrationRiskByTypeAxis_32C761DADF72785DB09A3AA15A9B6B28" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ConcentrationRiskTypeDomain" xlink:label="loc_us-gaap_ConcentrationRiskTypeDomain_50124C8A5F69F3578D373AA15A9CB8DA_default" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_ConcentrationRiskByTypeAxis_32C761DADF72785DB09A3AA15A9B6B28" xlink:to="loc_us-gaap_ConcentrationRiskTypeDomain_50124C8A5F69F3578D373AA15A9CB8DA_default" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ConcentrationRiskTypeDomain" xlink:label="loc_us-gaap_ConcentrationRiskTypeDomain_50124C8A5F69F3578D373AA15A9CB8DA" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_ConcentrationRiskByTypeAxis_32C761DADF72785DB09A3AA15A9B6B28" xlink:to="loc_us-gaap_ConcentrationRiskTypeDomain_50124C8A5F69F3578D373AA15A9CB8DA" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_GeographicConcentrationRiskMember" xlink:label="loc_us-gaap_GeographicConcentrationRiskMember_9E7A2DFA5D37A228174D3AA15A9CFEEF" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ConcentrationRiskTypeDomain_50124C8A5F69F3578D373AA15A9CB8DA" xlink:to="loc_us-gaap_GeographicConcentrationRiskMember_9E7A2DFA5D37A228174D3AA15A9CFEEF" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ConcentrationRiskByBenchmarkAxis" xlink:label="loc_us-gaap_ConcentrationRiskByBenchmarkAxis_83E48467A560D32690AC3AA15A9C85FE" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfFiniteLivedIntangibleAssetsTable_D46F043D34C2F9B013F93AA15A9B952A" xlink:to="loc_us-gaap_ConcentrationRiskByBenchmarkAxis_83E48467A560D32690AC3AA15A9C85FE" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ConcentrationRiskBenchmarkDomain" xlink:label="loc_us-gaap_ConcentrationRiskBenchmarkDomain_73E113108A4C0F011FD73AA15A9DBAB7_default" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_ConcentrationRiskByBenchmarkAxis_83E48467A560D32690AC3AA15A9C85FE" xlink:to="loc_us-gaap_ConcentrationRiskBenchmarkDomain_73E113108A4C0F011FD73AA15A9DBAB7_default" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ConcentrationRiskBenchmarkDomain" xlink:label="loc_us-gaap_ConcentrationRiskBenchmarkDomain_73E113108A4C0F011FD73AA15A9DBAB7" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_ConcentrationRiskByBenchmarkAxis_83E48467A560D32690AC3AA15A9C85FE" xlink:to="loc_us-gaap_ConcentrationRiskBenchmarkDomain_73E113108A4C0F011FD73AA15A9DBAB7" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_RiskInForceClaimsMember" xlink:label="loc_nmih_RiskInForceClaimsMember_9C8912DA0827EB29C56E3AA15A9DB820" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_ConcentrationRiskBenchmarkDomain_73E113108A4C0F011FD73AA15A9DBAB7" xlink:to="loc_nmih_RiskInForceClaimsMember_9C8912DA0827EB29C56E3AA15A9DB820" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_PropertyPlantAndEquipmentByTypeAxis" xlink:label="loc_us-gaap_PropertyPlantAndEquipmentByTypeAxis_904C4E2D6A1651FAD1033AA15A9D322E" xlink:type="locator" />
    <link:definitionArc order="3" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfFiniteLivedIntangibleAssetsTable_D46F043D34C2F9B013F93AA15A9B952A" xlink:to="loc_us-gaap_PropertyPlantAndEquipmentByTypeAxis_904C4E2D6A1651FAD1033AA15A9D322E" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_PropertyPlantAndEquipmentTypeDomain" xlink:label="loc_us-gaap_PropertyPlantAndEquipmentTypeDomain_11955D7D043BB5A1ADCA3AA15A9EBB2A_default" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_PropertyPlantAndEquipmentByTypeAxis_904C4E2D6A1651FAD1033AA15A9D322E" xlink:to="loc_us-gaap_PropertyPlantAndEquipmentTypeDomain_11955D7D043BB5A1ADCA3AA15A9EBB2A_default" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_PropertyPlantAndEquipmentTypeDomain" xlink:label="loc_us-gaap_PropertyPlantAndEquipmentTypeDomain_11955D7D043BB5A1ADCA3AA15A9EBB2A" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_PropertyPlantAndEquipmentByTypeAxis_904C4E2D6A1651FAD1033AA15A9D322E" xlink:to="loc_us-gaap_PropertyPlantAndEquipmentTypeDomain_11955D7D043BB5A1ADCA3AA15A9EBB2A" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_SoftwareAndSoftwareDevelopmentCostsMember" xlink:label="loc_us-gaap_SoftwareAndSoftwareDevelopmentCostsMember_C049F69DCEE6A94DE0B23AA15A9E3FF3" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_PropertyPlantAndEquipmentTypeDomain_11955D7D043BB5A1ADCA3AA15A9EBB2A" xlink:to="loc_us-gaap_SoftwareAndSoftwareDevelopmentCostsMember_C049F69DCEE6A94DE0B23AA15A9E3FF3" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_EquipmentMember" xlink:label="loc_us-gaap_EquipmentMember_7E5E32F726E747F76D3E3AA15A9E3621" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_PropertyPlantAndEquipmentTypeDomain_11955D7D043BB5A1ADCA3AA15A9EBB2A" xlink:to="loc_us-gaap_EquipmentMember_7E5E32F726E747F76D3E3AA15A9E3621" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_RangeAxis" xlink:label="loc_srt_RangeAxis_CD8916141E5DD037A51C3AA15A9F51D2" xlink:type="locator" />
    <link:definitionArc order="4" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfFiniteLivedIntangibleAssetsTable_D46F043D34C2F9B013F93AA15A9B952A" xlink:to="loc_srt_RangeAxis_CD8916141E5DD037A51C3AA15A9F51D2" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_RangeMember" xlink:label="loc_srt_RangeMember_8E4A64850F6135D2A4FF3AA15A9F7B20_default" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_srt_RangeAxis_CD8916141E5DD037A51C3AA15A9F51D2" xlink:to="loc_srt_RangeMember_8E4A64850F6135D2A4FF3AA15A9F7B20_default" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_RangeMember" xlink:label="loc_srt_RangeMember_8E4A64850F6135D2A4FF3AA15A9F7B20" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_srt_RangeAxis_CD8916141E5DD037A51C3AA15A9F51D2" xlink:to="loc_srt_RangeMember_8E4A64850F6135D2A4FF3AA15A9F7B20" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_MinimumMember" xlink:label="loc_srt_MinimumMember_418C85145158EBC8FFDD3AA15A9F5468" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RangeMember_8E4A64850F6135D2A4FF3AA15A9F7B20" xlink:to="loc_srt_MinimumMember_418C85145158EBC8FFDD3AA15A9F5468" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/srt/2019/elts/srt-2019-01-31.xsd#srt_MaximumMember" xlink:label="loc_srt_MaximumMember_6D780021E406622B50E33AA15A9FB622" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_srt_RangeMember_8E4A64850F6135D2A4FF3AA15A9F7B20" xlink:to="loc_srt_MaximumMember_6D780021E406622B50E33AA15A9FB622" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_AdjustmentsForNewAccountingPronouncementsAxis" xlink:label="loc_us-gaap_AdjustmentsForNewAccountingPronouncementsAxis_2B872A499209649C230F3AA15AA0B9EE" xlink:type="locator" />
    <link:definitionArc order="5" xlink:arcrole="http://xbrl.org/int/dim/arcrole/hypercube-dimension" xlink:from="loc_us-gaap_ScheduleOfFiniteLivedIntangibleAssetsTable_D46F043D34C2F9B013F93AA15A9B952A" xlink:to="loc_us-gaap_AdjustmentsForNewAccountingPronouncementsAxis_2B872A499209649C230F3AA15AA0B9EE" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_TypeOfAdoptionMember" xlink:label="loc_us-gaap_TypeOfAdoptionMember_4FDD66D17C430CA6ECEA3AA15AA096FD_default" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-default" xlink:from="loc_us-gaap_AdjustmentsForNewAccountingPronouncementsAxis_2B872A499209649C230F3AA15AA0B9EE" xlink:to="loc_us-gaap_TypeOfAdoptionMember_4FDD66D17C430CA6ECEA3AA15AA096FD_default" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_TypeOfAdoptionMember" xlink:label="loc_us-gaap_TypeOfAdoptionMember_4FDD66D17C430CA6ECEA3AA15AA096FD" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/dimension-domain" xlink:from="loc_us-gaap_AdjustmentsForNewAccountingPronouncementsAxis_2B872A499209649C230F3AA15AA0B9EE" xlink:to="loc_us-gaap_TypeOfAdoptionMember_4FDD66D17C430CA6ECEA3AA15AA096FD" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_AccountingStandardsUpdate201602Member" xlink:label="loc_us-gaap_AccountingStandardsUpdate201602Member_B3A8B3F14113E8CCB6993AA15AA05105" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_TypeOfAdoptionMember_4FDD66D17C430CA6ECEA3AA15AA096FD" xlink:to="loc_us-gaap_AccountingStandardsUpdate201602Member_B3A8B3F14113E8CCB6993AA15AA05105" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_ConcentrationRiskPercentage1" xlink:label="loc_us-gaap_ConcentrationRiskPercentage1_404948C41797C629B8413AA15AA1E37B" xlink:type="locator" />
    <link:definitionArc order="1" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsLineItems_5B59A61CFA5F3D0CB8FC3AA15AA1C633" xlink:to="loc_us-gaap_ConcentrationRiskPercentage1_404948C41797C629B8413AA15AA1E37B" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_LiabilityforUnpaidClaimsandClaimsAdjustmentExpenseIncurredbutNotReportedIBNRClaimsDefaultPeriod" xlink:label="loc_nmih_LiabilityforUnpaidClaimsandClaimsAdjustmentExpenseIncurredbutNotReportedIBNRClaimsDefaultPeriod_3662575C8398FD7279C93AA15AA10A77" xlink:type="locator" />
    <link:definitionArc order="2" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsLineItems_5B59A61CFA5F3D0CB8FC3AA15AA1C633" xlink:to="loc_nmih_LiabilityforUnpaidClaimsandClaimsAdjustmentExpenseIncurredbutNotReportedIBNRClaimsDefaultPeriod_3662575C8398FD7279C93AA15AA10A77" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_DeferredPolicyAcquisitionCostAmortizationExpense" xlink:label="loc_us-gaap_DeferredPolicyAcquisitionCostAmortizationExpense_76B0C2DB51639E790CC53AA15AA1465C" xlink:type="locator" />
    <link:definitionArc order="3" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsLineItems_5B59A61CFA5F3D0CB8FC3AA15AA1C633" xlink:to="loc_us-gaap_DeferredPolicyAcquisitionCostAmortizationExpense_76B0C2DB51639E790CC53AA15AA1465C" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_PremiumDeficiencyReserveExpense" xlink:label="loc_nmih_PremiumDeficiencyReserveExpense_1B3530461C9C075689933AA15AA2DF40" xlink:type="locator" />
    <link:definitionArc order="4" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsLineItems_5B59A61CFA5F3D0CB8FC3AA15AA1C633" xlink:to="loc_nmih_PremiumDeficiencyReserveExpense_1B3530461C9C075689933AA15AA2DF40" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_PropertyPlantAndEquipmentUsefulLife" xlink:label="loc_us-gaap_PropertyPlantAndEquipmentUsefulLife_3103ED57549E1EB581773AA15AA2D0F3" xlink:type="locator" />
    <link:definitionArc order="5" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsLineItems_5B59A61CFA5F3D0CB8FC3AA15AA1C633" xlink:to="loc_us-gaap_PropertyPlantAndEquipmentUsefulLife_3103ED57549E1EB581773AA15AA2D0F3" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_ThresholdPeriodPastDueForWriteOffOfMortgageInsurancePremiumsReceivable" xlink:label="loc_nmih_ThresholdPeriodPastDueForWriteOffOfMortgageInsurancePremiumsReceivable_82EA01256CB85CC692083AA15AA24B3D" xlink:type="locator" />
    <link:definitionArc order="6" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsLineItems_5B59A61CFA5F3D0CB8FC3AA15AA1C633" xlink:to="loc_nmih_ThresholdPeriodPastDueForWriteOffOfMortgageInsurancePremiumsReceivable_82EA01256CB85CC692083AA15AA24B3D" xlink:type="arc" />
    <link:loc xlink:href="nmih-20191231.xsd#nmih_VariableInterestEntityNumberOfEntities" xlink:label="loc_nmih_VariableInterestEntityNumberOfEntities_434F308C645EF2C0F0193AA15AA2EF96" xlink:type="locator" />
    <link:definitionArc order="7" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsLineItems_5B59A61CFA5F3D0CB8FC3AA15AA1C633" xlink:to="loc_nmih_VariableInterestEntityNumberOfEntities_434F308C645EF2C0F0193AA15AA2EF96" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_OperatingLeaseRightOfUseAsset" xlink:label="loc_us-gaap_OperatingLeaseRightOfUseAsset_B2522BCE0096BAC6A7333AA15AA29AA5" xlink:type="locator" />
    <link:definitionArc order="8" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsLineItems_5B59A61CFA5F3D0CB8FC3AA15AA1C633" xlink:to="loc_us-gaap_OperatingLeaseRightOfUseAsset_B2522BCE0096BAC6A7333AA15AA29AA5" xlink:type="arc" />
    <link:loc xlink:href="http://xbrl.fasb.org/us-gaap/2019/elts/us-gaap-2019-01-31.xsd#us-gaap_OperatingLeaseLiability" xlink:label="loc_us-gaap_OperatingLeaseLiability_DDEDCD1F101AA9D019013AA15AA3D6A8" xlink:type="locator" />
    <link:definitionArc order="9" xlink:arcrole="http://xbrl.org/int/dim/arcrole/domain-member" xlink:from="loc_us-gaap_FiniteLivedIntangibleAssetsLineItems_5B59A61CFA5F3D0CB8FC3AA15AA1C633" xlink:to="loc_us-gaap_OperatingLeaseLiability_DDEDCD1F101AA9D019013AA15AA3D6A8" xlink:type="arc" />
  </link:definitionLink>
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/SummaryOfAccountingPoliciesPolicies" xlink:type="extended" />
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/Warrants" xlink:type="extended" />
  <link:definitionLink xlink:role="http://www.nationalmi.com/role/WarrantsDetails" xlink:type="extended" />
</link:linkbase>
