Этот пример показывает рабочий процесс, чтобы оценить несколько CDSOption
инструменты с помощью CDSBlack
модель и CDSBlack
калькулятор цен.
ratecurve
ОбъектСоздайте ratecurve
объект с помощью ratecurve
.
Settle = datetime(2021,9,20);
ZeroTimes = [calmonths(6) calyears([1 2 3 4 5 7 10 20 30])];
ZeroRates = [0.0052 0.0055 0.0061 0.0073 0.0094 0.0119 0.0168 0.0222 0.0293 0.0307]';
ZeroDates = Settle + ZeroTimes;
ZeroCurve = ratecurve("zero", Settle, ZeroDates ,ZeroRates)
ZeroCurve = ratecurve with properties: Type: "zero" Compounding: -1 Basis: 0 Dates: [10x1 datetime] Rates: [10x1 double] Settle: 20-Sep-2021 InterpMethod: "linear" ShortExtrapMethod: "next" LongExtrapMethod: "previous"
defprobcurve
ОбъектСоздайте defprobcurve
объект с помощью defprobcurve
.
DefProbTimes = [calmonths(6) calyears([1 2 3 4 5 7 10 20 30])]; DefaultProbabilities = [0.005 0.007 0.01 0.015 0.026 0.04 0.077 0.093 0.15 0.20]'; ProbDates = Settle + DefProbTimes; DefaultProbCurve = defprobcurve(Settle, ProbDates, DefaultProbabilities)
DefaultProbCurve = defprobcurve with properties: Settle: 20-Sep-2021 Basis: 2 Dates: [10x1 datetime] DefaultProbabilities: [10x1 double]
CDS
Инструментальный объектИспользуйте fininstrument
создать базовый CDS
инструментальный объект.
ContractSpreadBP = 0; % Contractual spread is determined on ExerciseDate CDS = fininstrument("CDS",'Maturity',datetime(2027,9,20),'ContractSpread',ContractSpreadBP)
CDS = CDS with properties: ContractSpread: 0 Maturity: 20-Sep-2027 Period: 4 Basis: 2 RecoveryRate: 0.4000 BusinessDayConvention: "actual" Holidays: NaT PayAccruedPremium: 1 Notional: 10000000 Name: ""
CDSOption
Инструментальные объектыИспользуйте fininstrument
создать несколько CDSOption
инструментальные объекты.
ExerciseDate = datetime(2021, 12, 20); Strikes = [30:2:90]'; PayerCDSOptions = fininstrument("CDSOption",'Strike',Strikes,'ExerciseDate',ExerciseDate,'OptionType',"call",'CDS',CDS)
PayerCDSOptions=31×1 object
16x1 CDSOption array with properties:
OptionType
Strike
Knockout
AdjustedForwardSpread
ExerciseDate
CDS
Name
⋮
ReceiverCDSOptions = fininstrument("CDSOption",'Strike',Strikes,'ExerciseDate',ExerciseDate,'OptionType',"put",'CDS',CDS)
ReceiverCDSOptions=31×1 object
16x1 CDSOption array with properties:
OptionType
Strike
Knockout
AdjustedForwardSpread
ExerciseDate
CDS
Name
⋮
CDSOption
ИнструментыПри принятии плоской структуры энергозависимости через забастовки сначала используйте finmodel
создать CDSBlack
объект модели. Затем используйте finpricer
создать CDSBlack
объект калькулятора цен. Используйте price
вычислить цены на CDSOption
инструменты.
SpreadVolatility = 0.3; CDSOptionModel = finmodel("CDSBlack",'SpreadVolatility',SpreadVolatility)
CDSOptionModel = CDSBlack with properties: SpreadVolatility: 0.3000
CDSOptionpricer = finpricer("analytic",'Model',CDSOptionModel,'DiscountCurve',ZeroCurve,'DefaultProbabilityCurve',DefaultProbCurve)
CDSOptionpricer = CDSBlack with properties: Model: [1x1 finmodel.CDSBlack] DiscountCurve: [1x1 ratecurve] DefaultProbabilityCurve: [1x1 defprobcurve]
PayerPrices = price(CDSOptionpricer,PayerCDSOptions)
PayerPrices = 31×1
171.7269
160.6802
149.6346
138.5931
127.5648
116.5716
105.6576
94.8983
84.4061
74.3266
⋮
ReceiverPrices = price(CDSOptionpricer,ReceiverCDSOptions)
ReceiverPrices = 31×1
0.0000
0.0003
0.0016
0.0070
0.0256
0.0794
0.2123
0.4999
1.0547
2.0221
⋮
Постройте плательщика и цены опции CDS приемника.
figure; plot(Strikes, PayerPrices, '--', Strikes, ReceiverPrices) title('CDS Option Pricing') xlabel('Option Strike (Basis Points)') ylabel('Option Premium (Basis Points)') legend('Payer CDS Options','Receiver CDS Options','Location','best')