Main Content

IRFitOptions

Construct specific options for fitting interest-rate curve object

Description

Build an IRFitOptions object using IRFitOptions.

After creating an IRFitOptions object, you can use the object with fitFunction.

For more detailed information on this workflow, see Interest-Rate Curve Objects and Workflow.

Creation

Description

IRFitOptions_obj = IRFitOptions(InitialGuess) sets properties and create the IRFitOptions object with an initial guess or with an initial guess and bounds.

example

IRFitOptions_obj = IRFitOptions(___,Name,Value) sets optional properties using name-value pairs and any of the arguments in the previous syntax. For example, IRFitOptions_obj = IRFitOptions([7 2 1 0],'FitType','yield') creates an IRFitOptions object to use with fitFunction when building a custom fitting function. You can specify multiple name-value pair arguments.

example

Input Arguments

expand all

Initial guess for the parameters of the curve function, specified as vector of values for the starting point of the optimization.

Data Types: double

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: IRFitOptions_obj = IRFitOptions([7 2 1 0],'FitType','yield')

Minimize by in curve fitting process, specified as the comma-separated pair consisting of 'FitType' and a character vector.

Data Types: char

Upper bound for parameters of the curve function, specified as the comma-separated pair consisting of 'UpperBound' and a scalar numeric.

Data Types: double

Lower bound for parameters of the curve function, specified as the comma-separated pair consisting of 'LowerBound' and a scalar numeric.

Data Types: double

Optimization parameters, specified as the comma-separated pair consisting of 'OptOptions' and a structure defined by using optimoptions (optimset is also supported).

Data Types: struct

Properties

expand all

This property is read-only.

Minimize by in curve fitting process, returned as a character vector.

Data Types: char

This property is read-only.

Initial guess for the parameters of the curve function, returned as a vector.

Data Types: double

This property is read-only.

Upper bound for parameters of the curve function, returned as a scalar numeric.

Data Types: double

This property is read-only.

Lower bound for parameters of the curve function, returned as a scalar numeric.

Data Types: double

This property is read-only.

Optimization parameters, returned as a structure defined by using optimoptions (optimset is also supported).

Data Types: struct

This property is read-only.

Inequality constraint for parameters, returned as a scalar numeric.

Data Types: double

This property is read-only.

Inequality constraint for parameters, returned as a scalar numeric.

Data Types: double

This property is read-only.

Optimization function used to fit function, returned as lsqnonlin or fmincon.

Data Types: char

Object Functions

fitFunctionCustom fit interest-rate curve object to bond market data

Examples

collapse all

This example shows how to create an IRFitOptions object with a 'yield' FitType.

myfitoptions = IRFitOptions([7 2 1 0],'FitType','yield')
myfitoptions = 
  IRFitOptions with properties:

          FitType: 'yield'
     InitialGuess: [7 2 1 0]
       UpperBound: []
       LowerBound: []
       OptOptions: []
                A: []
                b: []
    OptimFunction: 'lsqnonlin'

Version History

Introduced in R2008b