Skip to content

Commit bbde374

Browse files
committed
make covariance shrinkage default to None for static FC
1 parent 8cec3f8 commit bbde374

1 file changed

Lines changed: 23 additions & 6 deletions

File tree

src/comet/connectivity.py

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1798,8 +1798,8 @@ class Static_Pearson(ConnectivityMethod):
17981798
----------
17991799
time_series : np.ndarray
18001800
The input time series data.
1801-
cov_estimator : str, optional
1802-
Method to estimate covariance. Default is Ledoit-Wolf shrinkage.
1801+
shrinkage : str, optional
1802+
Shrinkage for covariance estimation. Can be None or Ledoit-Wolf. Default is None.
18031803
diagonal : int, optional
18041804
Value to set on the diagonal of connectivity matrices. Default is 0.
18051805
fisher_z : bool, optional
@@ -1811,7 +1811,7 @@ class Static_Pearson(ConnectivityMethod):
18111811

18121812
def __init__(self,
18131813
time_series: np.ndarray,
1814-
cov_estimator: Literal[None, "LedoitWolf"] = "LedoitWolf",
1814+
cov_estimator: Literal[None, "LedoitWolf"] = None,
18151815
diagonal: int = 0,
18161816
fisher_z: bool = False,
18171817
tril: bool = False):
@@ -1849,7 +1849,7 @@ class Static_Partial(ConnectivityMethod):
18491849
time_series : np.ndarray
18501850
The input time series data.
18511851
cov_estimator : str, optional
1852-
Method to estimate covariance. If "LedoitWolf", it uses Ledoit-Wolf shrinkage. Default is LedoitWolf.
1852+
Shrinkage for covariance estimation. Can be None or Ledoit-Wolf. Default is None.
18531853
diagonal : int, optional
18541854
Value to set on the diagonal of connectivity matrices. Default is 0.
18551855
fisher_z : bool, optional
@@ -1861,7 +1861,7 @@ class Static_Partial(ConnectivityMethod):
18611861

18621862
def __init__(self,
18631863
time_series: np.ndarray,
1864-
cov_estimator: Literal["LedoitWolf", None] = "LedoitWolf",
1864+
cov_estimator: Literal["LedoitWolf", None] = None,
18651865
diagonal: int = 0,
18661866
fisher_z: bool = False,
18671867
tril: bool = False):
@@ -1952,11 +1952,28 @@ def estimate(self):
19521952
return self.fc
19531953

19541954
class Static_Covariance(ConnectivityMethod):
1955+
"""
1956+
Static functional connectivity method using covariance.
1957+
1958+
Parameters
1959+
----------
1960+
time_series : np.ndarray
1961+
The input time series data.
1962+
cov_estimator : str, optional
1963+
Shrinkage for covariance estimation. Can be None or Ledoit-Wolf. Default is None.
1964+
diagonal : int, optional
1965+
Value to set on the diagonal of connectivity matrices. Default is 0.
1966+
fisher_z : bool, optional
1967+
Whether to apply Fisher z-transformation. Default is False.
1968+
tril : bool, optional
1969+
Whether to return only the lower triangle of the matrices. Default is False.
1970+
"""
1971+
19551972
name = "STATIC Covariance"
19561973

19571974
def __init__(self,
19581975
time_series: np.ndarray,
1959-
cov_estimator: Literal["LedoitWolf", None] = "LedoitWolf",
1976+
cov_estimator: Literal["LedoitWolf", None] = None,
19601977
diagonal: int = 0,
19611978
fisher_z: bool = False,
19621979
tril: bool = False):

0 commit comments

Comments
 (0)