Main Content

finpricer

Create pricing method

Since R2020a

Description

example

Pricer = finpricer(PricerType,Name,Value) creates a Pricer object based on PricerType creates a pricer object and specifies pricing 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:

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

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

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

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

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

  • "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 inflation instruments:

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

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

These options are available for equity instruments:

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

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

  • "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.

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

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 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: 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
Name-Value Pair Arguments for Inflation Pricers
Name-Value Pair Arguments for Equity Pricers
Name-Value Pair Arguments for Credit Derivative Pricers

Output Arguments

collapse all

Pricer, returned as a pricer object.

Version History

Introduced in R2020a