Wolfram Language

Richer Knowledgebase Access

Federal Deposit Insurance Corporation Institutional Data

The Federal Deposit Insurance Corporation (FDIC) is an independent US government agency charged with insuring deposits in US financial institutions. Presently, deposits in member institutions are insured up to $250,000. Here, the holdings, size distribution, and geographic dispersal of member institutions are explored.

First, load an entity store of FDIC data as a ResourceObject.

In[1]:=
Click for copyable input
fdic = ResourceData[ ResourceObject[ Association[ "Name" -> "FDIC Institution EntityStore", "UUID" -> "6f5d37d4-1406-483c-b67c-f58d903d16b1", "ResourceType" -> "DataResource", "Version" -> "1.0.0", "Description" -> "A Wolfram Language EntityStore with selected \ data on FDIC insured institutions", "ContentSize" -> Quantity[0, "Bytes"], "ContentElements" -> {"EntityStore"}]]]
Out[1]=

Register the store for this session.

In[2]:=
Click for copyable input
PrependTo[$EntityStores, fdic];

Count the number of FDIC institutions.

In[3]:=
Click for copyable input
Length[ents = EntityList["FDICInstitution"]]
Out[3]=

List some of the available properties of the entity store.

In[4]:=
Click for copyable input
EntityProperties["FDICInstitution"] // Sort // Take[#, 20] &
Out[4]=

Visualize the geographic locations of FDIC-affiliated banks.

In[5]:=
Click for copyable input
GeoListPlot[EntityList["FDICInstitution"], PlotMarkers -> "$"]
Out[5]=

Display the rank distribution in a log-log plot.

In[6]:=
Click for copyable input
ListLogLogPlot[ Reverse@Sort[EntityValue["FDICInstitution", "TotalAssets"]], AxesLabel -> Automatic, PlotStyle -> PointSize[Medium]]
Out[6]=

Plot employees vs. assets.

In[7]:=
Click for copyable input
empVsAssets = EntityValue[ "FDICInstitution", {"TotalEmployeeNumber", "TotalAssets"}];
In[8]:=
Click for copyable input
ListLogLogPlot[empVsAssets, AxesLabel -> Automatic]
Out[8]=

Label the six largest institutions.

show complete Wolfram Language input
In[9]:=
Click for copyable input
ListLogLogPlot[ Callout[{#2, #3}, #1] & @@@ EntityValue[ EntityList[ EntityClass["FDICInstitution", "TotalAssets" -> TakeLargest[6]]], {"Label", "TotalEmployeeNumber", "TotalAssets"}], PlotRangePadding -> Scaled[0.25], AxesLabel -> {"employee count", "assets"}]
Out[9]=

Plot liabilities vs. assets.

In[10]:=
Click for copyable input
assetsVsLiability = EntityValue["FDICInstitution", {"TotalAssets", "TotalLiabilities"}];
In[11]:=
Click for copyable input
ListLogLogPlot[assetsVsLiability, AxesLabel -> Automatic]
Out[11]=

Plot net loans and leases vs. total deposits together with a fit.

In[12]:=
Click for copyable input
loanVsDeposit = EntityValue[ "FDICInstitution", {"NetLoansAndLeases", "TotalDeposits"}];
In[13]:=
Click for copyable input
nmf = NonlinearModelFit[ Select[QuantityMagnitude /@ loanVsDeposit, Min[#] > 0 &], c + a x^\[Alpha], {a, \[Alpha], c}, x]
Out[13]=
In[14]:=
Click for copyable input
Show[ListPlot[loanVsDeposit], Plot[Evaluate[Normal[nmf]], {x, 0, 10^10}, PlotStyle -> Red, AxesLabel -> Automatic]]
Out[14]=

Compare Tier 1 (secure) and Tier 2 capital (riskier) to total assets.

In[15]:=
Click for copyable input
{tierOneCapitalToAssets, tierTwoCapitalToAssetsCapitalToAssets} = (Divide @@@ EntityValue[ "FDICInstitution", {#, "TotalAssets"}]) & /@ {"TierOneCapital", "TierTwoRiskBasedCapital"};
In[16]:=
Click for copyable input
Histogram[{tierOneCapitalToAssets, tierTwoCapitalToAssetsCapitalToAssets}, {0, 0.3, 0.01}, ChartLegends -> {"Tier 1", "Tier 2"}, PlotLabel -> "Capital/Assets Ratio"]
Out[16]=

Retrieve the distribution of assets as an "EntityAssociation".

In[17]:=
Click for copyable input
dat = EntityValue["FDICInstitution", "TotalAssets", "EntityAssociation"];

Plot the distribution of assets.

In[18]:=
Click for copyable input
Histogram[dat, "Log", AxesLabel -> Automatic]
Out[18]=

Display locations of banks with assets more than 5 billion and 300 billion dollars.

In[19]:=
Click for copyable input
GeoListPlot[ Keys[Select[dat, GreaterThan[Quantity[#, "USDollars"]]]]] & /@ {5*^9, 300*^9}
Out[19]=

Graphically discover that the top 10 banks hold more assets than the remaining 6121 combined.

show complete Wolfram Language input
In[20]:=
Click for copyable input
With[{atas = QuantityMagnitude[ EntityValue["FDICInstitution", EntityProperty["FDICInstitution", "AverageTotalAssets"]]]}, ListLogLogPlot[100 Accumulate[Reverse[Sort[atas]]]/Total[atas], PlotRange -> All, GridLines -> Automatic, PlotStyle -> PointSize[Medium], AxesLabel -> {None, Quantity[None, "Percent"]}]]
Out[20]=

Find banks with the highest 1% of deposits.

In[21]:=
Click for copyable input
dat1 = EntityValue["FDICInstitution", "TotalDeposits", "EntityAssociation"];
In[22]:=
Click for copyable input
{bottom1percent, top1percent} = Quantile[values = Values[dat1], {0.01, 0.99}]
Out[22]=

Plot them on a map.

In[23]:=
Click for copyable input
GeoListPlot[Keys[Select[dat1, GreaterThan[top1percent]]]]
Out[23]=

The distribution of the assets per city fulfills Benford's law to a remarkable degree.

show complete Wolfram Language input
In[24]:=
Click for copyable input
$percity = Reverse[SortBy[{#[[1, 1]], Total[#[[All, -1]]]} & /@ Normal[Normal[ DeleteMissing[ SortBy[GroupBy[ EntityValue["FDICInstitution", {"City", "TotalAssets"}], First] , Length], 1, 3]][[All, -1]]], Last]];
In[25]:=
Click for copyable input
ListPlot[{Tally[ IntegerDigits[Round[QuantityMagnitude[#2]]][[1]] & @@@ $percity], Table[{d, Length[$percity] Log10[1 + 1/d]}, {d, 1, 9}]}, PlotRange -> All, Filling -> Axis, PlotLegends -> {"total assets", "Benford"}]
Out[25]=

Show banks with the greatest financial leverage.

show complete Wolfram Language input
In[26]:=
Click for copyable input
dataSet3 = Append[#, <| "FinancialLeverage" -> N[#TotalLiabilities/#TotalEquity]|>] & /@ EntityValue[ "FDICInstitution", {"Position", "TotalLiabilities", "TotalEquity"}, "Dataset"];
In[27]:=
Click for copyable input
dataSet3[TakeLargestBy["FinancialLeverage", 10]]
Out[27]=

Plot the distribution of the financial leverages.

In[28]:=
Click for copyable input
Histogram[dataSet3[All, "FinancialLeverage"], {0, 20, 0.5}, PlotLabel -> "FDIC banks Financial Leverage distribution"]
Out[28]=

Graphically explore the relationship among assets, long-term assets, and liabilities.

show complete Wolfram Language input
In[29]:=
Click for copyable input
props = {EntityProperty["FDICInstitution", "TotalAssets"], EntityProperty["FDICInstitution", "LongTermAssets"], EntityProperty["FDICInstitution", "TotalLiabilities"]}; data = Select[ N@QuantityMagnitude@ DeleteMissing[ EntityValue["FDICInstitution", Append[props, "Entity"]], 1, 2], Min[Most[#]] > 0 &];
In[30]:=
Click for copyable input
data2 = Select[{#1/#2, #1/#3, #4} & @@@ data, Between[{0, 15}][#[[1]]] && Between[{1, 1.4}][#[[2]]] &];
In[31]:=
Click for copyable input
sdk = SmoothKernelDistribution[Most /@ data2];
In[32]:=
Click for copyable input
label[{a_, b_, c_, _[d_]}] := Column[{d, Grid[Transpose[{props, Quantity[NumberForm[#, 4], "USDollars"] & /@ {a, b, c}}], Dividers -> Center]}]
In[33]:=
Click for copyable input
ContourPlot[PDF[sdk, {x, y}], {x, 0, 15}, {y, 1, 1.4}, PlotRange -> All, Contours -> 50, ContourStyle -> None, ColorFunction -> (Lighter[ColorData["AvocadoColors"][#], 0.5] &), FrameLabel -> {"total asssets"/"long term assets", "total asssets"/"total liabilities"}, Epilog -> ({ColorData["DarkRainbow"][(Log10[#1] - 7)/5], PointSize[0.00125], Point[{#1/#2, #1/#3}]} & @@@ data)]
Out[33]=

Related Examples

de es ja ko pt-br ru zh