Documentation

# beytbill

Bond equivalent yield for Treasury bill

## Syntax

``Yield = beytbill(Settle,Maturity,Discount)``

## Description

example

````Yield = beytbill(Settle,Maturity,Discount)` returns the bond equivalent yield for a Treasury bill.```

## Examples

collapse all

This example shows how to find the bond equivalent yield for a Treasury bill that has a settlement date of February 11, 2000, a maturity date of August 7, 2000, and a discount rate is 5.77.

`Yield = beytbill('2/11/2000', '8/7/2000', 0.0577)`
```Yield = 0.0602 ```

This example shows how to use `datetime` inputs to find the bond equivalent yield for a Treasury bill that has a settlement date of February 11, 2000, a maturity date of August 7, 2000, and the discount rate is 5.77.

```Yield = beytbill(datetime('11-Feb-2000','Locale','en_US'), datetime('7-Aug-2000','Locale','en_US'),... 0.0577)```
```Yield = 0.0602 ```

## Input Arguments

collapse all

Settlement date of the Treasury bill, specified as a scalar or a `NTBILLS`-by-`1` vector of serial date numbers, date character vectors, or datetime arrays. `Settle` must be earlier than `Maturity`.

Data Types: `double` | `char` | `datetime`

Maturity date of the Treasury bill, specified as a scalar or a `NTBILLS`-by-`1` vector of serial date numbers, date character vectors, or datetime arrays.

Data Types: `double` | `char` | `datetime`

Discount rate of the Treasury bill, specified as a scalar of a `NTBILLS`-by-`1` vector of decimal fraction values.

Data Types: `double`

## Output Arguments

collapse all

Treasury bill yield, returned as a scalar or `NTBILLS`-by-`1` vector.

### Note

The number of days to maturity is typically quoted as: md - sd - 1. A `NaN` is returned for all cases in which negative prices are implied by the discount rate, `Discount`, and the number of days between `Settle` and `Maturity`.