Dynamics#
Dynamics.
- class osc_physrisk_financial.dynamics.ConstantGrowth(growth_rate: float, value0: float, name: str | None = None)[source]#
Bases:
DynamicClass representing a constant growth model: \(V_t = V_0 \\times (1 + \mu)^t.\).
- Parameters:
growth_rate (float) – Constant growth rate \(\mu.\)
name (string, optional) – Name for identification.
value0 (float) – \(V_0\) in [Methodology]
Examples
>>> cg = ConstantGrowth(growth_rate=0.02, name='RealAsset')
References
Methodology, Chapter 4 of Methodology survey (Overleaf).
- compute_value(dates: DatetimeIndex | list)[source]#
Compute the asset value at future dates.
- dates#
Dates for which the value wants to be computed. Note that in this model we are only interested in the years, so we only extract that part. The initial date is also included here ( \(t_{0}\) such that \(V_{t_0} = V_0\) of [Methodology].
- Type:
pandas.DatetimeIndex, list of strings, pandas.Timestamp, or string
- Returns:
\(V_t\) in [Methodology] for the different dates. It includes the value \(V_0\). Note that the dates have been sorted and the output is returned with the dates sorted.
- Return type:
np.ndarray
References
Methodology, Chapter 4 of Methodology survey (Overleaf).
- class osc_physrisk_financial.dynamics.Dynamic(name: str | None = None)[source]#
Bases:
ABCA base class for simulating asset value dynamics.
Notes
This base class is based on Underlying from pypricing.
- abstract compute_value(dates: DatetimeIndex | list)[source]#
Abstract method for computing the asset value at future dates.
- dates#
Future dates for which the asset value wants to be computed.
- Type:
pandas.DatetimeIndex, list of strings, pandas.Timestamp, or string
Notes
This base class is based on Underlying from pypricing.