Assets
Assets shared by the economics packages.
They are assets with a price and the geometric Brownian motion of a price.
AssetElement(label, *, price=1.0)
Bases: Element
Traded asset described by its price.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
label
|
str
|
The label of the asset. |
required |
price
|
Annotated[float, open(0, oo)]
|
The initial price. |
1.0
|
Examples:
>>> from skcomplex.systems.economics.finance import AssetElement
>>> AssetElement('stock', price=100.0).price
100.0
Source code in src/skcomplex/systems/economics/common/assets/_asset.py
30 31 32 33 34 35 36 37 | |
GeometricBrownianMotionInteraction(label, *, target, mu=0.05, sigma=0.2, process=None, index=None)
Bases: Interaction
Geometric Brownian motion of the price of an asset.
It follows dS = mu * S * dt + sigma * S * dW. The Wiener process dW is independent by default, or process
index of a WienerProcessSpec that correlates it with the motions of other assets.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
label
|
str
|
The label of the interaction. |
required |
target
|
Role
|
The path of the asset. |
required |
mu
|
float
|
The drift. |
0.05
|
sigma
|
Annotated[float, closed_open(0, oo)]
|
The volatility. |
0.2
|
process
|
WienerProcessSpec | None
|
The Wiener processes, one of which drives the price, or |
None
|
index
|
int | None
|
The process of |
None
|
Examples:
>>> from skcomplex.systems.economics.finance import GeometricBrownianMotionInteraction
>>> from skcomplex.core.components.interactions import WienerProcessSpec
>>> GeometricBrownianMotionInteraction('gbm', target='stock', sigma=0.3).sigma
0.3
>>> market = WienerProcessSpec('market', dimension=2)
>>> GeometricBrownianMotionInteraction('gbm', target='stock', process=market, index=1).index
1
Source code in src/skcomplex/systems/economics/common/assets/_geometric_brownian_motion.py
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | |