本文へ移動
cccskills
無料GitHub で公開

matlab-price-instrument

Price financial instruments in MATLAB using the Financial Instruments Toolbox. Route to the appropriate numerical method reference based on the user's request: Monte Carlo simulation (AssetMonteCarlo, IRMonteCarlo, RoughVolMonteCarlo), FFT / Numerical Integration (Vanilla European options), or Interest-Rate Trees (option-embedded bonds with IRTree). Use when the user asks to price financial instruments or compute Greeks using any of these methods. Use one of the following models depending on the pricing method and instrument: Black-Scholes, Bachelier, Heston, Bates, Merton, Hull-White, Black-Karasinski, Black-Derman-Toy, Cox-Ingersoll-Ross, Linear Gaussian 2 Factor (G2PP), Brace-Gatarek-Musiela (BGM), SABR-BGM, RoughBergomi, RoughHeston.

インストール方法を見る

含まれるファイル(11)

  • SKILL.md6.3 KB
  • manifest.yaml462 B
  • references/embedded-bond-tree.md10.2 KB
  • references/monte-carlo.md5.2 KB
  • references/monte-carlo/asset-monte-carlo.md13.0 KB
  • references/monte-carlo/ir-monte-carlo.md17.9 KB
  • references/ni-fft.md20.5 KB
  • references/ni-fft/bates-legacy-api.md2.1 KB
  • references/ni-fft/heston-legacy-api.md1.9 KB
  • references/ni-fft/legacy-api-shared.md4.3 KB
  • references/ni-fft/merton-legacy-api.md2.3 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Price Financial Instruments in MATLAB

Price financial instruments in MATLAB using the Financial Instruments Toolbox. Route to the correct numerical pricing method based on the user's request, then follow the method-specific reference for implementation details.

When to Use

  • User asks to price options, bonds, swaps, or derivatives in MATLAB
  • User asks for Greeks/sensitivities (delta, vega, gamma, theta, rho, lambda)
  • User mentions finpricer, fininstrument, finmodel, or ratecurve
  • User asks about Monte Carlo, tree / lattice, or FFT (Fast Fourier Transform) / FRFT (Fractional FFT) pricing
  • User wants to compare pricing methods for the same instrument

When NOT to Use

  • User is working with a non-MATLAB environment
  • User wants to build a custom instrument with a novel payoff function
  • User explicitly asks for a from-scratch implementation without the Financial Instruments Toolbox

Method Routing

Identify the pricing method from the user's request and read the corresponding reference:

MethodReferenceWhen to Use
Monte Carlo (MC)references/monte-carlo.mdSimulation-based pricing: path-dependent options, exotic options, Interest Rate (IR) derivatives via MC, rough volatility
FFT / FRFT / Numerical Integrationreferences/ni-fft.mdFast pricing: European vanilla options under Heston/Bates/Merton via characteristic functions
Interest Rate Treesreferences/embedded-bond-tree.mdCallable/puttable fixed-rate bonds with Hull-White (HW), Black-Karasinski (BK), Black-Derman-Toy (BDT), Cox-Ingersoll-Ross (CIR) tree models

Routing Rules

Read exactly one reference (and any relevant sub-references) that best matches based on these rules:

  1. User mentions a specific pricer:

    • AssetMonteCarlo, RoughVolMonteCarlo, IRMonteCarlo -> references/monte-carlo.md
    • FFT, NumericalIntegration -> references/ni-fft.md
    • IRTree -> references/embedded-bond-tree.md
  2. User mentions a specific numerical method and associated concepts:

    • Monte Carlo, simulation, NumTrials, SimulationDates -> references/monte-carlo.md
    • FFT, FRFT, characteristic function, CharacteristicFcnStep, LogStrikeStep -> references/ni-fft.md
    • Interest-rate tree, TreeDates, exercise probability -> references/embedded-bond-tree.md
  3. User mentions instrument type without a method:

    • Path-dependent options or other exotic options (Asian, Barrier, Lookback, Cliquet, Touch, Spread, Binary) -> references/monte-carlo.md
    • European vanilla options under stochastic vol/jump models -> references/ni-fft.md
    • Callable/puttable fixed-rate bonds -> references/embedded-bond-tree.md
    • IR derivatives (caps, floors, swaptions, swaps) -> references/monte-carlo.md
  4. User mentions model name without a method:

    • Heston, Bates, Merton + European vanilla -> references/ni-fft.md
    • Heston, Bates, Merton + exotic/path-dependent -> references/monte-carlo.md
    • Hull-White, Black-Karasinski, BDT, CIR + callable/puttable bond -> references/embedded-bond-tree.md
    • Hull-White, BK, Linear Gaussian 2 Factor (G2PP), Brace-Gatarek-Musiela (BGM), SABR-BGM + caps/floors/swaptions -> references/monte-carlo.md
    • Rough volatility (RoughBergomi, RoughHeston) -> references/monte-carlo.md
  5. Ambiguous:

    • When asked to price European vanilla options without specifying pricing method (e.g., "price European call options with Heston in MATLAB"), default to references/ni-fft.md (faster, more accurate for European vanilla)
    • If user needs path simulation in addition to price and sensitivities, use references/monte-carlo.md
    • If user requests exercise probabilities at each time step for option embedded bonds, use references/embedded-bond-tree.md

Shared Conventions

All three methods share these conventions:

  • Always prefer to use finpricer/fininstrument/finmodel/ratecurve objects (modern OO API) over legacy functions
  • Never use legacy functions unless the user explicitly names them, or the reference suggests them for specific use cases
  • Use name-value pairs with string keys: "DiscountCurve", not positional arguments
  • Parameter names are case-insensitive but write them in MixedCase for clarity
  • Always use datetime for dates (not datenum)
  • Do not use price as a variable name — it shadows the price function; prefer p, or capitalized Price
  • Request two outputs from price() when Greeks or tree data are needed: [p, pr] = price(...)

Common Mistakes (Cross-Method)

Best practice: Check MATLAB documentation (doc <functionName>, or help <functionName>, etc.) via the MATLAB MCP server before writing code.

MistakeCorrect
finpricer("MonteCarlo", ...)finpricer("AssetMonteCarlo", ...) or finpricer("IRMonteCarlo", ...)
finpricer("HWMonteCarlo", ...)finpricer("IRMonteCarlo", ...) with a HullWhite model
Mixing pricer families (e.g., FFT pricer for Asian option)FFT/NI only works for European vanilla; use AssetMonteCarlo for exotics
Using datenumAlways use datetime
Forgetting second output for Greeks[p, pr] = price(pricer, inst, "delta") — Greeks are in pr.Results
discount(rc, dates)discountfactors(rc, dates) — ratecurve uses discountfactors(), not discount()

Copyright 2026 The MathWorks, Inc.


レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Guide for accessing financial and economic data in MATLAB using the Datafeed Toolbox. Covers Bloomberg (market data via bloomberg/blp/bloombergHypermedia), FRED (Federal Reserve economic data via fredrs), Haver Analytics (economic data via haver/haverdirect/haverview), and LSEG Datastream (historical data via datastreamws). Use when connecting to any of these data providers from MATLAB.

日本語の概要は準備中です。原文の説明を表示しています。

matlab/matlab-agentic-toolkit1,1572026年10月9日 更新

Read BEFORE writing any code that adds Additive White Gaussian Noise (AWGN) to signals and converts between SNR, Eb/No, Es/No, and per-subcarrier SNR for communications simulations, using awgn(), convertSNR(), berawgn(). The default MATLAB patterns for AWGN (e.g., 'measured' option, manual SNR formulas) produce subtly incorrect results. This skill specifies the correct calling conventions, required function usage, and critical anti-patterns that must be avoided.

日本語の概要は準備中です。原文の説明を表示しています。

matlab/matlab-agentic-toolkit1,1572026年10月9日 更新

Analyze AMS waveform data using Mixed-Signal Blockset utilities: phase noise measurement, clock jitter, anti-aliased resampling, timing measurements, lock time, INL/DNL, ADC/DAC calibration, HSpice import. Use when analyzing time-domain voltage from PLL/VCO/clock simulations, measuring phase noise from variable-step solver output, computing jitter, or resampling non-uniform data.

日本語の概要は準備中です。原文の説明を表示しています。

matlab/matlab-agentic-toolkit1,1572026年10月9日 更新

Design and analyze electrically large antenna structures using MATLAB Antenna Toolbox. Covers reflector antennas (parabolic, Cassegrain, Gregorian, offset, corner, cylindrical, spherical, custom STL), reflectarrays and reconfigurable intelligent surfaces (RIS), antennas installed on platforms (vehicles, aircraft, ships, satellites), and radar cross section (RCS) analysis. Includes solver selection (MoM-PO, PO, MoM, FMM), mesh control, and GPU acceleration. Use when the user wants to design a dish/reflector antenna, reflectarray, analyze an antenna on a platform, or compute RCS.

日本語の概要は準備中です。原文の説明を表示しています。

matlab/matlab-agentic-toolkit1,1572026年10月9日 更新

Analyze data using MATLAB. Use when the task involves tables, timetables, time-series data, numeric arrays, sensor matrices, or gridded data — including but not limited to exploring, row filtering, sorting, cleaning, transforming, aggregating, smoothing, padding, trimming, and answering questions about data. MATLAB provides extensive, easy-to-use built-in functions for these workflows with no additional products required.

日本語の概要は準備中です。原文の説明を表示しています。

matlab/matlab-agentic-toolkit1,1572026年10月9日 更新

S-parameters, insertion loss, fields, currents, mesh control, and solver selection for RF PCB performance validation. TRIGGER: user asks to compute S-parameters, analyze insertion/return loss, extract fields or currents, compare MoM vs FEM, or control mesh for any RF PCB component. Invoke BEFORE writing sparameters() or solver code — API is non-obvious. SKIP: designing or creating components (use the specific matlab-design-pcb-* skill), material/stackup setup only (use matlab-manage-pcb-material), optimization sweeps (use matlab-optimize-pcb-design), PDN/IR-drop analysis (use matlab-analyze-pcb-pdn).

日本語の概要は準備中です。原文の説明を表示しています。

matlab/matlab-agentic-toolkit1,1572026年10月9日 更新

matlab のスキルをすべて見る

このスキルの問題を報告する