### Install PyFENG with pip Source: https://pyfeng.readthedocs.io/en/latest/index.html Install the PyFENG package using pip. This is the standard installation command. ```bash pip install pyfeng ``` -------------------------------- ### Price options with Bsm model (single sigma) Source: https://pyfeng.readthedocs.io/en/latest/index.html Create a Bsm model instance with a single volatility and price options for strikes from 80 to 120 with a spot of 100 and time to expiry of 1.2. The output shows the resulting option prices. ```python import numpy as np import pyfeng as pf m = pf.Bsm(sigma=0.2, intr=0.05, divr=0.1) m.price(strike=np.arange(80, 121, 10), spot=100, texp=1.2) ``` ```text array([15.71361973, 9.69250803, 5.52948546, 2.94558338, 1.48139131]) ``` -------------------------------- ### Price options with Bsm model (vectorized sigma and strikes) Source: https://pyfeng.readthedocs.io/en/latest/index.html Create a Bsm model with multiple volatilities (sigma in axis=0) and price options for strikes [90, 95, 100] with mixed call/put flags (cp array). The output shows a 2D array of option prices. ```python sigma = np.array([[0.2], [0.5]]) m = pf.Bsm(sigma, intr=0.05, divr=0.1) # sigma in axis=0 m.price(strike=np.array([90, 95, 100]), spot=100, texp=1.2, cp=np.array([-1,1,1])) ``` ```text array([[ 5.75927238, 7.38869609, 5.52948546], [16.812035 , 18.83878533, 17.10541288]]) ``` -------------------------------- ### pyfeng.sv_fft Module Source: https://pyfeng.readthedocs.io/en/latest/_sources/sv_fft.rst.txt Provides Fourier inversion pricing methods for stochastic volatility models. The module includes classes for Heston, OUSV, Variance Gamma, Exponential NIG, 3/2, rough Heston, and GARCH models. ```APIDOC ## Module: pyfeng.sv_fft ### Description This module implements Fourier inversion methods for pricing under various stochastic volatility models. It provides classes for Heston, OUSV, Variance Gamma, Exponential NIG, 3/2, rough Heston, and GARCH models. ### Classes - **HestonFft** - Fourier inversion for the Heston model. - **OusvFft** - Fourier inversion for the OUSV model. - **VarGammaFft** - Fourier inversion for the Variance Gamma model. - **ExpNigFft** - Fourier inversion for the Exponential NIG model. - **Sv32Fft** - Fourier inversion for the 3/2 stochastic volatility model. - **RoughHestonFft** - Fourier inversion for the rough Heston model. - **GarchFftWuMaWang2012** - Fourier inversion for the GARCH model as per Wu, Ma, and Wang (2012). ### Notes - Inherited members are included. - The base class `FftABC` is excluded from documentation. ``` -------------------------------- ### Upgrade PyFENG with pip Source: https://pyfeng.readthedocs.io/en/latest/index.html Upgrade the PyFENG package to the latest version using pip. ```bash pip install pyfeng --upgrade ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.