Skip to content
View canarionyc's full-sized avatar

Block or report canarionyc

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Please don't include any personal information such as legal names or email addresses. Maximum 100 characters, markdown supported. This note will be visible to only you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
canarionyc/README.md

Overview

US Mortgage-Backed Securities (MBS) is a $7.3 trillion market composed of 1M pools of Prime Real State loans guaranteed by:

FNMA_PoolView

FNMA_PoolView is a shiny app that displays Fannie Mae, Freddie Mac and Ginnie Mae guaranteed pool and loan characteristics on a pool by pool basis.

The upper region selects the agency as above and the reporting month (for demonstration, a random sample pool is loaded each time). Below are two tabs, one for viewing single pools and one for cohorts or aggregations.

Pool Viewer

For individual pools, containing the subtabs:

Security Identifier Input and Pool Summary

For entering a single pool and displaying it's main characteristics, including it's geographical dispersion.

Pool Detailed Information

For displaying all information disclosed by the source plus some calculated fields like prepayment speeds.

Generic Product Characteristics

Adjustable Rate Mortgage (ARM) Specific

ARM-specific information in case the pool is an ARM.

Stratifications

Supplemental information about the pool

Loan Level Information

Displays loan level information for the pool when available.

Cohort Viewer

Displays aggregations and analytics (prepayment rates) on the cohorts

Aggregations by Prefix

Aggregations by Prefix and Coupon

Aggregations on filtered data

Implementation

Data in AWS S3

Input data files

The publicly available data files monthly provided by the agencies are stored in Amazon Web Services (AWS) S3 file hosting platform. The list of buckets created is:

##                                  Bucket             CreationDate
## 1          fhlmc-mbs-sf-arm-singleclass 2021-01-26T18:23:19.000Z
## 2  fhlmc-mbs-sf-arm-singleclass-datadir 2021-04-20T16:38:38.000Z
## 3              fhlmc-mbs-sf-singleclass 2021-01-09T11:40:48.000Z
## 4      fhlmc-mbs-sf-singleclass-datadir 2021-04-20T16:39:09.000Z
## 5                       fnma-llp-2020q4 2021-04-28T16:11:13.000Z
## 6               fnma-mbs-sf-singleclass 2020-10-27T05:57:35.000Z
## 7       fnma-mbs-sf-singleclass-datadir 2021-04-20T16:37:45.000Z
## 8                             gnma-hmbs 2021-01-09T11:51:03.000Z
## 9                     gnma-hmbs-datadir 2021-04-18T12:35:03.000Z
## 10              gnma-mbs-sf-singleclass 2020-12-25T05:57:33.000Z
## 11      gnma-mbs-sf-singleclass-datadir 2021-04-15T18:07:20.000Z
## 12                              test-tg 2021-02-09T18:27:34.000Z

For example, the first Fannie Mae monthly factor files is:

## Bucket: fnma-mbs-sf-singleclass-datadir 
## 
## $Contents
## Key:            FNM_MF_201910.zip 
## LastModified:   2021-04-20T16:43:00.000Z 
## ETag:           "d7cfe52c7a07971021f5de1f74e6dcfb-4" 
## Size (B):       31689689 
## Owner:          3ed8938a6ec6ccbf8e5544fed9c6be5f74559d6d28ddeda9375f52176205d37b 
## Storage class:  STANDARD

Processed data files

The input files are parsed and stored in binary format in AWS S3:

## Bucket: fnma-mbs-sf-singleclass 
## 
## $Contents
## Key:            FNM_MF_201910.fst 
## LastModified:   2020-10-27T06:05:25.000Z 
## ETag:           "ff8565f0ec8dea21ec118c0bb72433c1-4" 
## Size (B):       32205844 
## Owner:          3ed8938a6ec6ccbf8e5544fed9c6be5f74559d6d28ddeda9375f52176205d37b 
## Storage class:  STANDARD

R packages developed

Package loanroll

Package loanroll processes Fannie Mae and Freddie Mac MBS pools.

Examples of its use are:

FNMA Aggregations

The MonthlyFactorDataset object is loaded from AWS S3

# devtools::load_all("~/Finance/FNMA/loanroll", reset = TRUE, recompile = FALSE, export_all = FALSE)

Factor_Date <- "2021-04-01"
args.lst <- list(Factor_Date = Factor_Date, bucket_name=fn_mbs_sf_bucket, verbose = FALSE)

MF <- tryCatch( 
  do.call(MonthlyFactorDataset, args.lst)
  , error = function(e) e
)
if(inherits(MF, "error")) {
  stop(conditionMessage(MF))
}

Then monthly aggregations are made. For example, for FNCL:

FNCL <- subset(MF, subset = quote(Prefix=="CL" & Seller_Name != "SCR" & WA_Net_Interest_Rate %in% seq(1,15,0.5) & Security_Factor_Date == Factor_Date))
FNCL_stats <- aggregate(FNCL, by.vars=c('Prefix'))
saveRDS(FNCL_stats, "FNCL_stats.Rds")

FNCL_Coupon_stats <- aggregate(FNCL, by.vars=c('Prefix', 'WA_Net_Interest_Rate'))
saveRDS(FNCL_Coupon_stats, "FNCL_Coupon_stats.Rds")

FNMA by Prefix

Security Factor Date Prefix Pool Count Loan Count Issuance Investor Security UPB Current Investor Security UPB Average Mortgage Loan Amount Prior Month Investor Security UPB Delinquent Loans Purchased Loan Count Delinquent Loans Purchased Prior Month UPB UPB of Delinquent Loans Purchased as % of Prior Month UPB SMM Vol SMM CPR1 Vol CPR1 WA Net Interest Rate WA Issuance Interest Rate WA Current Interest Rate WA Loan Term WA Issuance Remaining Months to Maturity WA Current Remaining Months to Maturity WA Loan Age WA Mortgage Loan Amount WA Loan To Value LTV WA Combined Loan To Value CLTV WA Debt To Income DTI WA Borrower Credit Score
2021-04-01 CL 325,457 11,448,610 $9,228,990.83M $2,369,072.95M $227.97k $2,356,210.77M 2,321 $526.91M 0.02% 3.73% 3.71% 36.63% 36.46% 2.992959 3.738501 3.734869 358.2367 357.4272 315.0461 38.33834 $301.72k 74.62100 75.55243 34.78166 751.0651
2021-03-01 CL 324,554 11,444,363 $9,131,366.73M $2,356,210.76M $227.05k $2,348,268.40M 2,161 $486.31M 0.02% 3.26% 3.24% 32.77% 32.61% 3.044281 3.789062 3.785369 358.2499 357.4108 313.9460 39.33150 $300.14k 74.87597 75.83824 34.82623 750.8295

FNMA by Prefix and Coupon

Security Factor Date Prefix WA Net Interest Rate Pool Count Loan Count Issuance Investor Security UPB Current Investor Security UPB Average Mortgage Loan Amount Prior Month Investor Security UPB Delinquent Loans Purchased Loan Count Delinquent Loans Purchased Prior Month UPB UPB of Delinquent Loans Purchased as % of Prior Month UPB SMM Vol SMM CPR1 Vol CPR1 WA Issuance Interest Rate WA Current Interest Rate WA Loan Term WA Issuance Remaining Months to Maturity WA Current Remaining Months to Maturity WA Loan Age WA Mortgage Loan Amount WA Loan To Value LTV WA Combined Loan To Value CLTV WA Debt To Income DTI WA Borrower Credit Score
2021-03-01 CL 1.0 1 87 $34.60M $34.53M $398.26k $0.00M 0 $0.00M NaN NaN NaN NA NA 1.998000 1.998000 360.0000 359.0000 358.00000 2.000000 $432.19k 63.00000 63.00000 30.00000 775.0000
2021-03-01 CL 1.5 399 196,451 $72,245.21M $71,258.98M $366.16k $60,971.78M 2 $0.70M 0.00% 0.26% 0.26% 3.07% 3.05% 2.522875 2.522784 358.6244 358.3979 354.36552 3.402709 $402.48k 69.41803 69.87244 32.07098 773.4760
2021-03-01 CL 2.0 5,180 1,633,407 $517,334.38M $500,989.26M $310.09k $442,904.78M 24 $7.77M 0.00% 0.79% 0.79% 9.09% 9.07% 2.900185 2.899735 357.2259 357.0727 351.69263 4.466349 $361.16k 72.28677 72.69811 33.52361 764.1994
2021-03-01 CL 2.5 8,452 1,455,790 $479,533.90M $394,745.42M $277.61k $394,707.63M 100 $31.05M 0.01% 3.10% 3.09% 31.45% 31.39% 3.369339 3.367894 357.1517 356.9270 346.01310 9.584970 $335.36k 74.44050 75.00970 34.51401 754.7412
2021-03-01 CL 3.0 24,839 2,185,551 $1,038,367.59M $471,944.77M $243.61k $492,940.85M 315 $87.59M 0.02% 4.57% 4.56% 42.99% 42.87% 3.730473 3.723397 358.7244 357.8657 304.91701 47.198036 $296.41k 75.01405 76.10566 34.45550 756.1281
2021-03-01 CL 3.5 45,889 2,175,955 $1,241,408.03M $400,207.45M $210.23k $419,435.93M 440 $105.65M 0.03% 4.45% 4.43% 42.11% 41.94% 4.125822 4.117385 358.9634 358.0704 291.97264 59.045811 $266.49k 76.56051 78.15568 35.56514 748.1864
2021-03-01 CL 4.0 49,963 1,837,177 $1,216,961.51M $298,731.07M $186.61k $311,977.42M 583 $135.32M 0.04% 4.11% 4.07% 39.58% 39.26% 4.581577 4.579591 359.0817 358.0017 290.41030 60.949441 $245.93k 77.43010 79.46605 36.92456 735.8703
2021-03-01 CL 4.5 34,895 924,072 $834,293.88M $129,379.35M $164.62k $134,198.12M 345 $70.01M 0.05% 3.42% 3.37% 34.14% 33.73% 5.045403 5.042748 359.0731 357.6818 280.38339 70.717708 $224.50k 77.15081 80.66895 38.20394 725.2853
2021-03-01 CL 5.0 28,992 398,703 $779,815.94M $44,466.60M $148.46k $45,790.39M 156 $27.48M 0.06% 2.63% 2.57% 27.38% 26.86% 5.558441 5.558431 358.7557 354.8190 238.45257 111.466885 $203.71k 76.33370 81.86118 38.78404 716.3682
2021-03-01 CL 5.5 35,438 277,931 $1,066,998.75M $22,627.62M $128.45k $23,105.11M 81 $9.12M 0.04% 1.68% 1.64% 18.36% 17.98% 6.014014 6.006674 358.8279 351.8735 170.78338 177.466159 $172.63k 73.14392 86.95979 39.37270 712.4445
2021-03-01 CL 6.0 34,801 191,518 $857,616.87M $13,871.07M $113.31k $14,133.36M 72 $8.17M 0.06% 1.46% 1.40% 16.14% 15.56% 6.538444 6.536206 359.0816 350.5908 164.42026 183.768340 $156.84k 75.47805 87.72229 39.32766 702.4860
2021-03-01 CL 6.5 26,356 97,653 $533,356.97M $5,369.18M $92.96k $5,467.78M 24 $2.22M 0.04% 1.32% 1.28% 14.75% 14.33% 7.027018 7.018079 359.2293 350.7622 151.86071 196.342980 $130.13k 77.95809 76.83387 37.08122 692.9345
2021-03-01 CL 7.0 15,513 45,348 $254,338.92M $1,912.31M $79.42k $1,945.79M 17 $1.16M 0.06% 1.10% 1.04% 12.47% 11.84% 7.591427 7.592328 359.2958 344.5909 137.83233 210.577593 $112.47k 79.50689 80.58918 37.96332 677.8421
2021-03-01 CL 7.5 7,436 13,907 $123,967.19M $428.36M $73.23k $438.55M 1 $0.01M 0.00% 1.35% 1.35% 15.09% 15.06% 8.090334 8.085941 359.6637 352.1710 106.19800 243.110294 $100.13k 79.84490 NaN NaN 675.4632
2021-03-01 CL 8.0 4,123 7,339 $70,978.73M $180.00M $67.46k $184.37M 1 $0.04M 0.02% 1.11% 1.09% 12.50% 12.27% 8.571817 8.572541 359.6911 348.0036 88.43777 261.267168 $90.60k 80.38183 NaN NaN 674.2447
2021-03-01 CL 8.5 1,557 2,489 $27,907.51M $49.23M $63.03k $50.46M 0 $0.00M 0.00% 0.81% 0.81% 9.32% 9.32% 9.060547 9.048885 359.6495 346.1897 76.05706 273.697454 $82.02k 80.43774 NaN NaN 663.2073
2021-03-01 CL 9.0 557 767 $14,404.26M $12.12M $58.75k $12.50M 0 $0.00M 0.00% 0.87% 0.87% 10.00% 10.00% 9.604630 9.595275 359.9643 340.0468 69.20074 282.708612 $76.96k 77.35563 NaN NaN 659.6906
2021-03-01 CL 9.5 123 161 $1,661.87M $2.07M $61.07k $2.14M 0 $0.00M 0.00% 0.34% 0.34% 4.05% 4.05% 10.032182 10.016801 360.0000 313.8999 50.58345 302.985081 $70.33k 71.71187 NaN NaN 647.4169
2021-03-01 CL 10.0 32 42 $132.52M $1.07M $60.55k $1.08M 0 $0.00M 0.00% 0.26% 0.26% 3.11% 3.11% 10.998697 10.905728 360.0000 252.0254 85.54233 262.834035 $82.90k 78.49586 NaN NaN 648.3908
2021-03-01 CL 10.5 6 10 $5.48M $0.22M $42.20k $0.23M 0 $0.00M 0.00% 0.05% 0.05% 0.57% 0.57% 11.488564 11.615880 358.3760 292.9621 89.48868 263.428647 $49.10k 75.30922 NaN NaN 615.5205
2021-03-01 CL 11.5 2 5 $2.60M $0.10M $44.80k $0.10M 0 $0.00M 0.00% 0.27% 0.27% 3.23% 3.23% 12.520445 12.964280 360.0000 198.8194 81.53406 275.460116 $77.33k 68.06407 NaN NaN 637.8253
2021-04-01 CL 1.0 1 87 $34.60M $34.45M $398.26k $34.53M 0 $0.00M 0.00% 0.03% 0.03% 0.40% 0.40% 1.998000 1.998000 360.0000 359.0000 357.00000 3.000000 $432.21k 63.00000 63.00000 30.00000 775.0000
2021-04-01 CL 1.5 465 225,281 $82,751.80M $81,364.11M $365.18k $71,258.98M 2 $0.74M 0.00% 0.33% 0.33% 3.87% 3.86% 2.515947 2.515864 358.7862 358.4778 353.93638 3.975827 $403.36k 69.17549 69.57715 32.06899 773.4602
2021-04-01 CL 2.0 5,956 1,831,107 $579,368.82M $557,758.39M $308.47k $500,989.26M 27 $8.22M 0.00% 0.84% 0.84% 9.61% 9.59% 2.887894 2.887307 357.3692 357.2170 351.32565 4.963815 $360.60k 72.04653 72.59775 33.55608 763.9490
2021-04-01 CL 2.5 9,178 1,529,252 $506,246.63M $407,940.35M $273.04k $394,745.42M 110 $31.61M 0.01% 3.24% 3.24% 32.68% 32.61% 3.349255 3.347396 357.1612 356.9354 345.70915 9.892161 $332.38k 74.33303 74.84611 34.56590 753.9724
2021-04-01 CL 3.0 25,085 2,111,124 $1,044,285.13M $451,917.14M $241.69k $471,944.77M 310 $90.06M 0.02% 5.31% 5.29% 48.05% 47.93% 3.725691 3.718372 358.7156 357.8699 304.29637 47.711460 $294.57k 74.94254 76.02008 34.50842 755.5076
2021-04-01 CL 3.5 45,879 2,086,749 $1,241,467.01M $377,578.20M $208.76k $400,207.45M 502 $121.50M 0.03% 5.50% 5.47% 49.30% 49.12% 4.124433 4.115988 358.9530 358.0587 290.59762 60.228983 $264.64k 76.48784 78.08321 35.57366 747.9546
2021-04-01 CL 4.0 49,918 1,760,002 $1,216,921.15M $282,895.27M $185.14k $298,731.07M 607 $141.54M 0.05% 5.15% 5.11% 46.98% 46.68% 4.580607 4.578899 359.0651 357.9847 288.93154 62.244141 $244.36k 77.33248 79.39866 36.93571 735.5847
2021-04-01 CL 4.5 34,825 891,257 $834,080.62M $123,372.53M $163.53k $129,379.35M 411 $86.12M 0.07% 4.46% 4.40% 42.16% 41.69% 5.044122 5.041644 359.0604 357.6591 278.79764 72.129460 $223.10k 77.06803 80.61290 38.21608 725.1449
2021-04-01 CL 5.0 28,900 387,901 $779,367.20M $42,848.03M $147.88k $44,466.60M 181 $29.71M 0.07% 3.38% 3.31% 33.77% 33.24% 5.557565 5.557734 358.7497 354.7820 236.66122 113.129369 $202.81k 76.26976 81.86858 38.79241 716.2600
2021-04-01 CL 5.5 35,312 272,606 $1,066,006.75M $22,025.75M $128.22k $22,627.62M 82 $10.51M 0.05% 2.26% 2.22% 24.00% 23.58% 6.013756 6.006554 358.8376 351.8566 169.42202 178.792563 $172.22k 73.10134 86.85762 39.38280 712.3695
2021-04-01 CL 6.0 34,652 188,291 $856,179.66M $13,556.05M $113.17k $13,871.07M 50 $4.49M 0.03% 1.87% 1.84% 20.26% 19.95% 6.538508 6.536367 359.0858 350.5849 163.34559 184.834157 $156.62k 75.46028 87.50948 39.37238 702.3712
2021-04-01 CL 6.5 26,191 96,130 $531,392.92M $5,256.50M $92.91k $5,369.18M 26 $1.72M 0.03% 1.61% 1.58% 17.72% 17.41% 7.027103 7.018315 359.2352 350.7691 150.94943 197.261552 $130.05k 77.96643 76.64501 37.07890 692.8244
2021-04-01 CL 7.0 15,407 44,599 $253,421.44M $1,870.37M $79.38k $1,912.31M 9 $0.52M 0.03% 1.57% 1.55% 17.32% 17.05% 7.591584 7.592719 359.3074 344.5586 136.95166 211.492033 $112.15k 79.50163 80.56304 37.97165 677.7282
2021-04-01 CL 7.5 7,373 13,676 $123,297.88M $417.84M $73.22k $428.36M 2 $0.02M 0.00% 1.47% 1.47% 16.30% 16.26% 8.091108 8.086396 359.6697 352.2709 105.59774 243.760773 $99.85k 79.90068 NaN NaN 675.3450
2021-04-01 CL 8.0 4,090 7,182 $70,711.44M $175.14M $67.50k $180.00M 1 $0.11M 0.06% 1.42% 1.36% 15.81% 15.19% 8.571501 8.572356 359.6920 347.9735 88.08478 261.727097 $90.66k 80.35714 NaN NaN 674.0615
2021-04-01 CL 8.5 1,532 2,423 $27,780.57M $47.80M $63.11k $49.23M 0 $0.00M 0.00% 1.26% 1.26% 14.11% 14.11% 9.061371 9.049684 359.6512 346.3758 75.85340 274.022499 $82.21k 80.51380 NaN NaN 662.9287
2021-04-01 CL 9.0 533 731 $13,512.98M $11.68M $58.74k $12.12M 1 $0.05M 0.38% 1.56% 1.18% 17.18% 13.24% 9.605170 9.595721 359.9636 339.7886 68.65398 283.202280 $77.18k 77.27312 NaN NaN 660.2908
2021-04-01 CL 9.5 119 157 $1,940.46M $2.00M $60.27k $2.07M 0 $0.00M 0.00% 0.34% 0.34% 3.99% 3.99% 10.034148 10.018824 360.0000 313.4129 50.42586 303.144400 $69.85k 71.80025 NaN NaN 646.8017
2021-04-01 CL 10.0 33 40 $215.67M $1.05M $58.65k $1.07M 0 $0.00M 0.00% 0.22% 0.22% 2.66% 2.66% 11.000837 10.906985 360.0000 251.8243 84.87770 263.471327 $82.96k 78.51716 NaN NaN 648.2595
2021-04-01 CL 10.5 6 10 $5.48M $0.22M $42.20k $0.22M 0 $0.00M 0.00% 0.05% 0.05% 0.56% 0.56% 11.488437 11.615823 358.4111 293.2497 88.65276 264.294706 $49.09k 75.29300 NaN NaN 615.6072
2021-04-01 CL 11.5 2 5 $2.60M $0.10M $44.80k $0.10M 0 $0.00M 0.00% 0.34% 0.34% 4.00% 4.00% 12.521566 12.967240 360.0000 198.9497 80.87007 276.128302 $77.69k 68.01786 NaN NaN 637.9513

Package gnmar

Package gnmar processes Ginnie Mae pools.

Examples of its use are:

GNMA Aggregations

A GinnieMBS object is loaded from AWS S3

options(verbose = FALSE)

readRenviron("~/Finance/GNMA/.Renviron")
# devtools::load_all("~/Finance/GNMA/gnmar", reset = TRUE, recompile = FALSE, export_all = FALSE)
remotes::install_github("canarionyc/gnmar",
#                        dependencies = FALSE,
                        force = FALSE,
quiet = TRUE
)
library(gnmar)

As_of_Date <- as.Date("2021-03-01")

args.lst <- list(
  As_of_Date = As_of_Date
 #                , mf_zip=mf_zip
  #              ,  bucket_name = gnma_mbs_sf_bucket
  , overwrite = TRUE
  , verbose = FALSE)

ginnieMBS <- do.call(GinnieMBS, args.lst)
# show(ginnieMBS)
GNMA by Prefix
GNSF <- subset(ginnieMBS, subset=quote(Pool_Indicator=="X" & 
                                         Pool_Type=="SF" &  
                                         Issuer_Number!=9999 & 
                                         Security_Interest_Rate %in% seq(0.5, 11, by=0.5)))
# print(summary(GNSF))
GNSF_stats <- aggregate(GNSF, xvar=NULL,  by.vars=c('Pool_Indicator', 'Pool_Type' )
                        , verbose=FALSE
                          )
saveRDS(GNSF_stats, "GNSF_stats.Rds")
grouping Pool Indicator Pool Type Pool Count Loan Count Original Aggregate Amount Remaining Security RPB WA Interest Rate WAC WA Remaining Months to Maturity WARM WA Loan Age WALA WA Original Loan Term WAOLT WA Loan to Value LTV WA Combined Loan to Value CLTV Average Original Loan Size AOLS WA Original Loan Size SMM CPR
0 X SF 110,852 908,889 $1,487,953.60M $84,506.02M 4.663627 225.3691 118.0795 351.7355 93.6614 93.76855 $129.53k $174.20k 2.63% 27.35%
GNMA by Prefix and Coupon
# GNSF_Coupon <- subset(GNSF, subset=quote(Pool_Indicator=="X" & Pool_Type=="SF" &  Issuer_Number!=9999 & Security_Interest_Rate %in% seq(0.5, 11, by=0.5)))
# print(summary(GNSF))
GNSF_stats.by_Coupon <- aggregate(GNSF, xvar=NULL
                        , by.vars=c('Pool_Indicator', 'Pool_Type', 'Security_Interest_Rate' )
                        , verbose=FALSE
                          )
if( "grouping" %in% names(GNSF_stats.by_Coupon)) {
  GNSF_stats.by_Coupon <- GNSF_stats.by_Coupon[ ,-c("grouping")]
}
Pool Indicator Pool Type Security Interest Rate Pool Count Loan Count Original Aggregate Amount Remaining Security RPB WA Interest Rate WAC WA Remaining Months to Maturity WARM WA Loan Age WALA WA Original Loan Term WAOLT WA Loan to Value LTV WA Combined Loan to Value CLTV Average Original Loan Size AOLS WA Original Loan Size SMM CPR
X SF 0.5 14 21 $4.53M $2.29M 1.0 260.00827 97.91486 360.0000 97.70073 97.70073 $145.54k $167.30k NA NA
X SF 1.5 10 11 $3.44M $1.41M 2.0 275.85991 82.79307 360.0000 97.00713 97.00713 $157.03k $170.97k 8.27% 64.50%
X SF 2.0 84 849 $199.94M $80.06M 2.5 250.09135 64.20866 319.3977 94.37038 94.76439 $132.67k $159.95k 1.48% 16.43%
X SF 2.5 962 21,189 $7,528.79M $2,373.65M 3.0 230.19092 75.71713 312.6004 92.18259 92.33868 $164.19k $216.19k 2.04% 21.87%
X SF 3.0 5,438 125,394 $59,323.56M $15,687.61M 3.5 255.69748 83.86707 346.7783 93.91753 94.03778 $161.78k $210.66k 3.05% 31.04%
X SF 3.5 7,186 121,756 $69,278.09M $13,648.93M 4.0 252.99842 89.99164 350.3358 93.63832 93.78372 $143.96k $184.56k 2.90% 29.75%
X SF 4.0 9,068 146,968 $114,699.35M $15,270.93M 4.5 237.87533 104.45700 349.8975 93.68409 93.82960 $140.85k $180.22k 3.12% 31.66%
X SF 4.5 9,696 153,188 $223,713.20M $15,932.45M 5.0 220.71011 127.43970 357.0909 93.59813 93.65007 $139.99k $174.23k 2.77% 28.61%
X SF 5.0 11,185 126,348 $197,959.70M $10,655.40M 5.5 204.97057 143.61771 358.1151 93.64646 93.80509 $118.45k $149.07k 2.23% 23.75%
X SF 5.5 11,930 73,420 $189,769.12M $4,816.56M 6.0 168.21660 178.97262 357.4098 93.52089 93.52703 $103.86k $126.10k 1.61% 17.67%
X SF 6.0 13,878 60,434 $180,168.21M $3,562.47M 6.5 163.10295 184.11737 357.8491 93.53907 93.53907 $95.31k $117.38k 1.35% 15.02%
X SF 6.5 12,968 32,368 $151,657.31M $1,354.90M 7.0 135.88446 212.56480 358.7498 94.28640 94.28640 $82.14k $99.48k 0.76% 8.73%
X SF 7.0 12,382 23,727 $131,582.96M $675.42M 7.5 103.56244 246.26715 359.4579 94.17386 94.17386 $72.20k $88.18k 0.41% 4.82%
X SF 7.5 7,540 11,506 $76,427.40M $239.62M 8.0 74.33508 277.40822 359.8124 94.80892 94.80892 $65.77k $79.85k NA NA
X SF 8.0 5,622 8,242 $59,952.93M $154.69M 8.5 71.19088 280.37418 359.8664 94.78084 94.78084 $60.92k $74.51k NA NA
X SF 8.5 2,000 2,484 $17,735.36M $39.07M 9.0 67.15506 284.59065 359.8611 94.47251 94.47251 $55.05k $72.14k NA NA
X SF 9.0 745 842 $7,157.37M $9.25M 9.5 53.09945 299.84525 359.9891 94.00137 94.00137 $52.86k $73.89k NA NA
X SF 9.5 127 126 $703.62M $1.25M 10.0 52.63576 299.60018 359.8832 93.70082 93.70082 $49.75k $89.36k NA NA
X SF 10.0 16 15 $85.07M $0.05M 10.5 22.80413 325.99634 355.6010 89.89843 89.89843 $50.54k $46.94k NA NA
X SF 10.5 1 1 $3.67M $0.00M 11.0 3.00000 355.00000 360.0000 67.00000 67.00000 $171.25k $171.25k NA NA

Overview

This shiny app is a tool for exploring the Loan Level Public Dataset provided by Fannie Mae at <https://capitalmarkets.fanniemae.com/tools-applications/data-dynamics> and predicting future performance by a Markov Finite State model.

The application has two panels:

Loan History Selection and Display

The Origination Year is entered and all the loans originated in that year available are pulled from the database. Next you can select as the time variable either the reporting month or the loan age, and accordingly either a calendar range or a seasoning range (for example, use the 0 to 60 months of age experience of all the loans of the 2020 vintage). Time series of the aggregated value of several relevant characteristics like delinquencies, prepayments and defaults month by month or accumulated can be displayed. For example, the plot below shows the increase of delinquencies at the worst of the 2020 COVID pandemic in March-April 2020.

A second tab not shown displays the (cumulative) transition matrices between Markov states.

Initial State Selection and Markov Prediction Display

In this panel the dollar amount of the initial portfolio of loans is entered and the evolution of the portfolio according to the loan experience is displayed. When the initial state is current and the experience is the full calendar range, the final prepayment, delinquency and default rates agree with the actual values reported by the Agency.

Implementation

Data in AWS S3

Processed data files

The input files are parsed and stored in binary format in AWS S3:

## Bucket: fnma-llp-2020q4 
## 
## $Contents
## Key:            Data_P_2020.fst 
## LastModified:   2021-06-04T15:47:06.000Z 
## ETag:           "d41d8cd98f00b204e9800998ecf8427e" 
## Size (B):       0 
## Owner:          3ed8938a6ec6ccbf8e5544fed9c6be5f74559d6d28ddeda9375f52176205d37b 
## Storage class:  STANDARD

R packages developed

Popular repositories Loading

  1. canarionyc canarionyc Public

    My personal repository

  2. Bayes Bayes Public

    HTML

  3. climaterisk climaterisk Public