main content

create parametercurve object for storing interest-凯发k8网页登录

create parametercurve object for storing interest-rate curve function

since r2020a

description

build a parametercurve object using parametercurve.

after creating a parametercurve object, you can use the associated object functions , , , , and .

for more detailed information on this workflow, see .

for more information on the available instruments, models, and pricing methods, see .

creation

description

example

parametercurve_obj = parametercurve(type,settle,functionhandle) creates a parametercurve object.

example

parametercurve_obj = parametercurve(___,name,value) sets properties using name-value pairs and any of the arguments in the previous syntax. for example, parametercurve_obj = parametercurve('zero',datetime(2017,1,30),@(t)polyval([-0.0001 0.003 0.02],t),'compounding',4,'basis',5,'parameters',[-0.0001 0.003 0.02]) creates a parametercurve object for a zero curve. you can specify multiple name-value pair arguments.

input arguments

type of interest-rate curve, specified as a scalar string or character vector for one of the supported types.

data types: char | string

settlement date for the curve, specified as a scalar datetime, string, or date character vector.

to support existing code, parametercurve also accepts serial date numbers as inputs, but they are not recommended.

dates corresponding to the rate data, specified as a function handle. the function handle requires one numeric input (time-to-maturity) and returns one numeric output (interest rate or discount factor). for more information on creating a function handle, see .

data types: function_handle

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: parametercurve_obj = parametercurve('zero',datetime(2017,1,30),@(t)polyval([-0.0001 0.003 0.02],t),'compounding',4,'basis',5,'parameters',[-0.0001 0.003 0.02])

compounding frequency for the curve, specified as the comma-separated pair consisting of 'compounding' and a scalar numeric using the supported values: –1, 0, 1, 2, 3, 4, 6, or 12.

data types: double

day count basis, specified as the comma-separated pair consisting of 'basis' and a scalar integer.

  • 0 — actual/actual

  • 1 — 30/360 (sia)

  • 2 — actual/360

  • 3 — actual/365

  • 4 — 30/360 (psa)

  • 5 — 30/360 (isda)

  • 6 — 30/360 (european)

  • 7 — actual/365 (japanese)

  • 8 — actual/actual (icma)

  • 9 — actual/360 (icma)

  • 10 — actual/365 (icma)

  • 11 — 30/360e (icma)

  • 12 — actual/365 (isda)

  • 13 — bus/252

for more information, see .

data types: double

curve parameters, specified as the comma-separated pair consisting of 'parameters' and a numeric value.

data types: double

properties

instrument type, returned as a string.

data types: string

settlement date, returned as a datetime.

data types: datetime

function handle that defines the interest-rate curve, returned as a scalar function handle.

data types: function_handle

compounding frequency for curve, returned as a scalar numeric.

data types: double

day count basis, returned as a scalar integer.

data types: double

curve parameters, returned as a numeric value.

data types: double

object functions

calculate discount factors for parametercurve object
calculate zero rates for parametercurve object
calculate forward rates for parametercurve object
fit nelson-siegel model to bond market data
fit svensson model to bond market data

examples

create a parametercurve object using parametercurve.

pcobj = parametercurve('zero',datetime(2019,9,15),@(t)polyval([-0.0001 0.003 0.02],t),'compounding',4,'basis',5,'parameters',[-0.0001 0.003 0.02])
pcobj = 
  parametercurve with properties:
              type: "zero"
            settle: 15-sep-2019
       compounding: 4
             basis: 5
    functionhandle: @(t)polyval([-0.0001,0.003,0.02],t)
        parameters: [-1.0000e-04 0.0030 0.0200]

version history

introduced in r2020a

see also

functions

topics

    网站地图