
Switch to RStudio screen sharing for code-driven learning and build examiner-ready mortgage credit risk models in R through hands-on practice.
Clarify the course scope and target audience for mortgage credit risk modeling in R, guiding enrollment and setting expectations for learners new to credit risk analysis.
Navigate the six regimes that form the U.S. mortgage credit risk modeling perimeter, mapping each regime to modeling, documentation, scope, or data work, with CECL and fair lending as focal pillars.
Explore the six-phase model life cycle - development, implementation, use, validation, change control, and decommissioning - across seven model artifacts, with wrappers and governance guiding CECL-ready credit risk models.
Explore the pedagogical arc and how to use this course, outlining the three layers—lecture, module, and curriculum—and guidance for active engagement, coding, and path selection.
Perform the hardware self-check to choose between teaching subset path and full dataset path for mortgage credit risk modeling in R, considering RAM, disk targets, cloud VM options, and capstones.
Learn to set up and manage R projects using RStudio for mortgage credit risk modeling in R.
Manage R package dependencies using renv in mortgage credit risk modeling projects, ensuring reproducible results and streamlined setup.
Use git and change control to manage your mortgage credit risk modeling projects in R, ensuring versioning, collaboration, and reproducible analyses.
Install Corto and render a Corto document to produce a reproducible deliverable, tying R code, narrative, and outputs together; learn the four-layer reproducibility stack with R, here, renv, and git.
Download the SF-LLD data from Clarity, extract q1 2019 origination and time files into data/raw/2019/extracted in your R project, and verify with file.info, noting the pre-July 2026 layout.
Build the demo slice for mortgage credit risk modeling in R. Explore a practical example that demonstrates how to apply the course concepts to real data.
Explore mortgage credit risk, defined as the risk of borrower nonpayment on a long-term, secured loan, and learn how vintage, seasoning, and macro factors shape default and loss over years.
Explain who bears credit risk in conforming mortgages and how the GSEs price it with G-fees and LLPAs, through the six-link risk chain from originator to borrower.
analyze competing risks in mortgage credit risk, focusing on prepayment, default, and modification, and explain how the survival framework corrects naive default rate biases by accounting for at-risk exposure.
Explore the four regulatory frameworks shaping United States mortgage credit risk: GSE conservatorship, Dodd-Frank ATR and QM, CECL, and fair lending, and how they constrain modeling.
Bridge module 1 concepts to data and mechanics, linking vocabulary and four data assets to the data and mechanics introduced in modules 2 and 3.
Explore converting text data to parquet with a robust conversion pipeline in R, enabling efficient data handling for mortgage credit risk modeling.
Explore how the working teaching subset of one million mortgage loans across six states, with a 14% default rate, is built, loaded in R, and validated for modeling.
Explore how performance trajectories reveal time-based patterns in mortgage risk, including delinquency transitions, prepayment dynamics, and four cohort seasoning curves across vintages.
Develop a robust data dictionary and automated quality checks for mortgage risk modeling, enforcing completeness, consistency, referential integrity, and sentinel handling across origination and performance data.
Define the working teaching subset’s scope, limitations, and handoff to Module 3, detailing its Parquet-based two-file structure, data dictionary, and event-weighted design calibrated to priors.
Preview how a single Quarto render produces a branded, examiner-ready mortgage credit risk report with a header, metadata, formatted tables, and synchronized figures.
Author a .qmd from scratch by configuring YAML, composing Markdown, and inserting code chunks to support mortgage credit risk modeling in R.
Master per-chunk options, document-wide defaults, and the rendering model by using hashpipe blocks, ensuring reproducible renders in a fresh R session with caching.
Master multi-format output from a single Quarto source to HTML, PDF, and Word. Learn format-driven authoring, YAML configuration, and TinyTeX LaTeX toolchain across browser, print, and validator workflows.
Master custom CSS and Quarto output to document mortgage credit risk models in R, guided by a comprehensive reference.
Define prepayment incentive, measure it with the PSA benchmark, and analyze rate-driven waves, turnover, and burnout across loan vintages.
Explore curtailment, voluntary partial prepayments, and how extra payments shrink the mortgage balance, lower UPB, reduce LTV and exposure at default by comparing actual balances with the schedule.
Explore the loan-to-value trajectory with three views—original, scheduled, and mark-to-market—showing how balance and home prices, via a stand-in index, drive mortgage risk.
Fetch and integrate the FHFA HPI state-level all-transactions index into a mortgage risk model in R, highlighting the differences from a national index and the need for proper period alignment.
The lecture builds a transition matrix of delinquency states to map month-to-month mortgage movements, highlighting competing risks of prepayment and default and the impact of leverage on transitions.
Synthesize six mechanics—amortization, prepayment, curtailment, loan-to-value, mark-to-market, and the delinquency transition matrix—to bridge module 3 to predictive modeling in module 4.
Master the PD scorecard and the model development document within the model risk framework (SR 11.7). Build examiner-defensible, transparent modeling targets using origination inputs and a 24-month default window.
Define the modeling target for mortgage credit risk and construct a development sample in r to support robust risk modeling.
Transform, screen, and explain mortgage risk predictors with weight of evidence and information value to build a monotonic, auditable logistic regression model.
Bin and apply monotonic transformations to eight predictors using weight of evidence in R to create stable, monotonic, no missing data ready for logistic regression in mortgage credit risk modeling.
Build and interpret a logistic regression scorecard in R by applying frozen weight-of-evidence bins, fitting eight coefficients, and previewing predicted default probabilities for holdout sets.
Transform a probability engine into an interpretable points scorecard for mortgage credit risk. Learn how PDO, base odds, and base score anchor the scale with additive, auditable variable points.
Assess discrimination, calibration, and stability of a mortgage credit scorecard using AUC, GINI, KS, and PSI; learn about out-of-time performance, recalibration with intercept adjustment, and documenting strengths and limitations.
Assemble the model development document for mortgage credit risk modeling in R to outline the core course content.
Explore how module 4 synthesizes the scorecard and bridges to survival models. Document deliberate simplifications, strengths, and an examiner-ready probability of default model within a 24-month window.
Explore why survival models, not a fixed 24-month window, capture time to default and prepayment, handle censoring honestly, and model competing risks in mortgage credit risk.
Build the survival dataset for mortgage credit risk modeling in r, aligning data structure with the needs of this course topic.
Estimate the Kaplan-Meier survival curve for mortgage defaults in R, explain censoring, risk sets, and horizon tables, and compare survival across credit-score bands with a log-rank test.
Learn Cox proportional hazards with static covariates, interpreting hazard ratios for credit score, LTV, DTI, and channel effects. Understand partial likelihood, baseline hazard, and assessing proportional hazards with Schoenfeld residuals.
Learn Cox with time-varying covariates to model mortgage credit risk. Implement the approach in R to enable practical risk modeling.
Explore the Weibull accelerated failure time model as a fully parametric survival fit that unites time ratios and hazard ratios, compared with the Cox model in mortgage credit risk.
Compute honest competing risks with the Fine Gray sub-distribution hazard to replace censoring in mortgage risk models. Understand how prepayment reshapes default risk and lifetime loss estimates for CECL reserves.
Explore how competing risks reveal the trade-off between default and prepayment across credit quality and market regimes, using cumulative incidence to compare five survival models and guide selection.
Assess discrimination, probability accuracy, and calibration by comparing the survival model and scorecard using C statistic, Breyer score, and horizon-specific default risk.
Assemble the survival model MDD for mortgage credit risk modeling in R. Explore practical steps to implement and validate the model in R.
Explore building the LGD dataset for mortgage credit risk modeling in R, focusing on data preparation, feature selection, and integration into risk models.
Explore the 131,000-loan LGD distribution, revealing a bounded, non-symmetric shape with spikes at 0 and 1, and identify drivers, collateral via MTMLTV, time in process, and foreclosure regime.
Examine why ordinary least squares fails for loss given default, causing boundary violations and heteroscedastic residuals, and learn how beta regression fixes these issues with a logit mean link.
Explore comparing four loss-given-default models: ordinary least squares, beta regression, two-stage hurdle, and the satellite, through performance assessment to emphasize calibration, boundaries, and through-the-cycle versus point-in-time decision making.
Learn how exposure at default, or EAD, is the outstanding balance at default for fixed-rate mortgages, and how deterministic amortization converts losses into dollars.
Model curtailment to adjust exposure with a two-stage hurdle that first predicts whether curtailment occurs, then how much, using loan age and borrower strength.
Explore how to stress-test exposure at default in mortgage risk models using forbearance and modification scenarios from the covid era, reconstructing forbearance footprints from behavior and not flags.
Prepare data and engineer features for a machine learning sample in mortgage credit risk modeling using R.
Assess production risks, validation complexity, and fair lending concerns of a gradient boosting challenger for mortgage credit risk, and compare its performance and governance to a traditional scorecard.
Assemble the XGBoost challenger model development document for mortgage credit risk, explain why a tie does not warrant promotion, and document reproducibility, calibration, and SHAP explainability.
This course takes you from R-comfortable analyst to building fully validated, production-grade mortgage credit risk models - the same models used by banks, GSEs, fintech mortgage lenders, and the regulators who examine them. Across the main core (Modules 0-12, including Module 2A on Quarto) and optional extensions (capstones and an ARM appendix), you will construct a complete PD/LGD/EAD/CECL modeling framework for conventional conforming fixed-rate mortgages using real Freddie Mac Single-Family Loan-Level data.
You won't just learn about mortgage credit risk modeling - you will build every component yourself in R, step-by-step, with a practitioner guiding you through the exact workflow used in industry and reviewed by independent validation and regulatory examiners.
What You'll Learn
Set up a professional R environment with renv-locked reproducibility, R Project structure, and Git-based version control for sensitive loan data. Ingest, clean, and join Freddie Mac Single-Family Loan-Level origination and performance files, HMDA, FHFA HPI, and FRED macro data into a unified loan-month panel. Master mortgage mathematics for fixed-rate products - level-payment amortization, prepayment, curtailment, LTV trajectory, and HPI-driven mark-to-market LTV. Build a full Probability of Default scorecard using WoE/IV, logistic regression, monotonic binning, and points-to-double-the-odds scaling. Develop survival-based and competing-risks PD models - Kaplan-Meier, Cox proportional hazards, parametric Weibull, and Fine-Gray for prepayment vs. default. Build Loss Given Default models using beta regression, two-stage default-flag-plus-severity, and LTV-based curves with HPI stress sensitivity. Implement Exposure at Default using amortization schedules and curtailment behavior. Construct lifetime CECL reserves with vintage loss curves, roll-rate models, macro-linked satellite models, scenario blending, and Q-factor framework. Build a modern machine learning challenger - XGBoost with SHAP explainability and adverse action reason code generation. Conduct fair lending analysis using HMDA: denial rate disparities, rate spread analysis, redlining tests, BISG proxies, and disparate impact regression. Produce audit-ready documentation in Quarto: Model Development Documents, Validation Reports, Ongoing Monitoring Reports, and CECL disclosures. An optional appendix extends the framework to adjustable-rate mortgages using Freddie Mac's Non-Standard Dataset, with caps, floors, reset schedules, and payment shock.
Who This Course Is For
Mortgage credit risk analysts, model developers, and model validators. Bank, credit union, GSE, and fintech mortgage professionals. Data scientists transitioning into mortgage or consumer credit risk. Audit and Model Risk Management staff supporting mortgage portfolios. Career-changers preparing for risk, analytics, or model development roles in mortgage lending.
Module 0 covers the R toolchain, RStudio configuration, package management, and Git basics from a practitioner's angle - but you should be comfortable with basic R syntax, data manipulation, and undergraduate-level statistics. This is a practitioner course, not an introduction to programming.
Hands-On Projects You Will Build
By the end of the main core, you will have created a reproducible RStudio project with Freddie Mac Single-Family Loan-Level data, renv-locked dependencies, and Git history; a working teaching subset of SFLLD built from raw quarterly text files via a documented Arrow/Parquet pipeline; a fully exploratory analysis of origination attributes and performance trajectories with vintage and seasoning views; a validated PD scorecard with KS, Gini, AUROC, calibration, and out-of-time / out-of-sample validation; a survival-based lifetime PD model with competing-risks treatment of prepayment; a two-stage LGD model with HPI stress sensitivity; an EAD model accounting for amortization and curtailment; a complete CECL engine with vintage curves, roll-rate models, scenario blending, and back-testing; an XGBoost challenger model with SHAP explanations and reason codes; a full HMDA-based fair lending analysis with disparate impact testing and remediation; and an audit-ready Model Development Document, Validation Report, and PSI/CSI monitoring dashboard. Optional capstones extend the framework against the full Freddie Mac dataset; an optional ARM appendix module applies the methodology to adjustable-rate mortgages.
Every module ends with a tangible, portfolio-ready artifact. Every section ends with a hands-on lab. Every capstone ends with a complete documentation package.
Course Structure
The main core covers Modules 0 through 12, including Module 2A on Quarto for regulatory reporting. The Foundation phase (Modules 0, 1, 2, 2A) covers the R toolchain, mortgage credit risk fundamentals, data ingestion, and Quarto reporting. Mortgage Mechanics (Module 3) covers fixed-rate amortization, prepayment, LTV trajectory, and HPI mark-to-market. Core Models (Modules 4, 5, 6, 7) cover PD scorecards, survival PD, LGD, and EAD. Application (Modules 8, 9, 10) covers the ML challenger, fair lending, and CECL. Governance (Modules 11, 12) covers validation and ongoing monitoring. Optional extensions include capstones (Module 13) and an ARM appendix (Module 14).
Every lecture includes a complete instructor script, branded slide deck, runnable R code, exercises, knowledge checks, and session notes - produced and quality-controlled to a single consistent standard.
Why This Course Is Different
Most credit risk courses teach theory on toy data. Most R courses don't touch regulation. This course does both - using real Freddie Mac Single-Family Loan-Level data spanning the 2005-2007 crisis vintages through recent originations, with every method implemented in production-quality R code and every output framed for SR 11-7-compliant model documentation.
You'll learn not just how to build mortgage credit risk models, but how to defend them in independent validation, document them for regulatory examination, monitor them in production, and remediate them when fair lending or stability issues surface.
By the end, you'll be able to independently develop, validate, document, and govern mortgage credit risk models in a real-world environment - across PD, LGD, EAD, and CECL, with the regulatory and fair lending lens that examiners actually apply.