Main Content

derivset

Set or modify derivatives pricing options

Description

Options = derivset(Options,Name,Value) modifies an existing derivatives pricing options structure Options by changing the specified name-value pair argument values.

example

Options = derivset(Name,Value) creates a derivatives pricing options structure Options using the specified name-value pair argument values. Any unspecified name-value arguments are set to default values for when the Options output is passed to the derivatives function.

example

Options = derivset(OldOptions,NewOptions) combines an existing options structure OldOptions with a new options structure NewOptions. Any parameters in NewOptions with nonempty values overwrite the corresponding old parameters in OldOptions.

example

Options = derivset creates an options structure Options where all the parameters are set to the default values.

example

derivset with no input or output arguments displays all parameter names and information about their possible values.

example

Examples

collapse all

Enable the display of additional diagnostic information that appears when executing pricing functions

Options = derivset('Diagnostics','on')
Options = struct with fields:
      Diagnostics: 'on'
         Warnings: 'on'
        ConstRate: 'on'
    BarrierMethod: 'unenhanced'

Change the ConstRate parameter in the existing Options structure so that the assumption of constant rates between tree nodes no longer applies.

Options = derivset(Options, 'ConstRate', 'off')
Options = struct with fields:
      Diagnostics: 'on'
         Warnings: 'on'
        ConstRate: 'off'
    BarrierMethod: 'unenhanced'

With no input or output arguments, derivset displays all parameter names and information about their possible values.

derivset
            Diagnostics: [ on   | {off} ]
               Warnings: [ {on} | off   ]
              ConstRate: [ {on} | off   ]
          BarrierMethod: [ {unenhanced} | interp ]

Input Arguments

collapse all

Existing options specification, specified as a structure obtained from a previous call to derivset.

Data Types: struct

Existing options specification, specified as a structure obtained from a previous call to derivset.

Data Types: struct

New options specification, specified as a structure.

Data Types: struct

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: Options = derivset(Options, 'ConstRate', 'off')

Print diagnostic information, specified as the comma-separated pair consisting of 'Diagnostics' and a character vector. This option applies only for HJM, BDT, HW and BK pricing.

Data Types: char

Display warnings, specified as the comma-separated pair consisting of 'Warnings' and a character vector. This option applies only for HJM, BDT, HW and BK pricing.

Data Types: char

Assume constant rates between tree nodes, specified as the comma-separated pair consisting of 'ConstRate' and a character vector. This option applies only for HJM, BDT, HW and BK pricing.

Data Types: char

Method for pricing Barrier option, specified as the comma-separated pair consisting of 'BarrierMethod' and a character vector. Specifying 'unenhanced' uses no correction calculation. Specifying 'interp' uses an enhanced valuation interpolating between nodes on barrier boundaries.

Data Types: char

Output Arguments

collapse all

Options specification, returned as a structure encapsulating the properties of a derivatives option.

Version History

Introduced before R2006a