exposureprofiles
Compute exposure profiles from credit exposures
Syntax
Description
computes common counterparty credit exposures profiles from an array of exposures. profilestructs = exposureprofiles(dates,exposures)
adds optional name-value arguments.profilestructs = exposureprofiles(___,Name,Value)
Examples
After computing the mark-to-market contract values for a portfolio of swaps over many scenarios, view the exposure profiles of a particular counterparty.
Load the data (ccr.mat) that contains the mark-to-market contract values for a portfolio of swaps over many scenarios.
load ccr.matCompute the exposure by counterparty.
[exposures, expcpty] = creditexposures(values,swaps.Counterparty,... 'NettingID',swaps.NettingID);
Compute the credit exposure profiles for all counterparties.
cpProfiles = exposureprofiles(simulationDates,exposures)
cpProfiles=5×1 struct array with fields:
Dates
EE
PFE
MPFE
EffEE
EPE
EffEPE
Visualize the exposure profiles for a particular counterparty.
cpIdx = find(expcpty == 4); numDates = numel(simulationDates); simulationDates = datetime(simulationDates,"ConvertFrom","datenum"); plot(simulationDates,cpProfiles(cpIdx).PFE, ... simulationDates,cpProfiles(cpIdx).MPFE * ones(numDates,1), ... simulationDates,cpProfiles(cpIdx).EE,... simulationDates,cpProfiles(cpIdx).EPE * ones(numDates,1), ... simulationDates,cpProfiles(cpIdx).EffEE,... simulationDates,cpProfiles(cpIdx).EffEPE * ones(numDates,1)); legend({'PFE (95%)','Max PFE','Exp Exposure (EE)', ... 'Time-Avg EE (EPE)','Max past EE (EffEE)', ... 'Time-Avg EffEE (EffEPE)'}) xtickformat('MMMyy'); title(sprintf('Counterparty %d Exposure Profiles',cpIdx)); ylabel('Exposure ($)') xlabel('Simulation Dates')

Input Arguments
Simulation dates, specified as vector of date numbers or a cell array of character
vectors in a known date format. For more information for known date formats, see the
function datetime.
Data Types: double | char | cell
3-D array of potential losses due to counterparty default on a set of instruments
simulated over a series of simulation dates and across many scenarios, specified as a
NumDates-by-NumCounterParties-by-NumScenarios
“cube” of credit exposures. Each row represents a different simulation
date, each column a different counterparty, and each “page” is a different
scenario from a Monte-Carlo simulation.
Data Types: double
Name-Value Arguments
Specify optional pairs of arguments as
Name1=Value1,...,NameN=ValueN, where Name is
the argument name and Value is the corresponding value.
Name-value arguments must appear after other arguments, but the order of the
pairs does not matter.
Before R2021a, use commas to separate each name and value, and enclose
Name in quotes.
Example: profilestructs =
exposureprofiles(dates,exposures,'ProfileSpec','PFE','PFEProbabilityLevel',.9)
Exposure profiles, specified as a character vector or cell array of character vectors with the following possible values:
EE— Expected Exposure. The mean of the distribution of exposures at each date. A[NumDates-by-1]vector.PFE— Potential Future Exposure. A high percentile (default 95%) of the distribution of possible exposures at each date. This is sometimes referred to as “Peak Exposure.” A[NumDates-by-1] vector.MPFE— Maximum Potential Future Exposure. The maximum potential future exposure (PFE) over all datesEffEE— Effective Expected Exposure. The maximum expected exposure (at a specific date) that occurs at that date or any prior date. This is the expected exposure, but constrained to be nondecreasing over time. A[NumDates-by-1]vector.EPE— Expected Positive Exposure. The weighted average over time of expected exposures. A scalar.EffEPE— Effective Expected Positive Exposure. The weighted average over time of the effective expected exposure (EffEE). A scalar.All— Generate all the previous profiles.
Note
Exposure profiles are computed on a per-counterparty basis.
Data Types: char | cell
Level for potential future exposure (PFE) and maximum potential future exposure
(MPFE), specified as a scalar with value [0..1].
Data Types: double
Output Arguments
Structure of credit exposure profiles, returned as an array of structs holding
credit exposure profiles for each counterparty, returned as a struct, with the fields of
the struct as the (abbreviated) names of every exposure profile. Profiles listed in the
ProfileSpec (and their related profiles) are populated, while those
not requested contain empty ([]). profilestructs
contains the dates information as a vector of MATLAB® date numbers requested in the ProfileSpec argument.
References
[1] Basel II: International Convergence of Capital Measurement and Capital
Standards: A Revised Framework - Comprehensive Version. at https://www.bis.org/publ/bcbs128.htm, 2006.
Version History
Introduced in R2014a
See Also
Topics
- Counterparty Credit Risk and CVA (Financial Instruments Toolbox)
- Wrong Way Risk with Copulas (Financial Instruments Toolbox)
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Sélectionner un site web
Choisissez un site web pour accéder au contenu traduit dans votre langue (lorsqu'il est disponible) et voir les événements et les offres locales. D’après votre position, nous vous recommandons de sélectionner la région suivante : .
Vous pouvez également sélectionner un site web dans la liste suivante :
Comment optimiser les performances du site
Pour optimiser les performances du site, sélectionnez la région Chine (en chinois ou en anglais). Les sites de MathWorks pour les autres pays ne sont pas optimisés pour les visites provenant de votre région.
Amériques
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)