Functions in Financial Instruments Toolbox

  • By Category | Alphabetical List
  • Yield Curves

    Bootstrap from Market Data

    IRDataCurve Construct interest-rate curve object from dates and data
    IRBootstrapOptions Construct specific options for bootstrapping interest-rate curve object

    Estimate Model Parameters

    IRFunctionCurve Construct interest-rate curve object from function handle or function and fit to market data
    IRFitOptions Construct specific options for fitting interest-rate curve object

    Interest-Rate Instruments

    Instrument Creation

    instbond Construct bond instrument
    instcap Construct cap instrument
    instcf Construct cash flow instrument
    instfixed Construct fixed-rate instrument
    instfloat Construct floating-rate instrument
    instfloor Construct floor instrument
    instoptbnd Construct bond option
    instoptembnd Construct bond with embedded option
    instoptfloat Create option instrument on floating-rate note or add instrument to current portfolio
    instoptemfloat Create embedded option instrument on floating-rate note or add instrument to current portfolio
    instrangefloat Construct range note instrument
    instswap Construct swap instrument
    instswaption Construct swaption instrument

    Term Structure Definition and Analysis

    date2time Time and frequency from dates
    datedisp Display date entries
    disc2rate Interest rates from cash flow discounting factors
    intenvget Properties of interest-rate structure
    intenvset Set properties of interest-rate structure
    rate2disc Discount factors from interest rates
    ratetimes Change time intervals defining interest-rate environment
    time2date Dates from time and frequency

    Price Using Term Structure

    bondbyzero Price bond from set of zero curves
    cfbyzero Price cash flows from set of zero curves
    fixedbyzero Price fixed-rate note from set of zero curves
    floatbyzero Price floating-rate note from set of zero curves
    intenvprice Price instruments from set of zero curves
    intenvsens Instrument price and sensitivities from set of zero curves
    swapbyzero Price swap instrument from set of zero curves
    floatmargin Margin measures for floating-rate bond
    floatdiscmargin Discount margin for floating-rate bond

    Price Using Tree Models

    Heath-Jarrow-Morton Tree Setup

    hjmtimespec Specify time structure for Heath-Jarrow-Morton interest-rate tree
    hjmtree Construct Heath-Jarrow-Morton interest-rate tree
    hjmvolspec Specify Heath-Jarrow-Morton interest-rate volatility process

    Heath-Jarrow-Morton Tree Analysis

    bondbyhjm Price bond from Heath-Jarrow-Morton interest-rate tree
    capbyhjm Price cap instrument from Heath-Jarrow-Morton interest-rate tree
    cfbyhjm Price cash flows from Heath-Jarrow-Morton interest-rate tree
    fixedbyhjm Price fixed-rate note from Heath-Jarrow-Morton interest-rate tree
    floatbyhjm Price floating-rate note from Heath-Jarrow-Morton interest-rate tree
    floorbyhjm Price floor instrument from Heath-Jarrow-Morton interest-rate tree
    hjmprice Instrument prices from Heath-Jarrow-Morton interest-rate tree
    hjmsens Instrument prices and sensitivities from Heath-Jarrow-Morton interest-rate tree
    mmktbyhjm Create money-market tree from Heath-Jarrow-Morton interest-rate tree
    oasbyhjm Determine option adjusted spread using Heath-Jarrow-Morton model
    optbndbyhjm Price bond option from Heath-Jarrow-Morton interest-rate tree
    optfloatbyhjm Price options on floating-rate notes for HJM interest-rate tree
    optembndbyhjm Price bonds with embedded options by Heath-Jarrow-Morton interest-rate tree
    optemfloatbyhjm Price embedded option on floating-rate note HJM interest-rate tree
    rangefloatbyhjm Price range floating note using Heath-Jarrow-Morton tree
    swapbyhjm Price swap instrument from Heath-Jarrow-Morton interest-rate tree
    swaptionbyhjm Price swaption from Heath-Jarrow-Morton interest-rate tree
    derivget Get derivatives pricing options
    derivset Set or modify derivatives pricing options

    Black-Derman-Toy Tree Setup

    bdttimespec Specify time structure for Black-Derman-Toy interest-rate tree
    bdttree Construct Black-Derman-Toy interest-rate tree
    bdtvolspec Specify Black-Derman-Toy interest-rate volatility process

    Black-Derman-Toy Tree Analysis

    bdtprice Instrument prices from Black-Derman-Toy interest-rate tree
    bdtsens Instrument prices and sensitivities from Black-Derman-Toy interest-rate tree
    bondbybdt Price bond from Black-Derman-Toy interest-rate tree
    capbybdt Price cap instrument from Black-Derman-Toy interest-rate tree
    cfbybdt Price cash flows from Black-Derman-Toy interest-rate tree
    fixedbybdt Price fixed-rate note from Black-Derman-Toy interest-rate tree
    floatbybdt Price floating-rate note from Black-Derman-Toy interest-rate tree
    floorbybdt Price floor instrument from Black-Derman-Toy interest-rate tree
    mmktbybdt Create money-market tree from Black-Derman-Toy interest-rate tree
    oasbybdt Determine option adjusted spread using Black-Derman-Toy model
    optbndbybdt Price bond option from Black-Derman-Toy interest-rate tree
    optfloatbybdt Price options on floating-rate notes for BDT interest-rate tree
    optembndbybdt Price bonds with embedded options by Black-Derman-Toy interest-rate tree
    optemfloatbybdt Price embedded option on floating-rate note BDT interest-rate tree
    rangefloatbybdt Price range floating note using Black-Derman-Toy tree
    swapbybdt Price swap instrument from Black-Derman-Toy interest-rate tree
    swaptionbybdt Price swaption from Black-Derman-Toy interest-rate tree
    derivget Get derivatives pricing options
    derivset Set or modify derivatives pricing options

    Hull-White Tree Setup

    hwtimespec Specify time structure for Hull-White interest-rate tree
    hwtree Construct Hull-White interest-rate tree
    hwvolspec Specify Hull-White interest-rate volatility process

    Hull-White Tree Analysis

    bondbyhw Price bond from Hull-White interest-rate tree
    capbyhw Price cap instrument from Hull-White interest-rate tree
    cfbyhw Price cash flows from Hull-White interest-rate tree
    fixedbyhw Price fixed-rate note from Hull-White interest-rate tree
    floatbyhw Price floating-rate note from Hull-White interest-rate tree
    floorbyhw Price floor instrument from Hull-White interest-rate tree
    hwcalbycap Calibrate Hull-White tree using caps
    hwcalbyfloor Calibrate Hull-White tree using floors
    hwprice Instrument prices from Hull-White interest-rate tree
    hwsens Instrument prices and sensitivities from Hull-White interest-rate tree
    oasbyhw Determine option adjusted spread using Hull-White model
    optbndbyhw Price bond option from Hull-White interest-rate tree
    optfloatbyhw Price options on floating-rate notes for HW interest-rate tree
    optembndbyhw Price bonds with embedded options by Hull-White interest-rate tree
    optemfloatbyhw Price embedded option on floating-rate note HW interest-rate tree
    rangefloatbyhw Price range floating note using Hull-White tree
    swapbyhw Price swap instrument from Hull-White interest-rate tree
    swaptionbyhw Price swaption from Hull-White interest-rate tree

    Black-Karasinski Tree Setup

    bktimespec Specify time structure for Black-Karasinski tree
    bktree Construct Black-Karasinski interest-rate tree
    bkvolspec Specify Black-Karasinski interest-rate volatility process

    Black-Karasinski Tree Analysis

    bkprice Instrument prices from Black-Karasinski interest-rate tree
    bksens Instrument prices and sensitivities from Black-Karasinski interest-rate tree
    bondbybk Price bond from Black-Karasinski interest-rate tree
    capbybk Price cap instrument from Black-Karasinski interest-rate tree
    cfbybk Price cash flows from Black-Karasinski interest-rate tree
    fixedbybk Price fixed-rate note from Black-Karasinski interest-rate tree
    floatbybk Price floating-rate note from Black-Karasinski interest-rate tree
    floorbybk Price floor instrument from Black-Karasinski interest-rate tree
    oasbybk Determine option adjusted spread using Black-Karasinski model
    optbndbybk Price bond option from Black-Karasinski interest-rate tree
    optfloatbybk Price options on floating-rate notes for BK interest-rate tree
    optembndbybk Price bonds with embedded options by Black-Karasinski interest-rate tree
    optemfloatbybk Price embedded option on floating-rate note BK interest-rate tree
    rangefloatbybk Price range floating note using Black-Karasinski tree
    swapbybk Price swap instrument from Black-Karasinski interest-rate tree
    swaptionbybk Price swaption from Black-Karasinski interest-rate tree

    Tree Manipulation for Interest-Rate Instruments

    bushpath Extract entries from node of bushy tree
    bushshape Retrieve shape of bushy tree
    cvtree Convert inverse-discount tree to interest-rate tree
    mkbush Create bushy tree
    mktree Create recombining binomial tree
    mktrintree Create recombining trinomial tree
    treepath Entries from node of recombining binomial tree
    treeshape Shape of recombining binomial tree
    treeviewer Tree information
    trintreepath Entries from node of recombining trinomial tree
    trintreeshape Shape of recombining trinomial tree

    Price Using Closed-Form Solutions

    Black Model

    capbyblk Price caps using Black option pricing model
    floorbyblk Price floors using Black option pricing model
    swaptionbyblk Price European swaption instrument using Black model

    SABR Model

    blackvolbysabr Calculate implied Black volatility using SABR model
    optsensbysabr Calculate option sensitivities using SABR model

    Agency OAS Models

    agencyoas Determine option-adjusted spread of callable bond using Agency OAS model
    agencyprice Price callable bond using Agency OAS model

    Bond Futures

    bndfutimprepo Implied repo rates for bond future given price
    bndfutprice Price bond future given repo rates
    convfactor Bond conversion factors
    tfutbyprice Future prices of Treasury bonds given spot price
    tfutbyyield Future prices of Treasury bonds given current yield
    tfutimprepo Implied repo rates for Treasury bond future given price
    tfutpricebyrepo Calculates Treasury bond futures price given the implied repo rates
    tfutyieldbyrepo Calculates Treasury bond futures yield given the implied repo rates

    Price Using Monte Carlo Simulation

    HullWhite1F Create Hull-White one-factor model
    LinearGaussian2F Create two-factor additive Gaussian interest-rate model
    LiborMarketModel Create LIBOR Market Model
    capbylg2f Price cap using Linear Gaussian two-factor model
    floorbylg2f Price floor using Linear Gaussian two-factor model
    swaptionbylg2f Price European swaption using Linear Gaussian two-factor model
    blackvolbyrebonato Compute Black volatility for LIBOR Market Model using Rebonato formula
    hwcalbycap Calibrate Hull-White tree using caps
    hwcalbyfloor Calibrate Hull-White tree using floors

    Portfolio Valuation

    instadd Add types to instrument collection
    instaddfield Add new instruments to instrument collection
    instdelete Complement of instrument set by matching conditions
    instdisp Display instruments
    instfields List field names
    instfind Search instruments for matching conditions
    instget Data from instrument variable
    instgetcell Data and context from instrument variable
    instlength Count instruments
    instselect Create instrument subset by matching conditions
    instsetfield Add or reset data for existing instruments
    insttypes List types
    intenvset Set properties of interest-rate structure
    hedgeopt Allocate optimal hedge for target costs or sensitivities
    hedgeslf Self-financing hedge

    Equity Derivatives

    Instrument Creation

    instasian Construct Asian option
    instbarrier Construct barrier option
    instcompound Construct compound option
    instlookback Construct lookback option
    instoptstock Construct stock option

    Price Using Tree Models

    Cox-Ross-Rubinstein Tree Setup

    crrtimespec Specify time structure for Cox-Ross-Rubinstein tree
    crrtree Construct Cox-Ross-Rubinstein stock tree
    stockspec Create stock structure

    Cox-Ross-Rubinstein Tree Analysis

    asianbycrr Price Asian option from Cox-Ross-Rubinstein binomial tree
    barrierbycrr Price barrier option from Cox-Ross-Rubinstein binomial tree
    compoundbycrr Price compound option from Cox-Ross-Rubinstein binomial tree
    crrprice Instrument prices from Cox-Ross-Rubinstein tree
    crrsens Instrument prices and sensitivities from Cox-Ross-Rubinstein tree
    lookbackbycrr Price lookback option from Cox-Ross-Rubinstein tree
    optstockbycrr Price stock option from Cox-Ross-Rubinstein tree
    derivget Get derivatives pricing options
    derivset Set or modify derivatives pricing options

    Equal Probabilities Binomial Tree Setup

    eqptimespec Specify time structure for Equal Probabilities binomial tree
    eqptree Construct Equal Probabilities stock tree
    stockspec Create stock structure

    Equal Probabilities Binomial Tree Analysis

    asianbyeqp Price Asian option from Equal Probabilities binomial tree
    barrierbyeqp Price barrier option from Equal Probabilities binomial tree
    compoundbyeqp Price compound option from Equal Probabilities binomial tree
    eqpprice Instrument prices from Equal Probabilities binomial tree
    eqpsens Instrument prices and sensitivities from Equal Probabilities binomial tree
    lookbackbyeqp Price lookback option from Equal Probabilities binomial tree
    optstockbyeqp Price stock option from Equal Probabilities binomial tree
    derivget Get derivatives pricing options
    derivset Set or modify derivatives pricing options

    Leisen-Reimer Tree Setup

    lrtimespec Specify time structure for Leisen-Reimer binomial tree
    lrtree Build Leisen-Reimer stock tree
    stockspec Create stock structure

    Leisen-Reimer Tree Analysis

    optstockbylr Price options on stocks using Leisen-Reimer binomial tree model
    optstocksensbylr Determine option prices and sensitivities using Leisen-Reimer binomial tree model

    Implied Trinomial Tree Setup

    itttimespec Specify time structure using implied trinomial tree (ITT)
    itttree Build implied trinomial stock tree
    stockoptspec Specify European stock option structure

    Implied Trinomial Tree Analysis

    asianbyitt Price Asian options using implied trinomial tree (ITT)
    barrierbyitt Price barrier options using implied trinomial tree (ITT)
    compoundbyitt Price compound options using implied trinomial tree (ITT)
    ittprice Price instruments using implied trinomial tree (ITT)
    ittsens Instrument sensitivities and prices using implied trinomial tree (ITT)
    lookbackbyitt Price lookback option using implied trinomial tree (ITT)
    optstockbyitt Price options on stocks using implied trinomial tree (ITT)
    derivget Get derivatives pricing options
    derivset Set or modify derivatives pricing options

    Tree Manipulation for Equity Instruments

    bushpath Extract entries from node of bushy tree
    bushshape Retrieve shape of bushy tree
    cvtree Convert inverse-discount tree to interest-rate tree
    mkbush Create bushy tree
    mktree Create recombining binomial tree
    mktrintree Create recombining trinomial tree
    treepath Entries from node of recombining binomial tree
    treeshape Shape of recombining binomial tree
    treeviewer Tree information
    trintreepath Entries from node of recombining trinomial tree
    trintreeshape Shape of recombining trinomial tree

    Price Using Closed-Form Solutions

    Black-Scholes Model

    assetbybls Determine price of asset-or-nothing digital options using Black-Scholes model
    assetsensbybls Determine price and sensitivities of asset-or-nothing digital options using Black-Scholes model
    cashbybls Determine price of cash-or-nothing digital options using Black-Scholes model
    cashsensbybls Determine price and sensitivities of cash-or-nothing digital options using Black-Scholes model
    chooserbybls Price European simple chooser options using Black-Scholes model
    gapbybls Determine price of gap digital options using Black-Scholes model
    gapsensbybls Determine price and sensitivities of gap digital options using Black-Scholes model
    impvbybls Determine implied volatility using Black-Scholes option pricing model
    optstockbybls Price options using Black-Scholes option pricing model
    optstocksensbybls Determine option prices and sensitivities using Black-Scholes option pricing model
    supersharebybls Calculate price of supershare digital options using Black-Scholes model
    supersharesensbybls Calculate price and sensitivities of supershare digital options using Black-Scholes model

    Black Model

    impvbyblk Determine implied volatility using Black option pricing model
    optstockbyblk Price options on futures and forwards using Black option pricing model
    optstocksensbyblk Determine option prices and sensitivities on futures and forwards using Black pricing model

    Roll-Geske-Whaley Model

    impvbyrgw Determine implied volatility using Roll-Geske-Whaley option pricing model for American call option
    optstockbyrgw Determine American call option prices using Roll-Geske-Whaley option pricing model
    optstocksensbyrgw Determine American call option prices and sensitivities using Roll-Geske-Whaley option pricing model

    Bjerksund-Stensland Model

    impvbybjs Determine implied volatility using Bjerksund-Stensland 2002 option pricing model
    optstockbybjs Price American options using Bjerksund-Stensland 2002 option pricing model
    optstocksensbybjs Determine American option prices and sensitivities using Bjerksund-Stensland 2002 option pricing model
    spreadbybjs Price European spread options using Bjerksund-Stensland pricing model
    spreadsensbybjs Calculate European spread option prices and sensitivities using Bjerksund-Stensland pricing model

    Nengjiu Ju Model

    basketbyju Price European basket options using Nengjiu Ju approximation model
    basketsensbyju Determine European basket options price and sensitivities using Nengjiu Ju approximation model
    basketstockspec Specify basket stock structure using Longstaff-Schwartz model

    Stulz Model

    maxassetbystulz Determine European rainbow option price on maximum of two risky assets using Stulz option pricing model
    maxassetsensbystulz Determine European rainbow option prices and sensitivities on maximum of two risky assets using Stulz pricing model
    minassetbystulz Determine European rainbow option prices on minimum of two risky assets using Stulz option pricing model
    minassetsensbystulz Determine European rainbow option prices and sensitivities on minimum of two risky assets using Stulz pricing model

    Kirk Model

    spreadbykirk Price European spread options using Kirk pricing model
    spreadsensbykirk Calculate European spread option prices and sensitivities using Kirk pricing model

    Kemna Vorst Model

    asianbykv Prices European geometric Asian options using Kemna-Vorst model
    asiansensbykv Calculate prices and sensitivities of European geometric Asian options using Kemna-Vorst model

    Levy Model

    asianbylevy Price of European arithmetic Asian options using Levy model
    asiansensbylevy Calculate prices and sensitivities of European arithmetic Asian options using Levy model

    Conze-Viswanathan and Goldman-Sosin-Gatto Models

    lookbackbycvgsg Calculate prices of European lookback options using Conze-Viswanathan and Goldman-Sosin-Gatto models
    lookbacksensbycvgsg Calculate prices and sensitivities of European lookback options using Conze-Viswanathan and Goldman-Sosin-Gatto models

    Price Using Monte Carlo Simulation

    basketbyls Price basket options using Longstaff-Schwartz model
    basketsensbyls Determine price and sensitivities for basket options using Longstaff-Schwartz model
    basketstockspec Specify basket stock structure using Longstaff-Schwartz model
    asianbyls Price European or American Asian option using Longstaff-Schwartz model
    asiansensbyls Calculate European or American Asian option prices and sensitivities using Longstaff-Schwartz model
    lookbackbyls Calculate prices of lookback options using Longstaff-Schwartz model
    lookbacksensbyls Calculate prices and sensitivities of lookback options using Longstaff-Schwartz model
    spreadbyls Price European or American spread options using Monte Carlo simulations
    spreadsensbyls Calculate price and sensitivities for European or American spread options using Monte Carlo simulations
    optstockbyls Price European, Bermudan, or American vanilla options using Longstaff-Schwartz model
    optstocksensbyls Calculate European, Bermudan, or American vanilla option prices and sensitivities using Longstaff-Schwartz model
    optpricebysim Price option given simulated underlying values

    Portfolio Valuation

    instadd Add types to instrument collection
    instaddfield Add new instruments to instrument collection
    instdelete Complement of instrument set by matching conditions
    instdisp Display instruments
    instfields List field names
    instfind Search instruments for matching conditions
    instget Data from instrument variable
    instgetcell Data and context from instrument variable
    instlength Count instruments
    instselect Create instrument subset by matching conditions
    instsetfield Add or reset data for existing instruments
    insttypes List types
    stockspec Create stock structure
    intenvset Set properties of interest-rate structure
    basketstockspec Specify basket stock structure using Longstaff-Schwartz model
    hedgeopt Allocate optimal hedge for target costs or sensitivities
    hedgeslf Self-financing hedge

    Energy Derivatives

    Price Using Monte Carlo Simulation

    spreadbyls Price European or American spread options using Monte Carlo simulations
    spreadsensbyls Calculate price and sensitivities for European or American spread options using Monte Carlo simulations
    asianbyls Price European or American Asian option using Longstaff-Schwartz model
    asiansensbyls Calculate European or American Asian option prices and sensitivities using Longstaff-Schwartz model
    lookbackbyls Calculate prices of lookback options using Longstaff-Schwartz model
    lookbacksensbyls Calculate prices and sensitivities of lookback options using Longstaff-Schwartz model
    optstockbyls Price European, Bermudan, or American vanilla options using Longstaff-Schwartz model
    optstocksensbyls Calculate European, Bermudan, or American vanilla option prices and sensitivities using Longstaff-Schwartz model
    optpricebysim Price option given simulated underlying values

    Price Using Closed-Form Solutions

    spreadbykirk Price European spread options using Kirk pricing model
    spreadsensbykirk Calculate European spread option prices and sensitivities using Kirk pricing model
    spreadbybjs Price European spread options using Bjerksund-Stensland pricing model
    spreadsensbybjs Calculate European spread option prices and sensitivities using Bjerksund-Stensland pricing model
    asianbykv Prices European geometric Asian options using Kemna-Vorst model
    asiansensbykv Calculate prices and sensitivities of European geometric Asian options using Kemna-Vorst model
    asianbylevy Price of European arithmetic Asian options using Levy model
    asiansensbylevy Calculate prices and sensitivities of European arithmetic Asian options using Levy model
    lookbackbycvgsg Calculate prices of European lookback options using Conze-Viswanathan and Goldman-Sosin-Gatto models
    lookbacksensbycvgsg Calculate prices and sensitivities of European lookback options using Conze-Viswanathan and Goldman-Sosin-Gatto models
    optstockbyblk Price options on futures and forwards using Black option pricing model
    optstocksensbyblk Determine option prices and sensitivities on futures and forwards using Black pricing model

    Price Using Finite Differences

    spreadbyfd Price European or American spread options using finite difference method
    spreadsensbyfd Calculate price and sensitivities of European or American spread options using finite difference method

    Credit Derivatives

    Credit Default Swaps

    cdsbootstrap Bootstrap default probability curve from credit default swap market quotes
    cdsprice Determine price for credit default swap
    cdsspread Determine spread of credit default swap
    cdsrpv01 Compute risky present value of a basis point for credit default swap

    Credit Default Swap Options

    cdsoptprice Price payer and receiver credit default swap options
    cdsrpv01 Compute risky present value of a basis point for credit default swap

    Counterparty Credit Risk

    creditexposures Compute credit exposures from contract values
    exposureprofiles Compute exposure profiles from credit exposures

    Mortgage-Backed Securities

    Mortgage Pass-Through

    mbscfamounts Cash flow and time mapping for mortgage pool
    mbsconvp Convexity of mortgage pool given price
    mbsconvy Convexity of mortgage pool given yield
    mbsdurp Duration of mortgage pool given price
    mbsdury Duration of mortgage pool given yield
    mbsnoprepay End-of-month mortgage cash flows and balances without prepayment
    mbspassthrough Mortgage pool cash flows and balances with prepayment
    mbsprice Mortgage-backed security price given yield
    mbswal Weighted average life of mortgage pool
    mbsyield Mortgage-backed security yield given price
    mbsprice2speed Implied PSA prepayment speeds given price
    mbsyield2speed Implied PSA prepayment speeds given yield
    psaspeed2default Benchmark default
    psaspeed2rate Single monthly mortality rate given PSA speed
    mbsoas2price Price given option-adjusted spread
    mbsoas2yield Yield given option-adjusted spread
    mbsprice2oas Option-adjusted spread given price
    mbsyield2oas Option-adjusted spread given yield

    Collateralized Mortgage Obligations

    cmoseqcf Generate cash flows for sequential collateralized mortgage obligation (CMO)
    cmoschedcf Generate cash flows for scheduled collateralized mortgage obligation (CMO) using PAC or TAC model
    cmosched Generate principal balance schedule for planned amortization class (PAC) or targeted amortization class (TAC) bond
    mbscfamounts Cash flow and time mapping for mortgage pool
    cfspread Compute spread over yield curve for cash flow
    cfprice Compute price for cash flow given yield to maturity
    cfyield Compute yield to maturity for cash flow given price

    Convertible Bonds

    cbprice Price convertible bond

    Numerix Interface

    numerix Create numerix object to set up Numerix CAIL environment
    Was this topic helpful?