CEV Model#
Bases: BaseModel
Constant Elasticity of Variance (CEV) model.
Source code in src/quantfin/models/cev.py
__init__(params: dict[str, float] | None = None)
#
Initializes the CEV model.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
params
|
dict[str, float] | None
|
A dictionary of model parameters. If None, |
None
|
Source code in src/quantfin/models/cev.py
sample_terminal_spot(S0: float, r: float, T: float, size: int) -> np.ndarray
#
Exact simulation of the terminal spot price via Non-Central Chi-Squared.
This method provides a way to sample directly from the terminal distribution of the CEV process, which is more efficient than path-based simulation for pricing European options.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
S0
|
float
|
The initial spot price of the asset. |
required |
r
|
float
|
The continuously compounded risk-free rate. |
required |
T
|
float
|
The time to maturity, in years. |
required |
size
|
int
|
The number of samples to generate. |
required |
Returns:
Type | Description |
---|---|
ndarray
|
An array of simulated terminal spot prices. |