Main Content

finpricer

Create pricing method

Description

example

Pricer = finpricer(PricerType,Name,Value) creates a Pricer object based on PricerType creates a pricer object and specifies options using one or more name-value pair arguments. The available name-value pair arguments depend on the PricerType you specify.

For more information on the workflow for creating an instrument object, a model object, and a pricer object, see Get Started with Workflows Using Object-Based Framework for Pricing Financial Instruments.

For more information on the available instruments, models, and pricing methods, see Choose Instruments, Models, and Pricers.

Examples

collapse all

This example shows the workflow to create a BlackScholes model and ratecurve object to use with a ConzeViswanathan pricing method.

Create BlackScholes Model Object

Use finmodel to create a BlackScholes model object.

BlackScholesModel = finmodel("BlackScholes",'Volatility',.358)
BlackScholesModel = 
  BlackScholes with properties:

     Volatility: 0.3580
    Correlation: 1

Create ratecurve Object

Create a ratecurve object using ratecurve.

Settle = datetime(2020,9,15);
Type = 'zero';
ZeroTimes = [calmonths(6) calyears([1 2 3 4 5 7 10 20 30])]';
ZeroRates = [0.0052 0.0055 0.0061 0.0073 0.0094 0.0119 0.0168 0.0222 0.0293 0.0307]';
ZeroDates = Settle + ZeroTimes;
 
myRC = ratecurve('zero',Settle,ZeroDates,ZeroRates)
myRC = 
  ratecurve with properties:

                 Type: "zero"
          Compounding: -1
                Basis: 0
                Dates: [10x1 datetime]
                Rates: [10x1 double]
               Settle: 15-Sep-2020
         InterpMethod: "linear"
    ShortExtrapMethod: "next"
     LongExtrapMethod: "previous"

Create ConzeViswanathan Pricer Object

Use finpricer to create a ConzeViswanathan pricer object and use the ratecurve object for the 'DiscountCurve' name-value pair argument.

outPricer = finpricer("analytic",'Model',BlackScholesModel,'DiscountCurve',myRC,'SpotPrice',950,'DividendValue',2.5,'DividendType',"continuous",'PricingMethod',"ConzeViswanathan")
outPricer = 
  ConzeViswanathan with properties:

    DiscountCurve: [1x1 ratecurve]
            Model: [1x1 finmodel.BlackScholes]
        SpotPrice: 950
    DividendValue: 2.5000
     DividendType: "continuous"

Input Arguments

collapse all

Pricer type, specified as a scalar string or character vector.

These options are available for interest-rate instruments:

  • "Discount" — For more information, see Discount.

  • "IRTree" — For more information, see IRTree.

  • "HullWhite" — For more information, see HullWhite.

  • "Analytic" — The "Analytic" pricer can be any one of the following types of pricing methods:

    • SABR — For more information, see SABR.

    • Normal — For more information, see Normal.

    • Black — For more information, see Black.

These options are available for equity instruments:

  • "Analytic" — The "Analytic" pricer can be any one of the following types of pricing methods:

  • "AssetMonteCarlo" — For more information, see AssetMonteCarlo.

  • "FiniteDifference" — For more information, see FiniteDifference.

  • "FFT" — For more information, see FFT.

  • "NumericalIntegration" — For more information, see NumericalIntegration.

  • "VannaVolga" — For more information, see VannaVolga.

  • "ReplicatingVarianceSwap" — For more information, see ReplicatingVarianceSwap.

These options are available for credit derivative instruments:

  • "Credit" — For more information, see Credit.

  • "Analytic" — The "Analytic" pricer can be any one of the following types of pricing methods:

    • CDSBlack — For more information, see CDSBlack.

Data Types: string | char

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside quotes. You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

Example: Pricer = finpricer("Black",Name,Value)

Depending on the PricerType, the associated name-value pair arguments are different.

Name-Value Pair Arguments for Interest-Rate Pricers
  • IRTree — For more information, see IRTree.

  • Black — For more information, see Black.

  • HullWhite — For more information, see HullWhite.

  • Normal — For more information, see Normal.

  • Sabr — For more information, see Sabr.

  • Discount — For more information, see Discount.

Name-Value Pair Arguments for Equity Pricers
Name-Value Pair Arguments for Credit Derivative Pricers
  • Credit — For more information, see Credit.

  • CDSBlack — For more information, see CDSBlack.

Output Arguments

collapse all

Pricer, returned as a pricer object.

Introduced in R2020a