jump-diffusion-estimation 0.2.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,19 @@
1
+ # ==========================================
2
+ # src/jump_diffusion/estimation/__init__.py
3
+ # ==========================================
4
+
5
+ """
6
+ Parameter Estimation Methods
7
+
8
+ This module implements various methods for estimating parameters of
9
+ jump-diffusion models, including maximum likelihood, method of moments,
10
+ and Bayesian approaches.
11
+ """
12
+
13
+ from .maximum_likelihood import JumpDiffusionEstimator
14
+ from .base_estimator import BaseEstimator
15
+
16
+ __all__ = [
17
+ "JumpDiffusionEstimator",
18
+ "BaseEstimator",
19
+ ]
@@ -0,0 +1,62 @@
1
+ """
2
+ Base estimator class for parameter estimation.
3
+ """
4
+
5
+ from abc import ABC, abstractmethod
6
+ from typing import Dict, Any, Optional
7
+ import numpy as np
8
+
9
+
10
+ class BaseEstimator(ABC):
11
+ """
12
+ Abstract base class for all parameter estimators.
13
+ """
14
+
15
+ def __init__(self, data: np.ndarray, dt: float):
16
+ """
17
+ Initialize estimator with data.
18
+
19
+ Parameters:
20
+ -----------
21
+ data : np.ndarray
22
+ One-dimensional array of observed increments
23
+ dt : float
24
+ Time step size
25
+ """
26
+ self.data = data
27
+ self.dt = dt
28
+ self.fitted = False
29
+ self.results: Optional[Dict[str, Any]] = None
30
+
31
+ @abstractmethod
32
+ def estimate(self, **kwargs) -> Dict[str, Any]:
33
+ """
34
+ Estimate model parameters.
35
+
36
+ Returns:
37
+ --------
38
+ dict
39
+ Estimation results including parameters and diagnostics
40
+ """
41
+ pass
42
+
43
+ @abstractmethod
44
+ def log_likelihood(self, params: np.ndarray) -> float:
45
+ """
46
+ Calculate log-likelihood for given parameters.
47
+
48
+ Parameters:
49
+ -----------
50
+ params : np.ndarray
51
+ Parameter values
52
+
53
+ Returns:
54
+ --------
55
+ float
56
+ Log-likelihood value
57
+ """
58
+ pass
59
+
60
+ def get_results(self) -> Optional[Dict[str, Any]]:
61
+ """Get estimation results if available."""
62
+ return self.results