Skip to content

Commit

Permalink
docs: update some docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
nicrie committed Oct 24, 2023
1 parent 38cadb9 commit 2795c54
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 21 deletions.
10 changes: 4 additions & 6 deletions xeofs/models/cca.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,13 +218,11 @@ def _fit_algorithm(self, views: List[DataArray]) -> Self:


class CCA(CCABaseModel):
r"""Canonical Correlation Analysis (CCA) model.
r"""Canonical Correlation Analysis.
Regularised CCA (canonical ridge) model.
CCA identifies linear combinations of variables from multiple datasets that
maximize their mutual correlations. An optional regularisation parameter can be used to
improve the conditioning of the covariance matrix.
Canonical Correlation Analysis (CCA) identifies linear combinations of variables from multiple datasets that
maximize their mutual correlations. An optional regularisation parameter (ridge regression)
can be used to improve the conditioning of the covariance matrix.
The objective function of (regularised) CCA is:
Expand Down
7 changes: 4 additions & 3 deletions xeofs/models/eof.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@


class EOF(_BaseModel):
"""Empirical Orthogonal Functions (EOF) analysis.
"""EOF analysis.
More commonly known as Principal Component Analysis (PCA).
Empirical Orthogonal Functions (EOF) analysis, more commonly known
as Principal Component Analysis (PCA).
Parameters
----------
Expand Down Expand Up @@ -236,7 +237,7 @@ def explained_variance_ratio(self) -> DataArray:


class ComplexEOF(EOF):
"""Complex Empirical Orthogonal Functions (Complex EOF) analysis.
"""Complex EOF analysis.
The Complex EOF analysis [1]_ [2]_ [3]_ [4]_ (also known as Hilbert EOF analysis) applies a Hilbert transform
to the data before performing the standard EOF analysis.
Expand Down
4 changes: 2 additions & 2 deletions xeofs/models/gwpca.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@


class GWPCA(_BaseModel):
"""Geographically weighted PCA (GWPCA).
"""Geographically weighted PCA.
GWPCA [1]_ uses a geographically weighted approach to perform PCA for
Geographically weighted PCA (GWPCA) [1]_ uses a geographically weighted approach to perform PCA for
each observation in the dataset based on its local neighbors.
The neighbors for each observation are determined based on the provided
Expand Down
4 changes: 2 additions & 2 deletions xeofs/models/mca.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@


class MCA(_BaseCrossModel):
"""Maximum Covariance Analyis (MCA).
"""Maximum Covariance Analyis.
MCA is a statistical method that finds patterns of maximum covariance between two datasets.
Expand Down Expand Up @@ -546,7 +546,7 @@ def heterogeneous_patterns(self, correction=None, alpha=0.05):


class ComplexMCA(MCA):
"""Complex Maximum Covariance Analysis (MCA).
"""Complex MCA.
Complex MCA, also referred to as Analytical SVD (ASVD) by Elipot et al. (2017) [1]_,
enhances traditional MCA by accommodating both amplitude and phase information.
Expand Down
14 changes: 6 additions & 8 deletions xeofs/models/opa.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,11 @@


class OPA(_BaseModel):
"""Optimal Persistence Analysis (OPA).
"""Optimal Persistence Analysis.
OPA identifies the optimal persistence patterns or
optimally persistent patterns (OPP) with the
largest decorrelation time in a time-varying field. Introduced by DelSole
in 2001 [1]_, and further developed in 2006 [2]_, it's a method used to
find patterns whose time series show strong persistence over time.
Optimal Persistence Analysis (OPA) [1]_ [2]_ identifies the patterns with the
largest decorrelation time in a time-varying field, known as optimal
persistence patterns or optimally persistent patterns (OPP).
Parameters
----------
Expand Down Expand Up @@ -46,8 +44,8 @@ class OPA(_BaseModel):
References
----------
.. [1] DelSole, T., 2001. Optimally Persistent Patterns in Time-Varying Fields. Journal of the Atmospheric Sciences 58, 1341–1356. https://doi.org/10.1175/1520-0469(2001)058<1341:OPPITV>2.0.CO;2
.. [2] DelSole, T., 2006. Low-Frequency Variations of Surface Temperature in Observations and Simulations. Journal of Climate 19, 4487–4507. https://doi.org/10.1175/JCLI3879.1
.. [1] DelSole, T. Optimally Persistent Patterns in Time-Varying Fields. Journal of the Atmospheric Sciences 58, 1341–1356 (2001).
.. [2] DelSole, T. Low-Frequency Variations of Surface Temperature in Observations and Simulations. Journal of Climate 19, 4487–4507 (2006).
Examples
--------
Expand Down

0 comments on commit 2795c54

Please sign in to comment.