Allow stochastic models to be fit with historical data. This seems like a BIG task, but important.
Ideas that may be relevant:
- use MLE where appropriate, or possible
- use the "Exact Algorithm"
- add a
_transition_density property to each model, where it exists
|
def fit(self, X: np.ndarray, y: np.ndarray): |
|
""" |
|
Fits the parameters of the diffusion process based on historical data. |
|
|
|
The exact method of fitting should be defined at the subclass level, because the |
|
implementation can vary depending on the model. |
|
|
|
Parameters |
|
---------- |
|
X : np.ndarray, the indices of times/dates of the observed prices |
|
y : np.ndarray, the observed prices or values on the given dates. If multiple |
|
indices, then y will be a matrix, where the columns are the indices. |
|
|
|
Returns |
|
------- |
|
self |
|
""" |
|
raise NotImplementedError() |
Allow stochastic models to be fit with historical data. This seems like a BIG task, but important.
Ideas that may be relevant:
_transition_densityproperty to each model, where it existspyesg/pyesg/diffusion_process.py
Lines 96 to 113 in ddde7ec