-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1946a90
commit 6f2c254
Showing
7 changed files
with
92 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ Authors@R: c( person("Stavros", "Stavroglou", role = c("aut"), | |
comment = c(ORCID = "0009-0006-0095-0243"))) | ||
Maintainer: Hui Wang <[email protected]> | ||
Description: The model proposes a robust methodology for detecting and reconstructing the hidden structure of dynamic complex systems through short-term forecasts and information embedded in reconstructed state spaces. The approach not only identifies critical components and causal interactions within these systems but also provides a practical tool for optimizing system performance and stability. | ||
License: MIT + file LICENSE | ||
License: GPL-3 | file LICENSE | ||
Depends: R (>= 4.1.0) | ||
Imports: | ||
stats, | ||
|
@@ -28,7 +28,8 @@ Suggests: | |
rmarkdown, | ||
stringr, | ||
ggplot2, | ||
testthat (>= 3.0.0) | ||
testthat (>= 3.0.0), | ||
lintr | ||
Config/Needs/website: | ||
tidyverse/tidytemplate | ||
URL: https://github.com/skstavroglou/pattern_causality/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,17 @@ | ||
YEAR: 2024 | ||
COPYRIGHT HOLDER: Stavros Stavroglou | ||
GNU GENERAL PUBLIC LICENSE | ||
Version 3, 29 June 2007 | ||
|
||
Copyright (C) 2024 Stavros Stavroglou | ||
|
||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
|
||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
|
||
You should have received a copy of the GNU General Public License | ||
along with this program. If not, see <https://www.gnu.org/licenses/>. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# patterncausality 0.1.3 | ||
|
||
* Added cross validation function for pattern causality | ||
* Improved documentation and vignettes | ||
* Fixed bugs in parameter optimization | ||
* Added new plotting functions | ||
|
||
# patterncausality 0.1.2 | ||
|
||
* Initial CRAN release | ||
* Implemented core pattern causality algorithm | ||
* Added basic visualization tools |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Contributing to patterncausality | ||
|
||
Thank you for your interest in contributing to patterncausality! | ||
|
||
## How to contribute | ||
|
||
1. Fork the repository | ||
2. Create a new branch for your feature | ||
3. Make your changes | ||
4. Add tests for new functionality | ||
5. Run `devtools::check()` | ||
6. Submit a pull request | ||
|
||
## Code style | ||
|
||
* Follow the tidyverse style guide | ||
* Use roxygen2 for documentation | ||
* Add examples to function documentation | ||
* Keep functions focused and modular | ||
|
||
## Testing | ||
|
||
* Add tests for new functions | ||
* Ensure all tests pass locally | ||
* Maintain or improve code coverage | ||
|
||
## Documentation | ||
|
||
* Update vignettes if needed | ||
* Keep README.md current | ||
* Document all exported functions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
library(testthat) | ||
library(patterncausality) | ||
|
||
test_check("patterncausality") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
test_that("pcLightweight works", { | ||
data(climate_indices) | ||
X <- climate_indices$AO | ||
Y <- climate_indices$AAO | ||
|
||
result <- pcLightweight(X, Y, E = 3, tau = 2, | ||
metric = "euclidean", h = 1, | ||
weighted = TRUE, tpb = FALSE) | ||
|
||
expect_type(result, "list") | ||
expect_named(result, c("total", "positive", "negative", "dark")) | ||
expect_true(all(sapply(result, is.numeric))) | ||
expect_true(all(sapply(result, function(x) x >= 0 && x <= 1))) | ||
}) |