Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Latin hypercube sampling #59

Merged
merged 10 commits into from
Jun 12, 2020
Merged

Add Latin hypercube sampling #59

merged 10 commits into from
Jun 12, 2020

Conversation

kvcalvin
Copy link
Contributor

@kvcalvin kvcalvin commented Jun 4, 2020

Provide two options for sampling: latin hypercube and Sobol. Also, updates limits on parameter values.

R/main.R Outdated
@@ -33,6 +33,8 @@
#' @param aType Scenario type: either "Reference" or "Hindcast"
#' @param aIncludeSubsidies Boolean indicating subsidies should be added to profit
#' @param aDifferentiateParamByCrop Boolean indicating whether all crops should use the same expectation parameters
#' @param aUseLatinHypercube Boolean indicating that Latin Hypercube Sampling should be used (if FALSE, sobol sequences will be used)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Butting in on your PR, sorry. Would a better long term design be sampling_type = c("latin_hypercube", "sobol")? I.e. if you wanted to allow for more options down the road?

Copy link
Contributor

@abigailsnyder abigailsnyder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than the failing tests on the PR builds, which we have maybe narrowed down to dplyr updates, it looks good. Do we, however, need to update the DESCRIPTION file to add lhs to the imports?

@codecov-commenter
Copy link

codecov-commenter commented Jun 9, 2020

Codecov Report

Merging #59 into master will decrease coverage by 0.01%.
The diff coverage is 93.75%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #59      +/-   ##
==========================================
- Coverage   88.59%   88.58%   -0.02%     
==========================================
  Files          22       22              
  Lines        1666     1664       -2     
==========================================
- Hits         1476     1474       -2     
  Misses        190      190              
Impacted Files Coverage Δ
R/generate_price_data.R 0.00% <0.00%> (ø)
R/main.R 100.00% <ø> (ø)
R/process_hindcast_data.R 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 77fac50...985ede7. Read the comment docs.

@kvcalvin kvcalvin merged commit d0ff1f8 into master Jun 12, 2020
@kvcalvin kvcalvin deleted the latin-hypercube branch June 12, 2020 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants