Geometric Brownian Motion
Bases: ABCStochasticProcess
A class for Geometric Brownian Motion
The stochastic equation is:
dS_t = S_t(\mu * dt + \sigma * dB_t)
where B_t is the Brownian motion and S_t is the process at time t.
Example:
>>> gbm = GeometricBrownianMotion(mu=0., sigma=0.5)
>>> paths = gbm.simulate(
>>> initial_value=0.5,
>>> n_steps=52,
>>> delta=1/52,
>>> n_simulations=100
>>> )
Example:
>>> data = pd.read_csv('path/to/data.csv')
>>> gbm = GeometricBrownianMotion()
>>> res = gbm.calibrate(data)
Initialize the class
| Parameters: |
|
|---|
bounds: BaseModel
property
Return the model bounds
is_calibrated: bool
property
Return a flag to indicate whereas parameters are not null
parameters: dict
property
Return the model parameters
__repr__() -> str
Override the REPL output
__str__() -> str
Override the print output
calibrate(observations: pd.DataFrame, delta: float = 1, method: str = 'mle', n_boot_resamples: int = 1000, n_jobs: int = 2, n_trials: int = 8, starting_value: dict | None = None) -> CalibrationResult
Calibrate the parameters of the stochastic process using various estimation methods.
This method calibrates the parameters of the stochastic process based on the provided observations and specified calibration settings. The calibration can be performed using different methods, including Maximum Likelihood Estimation (MLE), parametric bootstrap, or non-parametric bootstrap.
For numerical estimation of MLE see:
• López-Pérez, Alejandra, Manuel Febrero-Bande, and Wencesalo González-Manteiga. "Parametric Estimation of Diffusion Processes: A Review and Comparative Study." Mathematics 9.8 (2021): 859.
For parametric bootstrap:
• Tang, Cheng Yong, and Song Xi Chen. "Parameter estimation and bias correction for diffusion processes." Journal of Econometrics 149.1 (2009): 65-81.
For non-parametric bootstrap
• Hall, Peter. "Resampling a coverage pattern." Stochastic processes and their applications 20.2 (1985): 231-246.
• Bühlmann, Peter. "Bootstraps for time series." Statistical science (2002): 52-72.
The optimal length is selected according to:
• Buhlmann, Peter. "Blockwise bootstrapped empirical process for stationary sequences." The Annals of Statistics (1994): 995-1012.
| Parameters: |
|
|---|
| Returns: |
|
|---|
copy() -> Self
Create a deep-copy of the object
| Returns: |
|
|---|
log_likelihood(observations: pd.DataFrame, delta: float = 1.0) -> float
Calculate the log-likelihood function for the stochastic process.
This method computes the log-likelihood function of the stochastic process based on the provided observations and sampling interval, using the parameters stored as attributes within the object.
| Parameters: |
|
|---|
| Returns: |
|
|---|
simulate(initial_value: float | tuple, n_steps: int, delta: float = 1.0, n_simulations: int = 1, method: str = 'exact') -> pd.DataFrame
Simulate paths of the stochastic process.
This method generates simulated paths of a generic stochastic process based on the provided parameters.
| Parameters: |
|
|---|
| Returns: |
|
|---|