主要内容

predict

R2026b

Predict shocked probabilities of default

Since R2026b

Description

probability = predict(spm) predicts the shocked probabilities of default for the shockedProbabilityModel object spm.

example

probability = predict(spm,data) predicts the shocked probabilities of default using the new data specified by data. Use this syntax to generate predictions on data that differs from the data used to fit the model.

example

Examples

collapse all

Load sample climate data data from the sample file sampleClimateData.mat. Then use the sample data to create a shockedProbabilityModel object.

load sampleClimateData.mat data
spm = shockedProbabilityModel(data);

Use the fit object function to determine the sensitivity coefficients for the model. Then use the predict object function to predict shocked probabilities.

spm = fit(spm);
probability = predict(spm)
probability = 230×1

    0.0053
    0.0053
    0.0009
    0.0009
    0.0087
    0.0087
    0.0191
    0.0191
    0.0047
    0.0047
    0.0147
    0.0147
    0.0018
    0.0018
    0.0039
      ⋮

Load sample data from samplePortfolioClimateData.mat. The sample data includes portolio-level climate data, lower and upper bounds for subgroup-level optimization, and linear relations data.

load samplePortfolioClimateData.mat calibrationPortfolioClimateData lowerSensitivityBounds upperSensitivityBounds linearRelations

The data in the table is organized according to these specifications:

  • ID: LoanID

  • Group: Sector

  • Subgroup: Segment

  • Baseline probability: TTCPD

  • Target probability: ExpertImmediatePD

Use these specifications with the data to create a shocked probability model.

spm = shockedProbabilityModel(calibrationPortfolioClimateData,IDVar="LoanID",GroupVar="Sector",SubGroupVar="Segment",BaselineProbabilityVar="TTCPD",TargetProbabilityVar="ExpertImmediatePD");

Use the linear relations data as well as the lower and upper bounds for subgroup-level optimization to determine the sensitivity coefficients for the model.

spm = fit(spm,GroupSensitivityBaseline=0,LinearRelations=linearRelations, ...
    SubGroupSensitivityLowerBounds=lowerSensitivityBounds,SubGroupSensitivityUpperBounds=upperSensitivityBounds, ...
    PredictorVars=["ShockedCapitalExpenditure" "ShockedDirectEmissionsCosts" "ShockedIndirectCosts" "ShockedRevenue"], ...
    SubGroupSensitivityBaselines=[-1 -1 -1 1],ObjectiveFormulation="cdf");

Model a destabilizing event by increasing the direct emission costs in the data by 25%.

updatedData = spm.Data;
updatedData.ShockedDirectEmissionsCosts = 1.25*updatedData.ShockedDirectEmissionsCosts;

Predict the shocked probabilities of default based on the updated data.

probabilities = predict(spm,updatedData)
probabilities = 230×1

    0.0083
    0.0086
    0.0014
    0.0014
    0.0119
    0.0123
    0.0242
    0.0249
    0.0058
    0.0060
    0.0115
    0.0140
    0.0012
    0.0016
    0.0026
      ⋮

Input Arguments

collapse all

Shocked probability model object, specified as a shockedProbabilityModel object.

Input data for model fitting, specified as a table. The table must contain columns whose names match the values of named spm.GroupVar (group variable), spm.SubGroupVar (subgroup variable), and spm.BaselineProbabilityVar (baseline probability variable).

Output Arguments

collapse all

Predicted shocked probabilities of default, returned as a numeric vector. Each element of the vector represents the model's predicted probability of default for the corresponding observation.

Version History

Introduced in R2026b