Skip to content
All library documents

Setting Swap Coupon Frequency and Limits of Single-Curve Pricing

Article Quant Q&A · Author: Karusmeister

Summary

The document asks how to set the fixed-leg payment frequency when pricing an interest rate swap in MATLAB. The accepted response identifies a reset-frequency name-value setting as the relevant parameter, rather than the period option used in a bond-pricing function. This addresses the practical API question for requesting semiannual or quarterly coupon schedules.

A second response describes a workaround for tools that cannot set the desired frequency: adjust the value of an annual fixed-leg swap by replacing the value of an annual-coupon fixed bond with a bond paying at the target frequency. The answer is framed for a payer swap and does not provide a worked valuation or demonstrate the workaround. It also cautions that the cited function may not support realistic multi-curve valuation, including overnight-index-swap discounting for collateralized derivatives. The discussion therefore helps with frequency configuration while leaving broader curve-model suitability to be checked.

Key ideas

  • Swap coupon or reset frequency is specified through a leg reset setting in the cited MATLAB function.
  • Bond-pricing period options do not necessarily apply to swap-pricing functions.
  • A bond-value adjustment is offered as a workaround when direct frequency control is unavailable.
  • The workaround is described for a payer swap and is not supported by a worked example.
  • Single-curve tools may be inadequate for collateralized swap valuation under multi-curve frameworks.

Tags

Full text
# Matlab; How to specify Coupon frequency for Interest Rate Swap


# Matlab; How to specify Coupon frequency for Interest Rate Swap












I'm trying to price an interest rate swap and would like to change the default coupon payment frequency from 1 a year to 2 or 4 a year. I'm using

```
Price = swapbyzero(RateSpec, LegRate, i, Maturity, 'Principal', Principal);
```

and tried

```
Price = swapbyzero(RateSpec, LegRate, i, Maturity, 'Principal', Principal,'Period',2);
```

where 'Period' is a valid option when pricing bond using

```
prbyzero
```

I'm using matlab 2013a

## Answer by Karusmeister (score 0, accepted)

https://quant.stackexchange.com/a/8086

Name-Value pair option 'LegReset' [n n] where n is the frequency

## Answer by Christian Fries (score 1)

https://quant.stackexchange.com/a/8085

I don't know what is supported by MatLab (I use Java to do such stuff :-).

But in case you do not find a solution from the swapbyzero function you mentioned I can suggest a workaround:

- Value a swap with the annual fix frequence.

Given that it is a payer swap (pays the fixed leg), correct the value by:

- Substract the value of an annual fix coupon bond and

- Add the value of the desired frequence fix coupon bond.

PS: Note that the MatLab function is likely not appropriate to value a swap in a "realistic" way, since it looks like multi-curve (OIS discounting) is not considered here (I wonder if term structure is considered?), see also Rationale for OIS discounting for collateralized derivatives?

Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.