-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding functionalities for analyses.
- Loading branch information
1 parent
78832e3
commit 39e3412
Showing
9 changed files
with
176 additions
and
13 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 |
---|---|---|
@@ -1,6 +1,8 @@ | ||
# Generated by roxygen2: do not edit by hand | ||
|
||
export(crps) | ||
export(crpsContribClasses) | ||
export(crpsNbAnalogs) | ||
export(optimalNbAnalog) | ||
export(optimalNbAnalogOfAnalogs) | ||
export(parseNcOutputs) |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,17 @@ | ||
library(atmoswing) | ||
context("Optimal nb analogues of analogues") | ||
|
||
test_that("Optimal nb of analogues of analogues is correct", { | ||
A <- atmoswing::parseNcOutputs(file.path('test_files', 'optim', '1', 'results'), | ||
1, 'calibration') | ||
|
||
crps.nb.analogs <- atmoswing::crpsNbAnalogs(A, 5) | ||
|
||
target.a.nb <- atmoswing::optimalNbAnalog(crps.nb.analogs$crps.smoothed) | ||
|
||
res <- atmoswing::optimalNbAnalogOfAnalogs(A, target.a.nb$nb.min.med) | ||
|
||
expect_equal(res[5, 2], 3) | ||
expect_equal(res[6, 5], 5.5) | ||
expect_equal(res[24, 10], 8) | ||
}) |