lhs

Provides a number of methods for creating and augmenting Latin Hypercube Samples and Orthogonal Array Latin Hypercube Samples

https://github.com/bertcarnell/lhs

Science Score: 13.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (14.2%) to scientific vocabulary

Keywords

latin-hypercube latin-hypercube-sample latin-hypercube-sampling lhs orthogonal-arrays r r-package
Last synced: 6 months ago · JSON representation

Repository

Provides a number of methods for creating and augmenting Latin Hypercube Samples and Orthogonal Array Latin Hypercube Samples

Basic Info
Statistics
  • Stars: 48
  • Watchers: 2
  • Forks: 8
  • Open Issues: 10
  • Releases: 12
Topics
latin-hypercube latin-hypercube-sample latin-hypercube-sampling lhs orthogonal-arrays r r-package
Created about 7 years ago · Last pushed over 1 year ago
Metadata Files
Readme Changelog License Security

README.Rmd

---
title: "lhs"
output: 
  md_document:
    variant: markdown_github
  
---

```{r setup, include=FALSE} require(knitr) ``` ```{r badges, echo=FALSE, results="asis"} cat(paste0("|", paste0( c("Actions", "Code Coverage", "Website", "Doxygen", "CRAN Downloads", "CRAN"), collapse="|"), "|\n")) cat(paste0("|", paste0(rep(":---:", 6), collapse="|"), "|\n")) cat(paste0("|", paste0(c("[![R build status](https://github.com/bertcarnell/lhs/workflows/R-CMD-check/badge.svg)](https://github.com/bertcarnell/lhs/actions)", "[![Coverage status](https://codecov.io/gh/bertcarnell/lhs/branch/master/graph/badge.svg)](https://codecov.io/github/bertcarnell/lhs?branch=master)", "[![](https://img.shields.io/badge/pkgdown-lhs-blue.svg)](https://bertcarnell.github.io/lhs/)", "[![](https://img.shields.io/badge/Doxygen-lhs-blue.svg)](https://bertcarnell.github.io/lhs/html/index.html)", "[![](https://cranlogs.r-pkg.org/badges/lhs)](https://cran.r-project.org/package=lhs)", "[![CRAN status](https://www.r-pkg.org/badges/version/lhs)](https://cran.r-project.org/package=lhs)"), collapse="|"), "|")) ``` # lhs `lhs` provides a number of methods for creating and augmenting Latin Hypercube Samples and Orthogonal Array Latin Hypercube Samples. - Reverse Dependency Checks - [Depends](etc/revdep_README_Depends.md) - [Imports](etc/revdep_README_Imports.md) - [Suggests](etc/revdep_README_Suggests.md) - Docker Images for Testing - [lhs-debug](https://hub.docker.com/repository/docker/bertcarnell/lhs-debug) - [lhs-revdep](https://hub.docker.com/repository/docker/bertcarnell/lhs_revdep) built from [here](https://github.com/bertcarnell/r-debug) ## Installation You can install the released version of `lhs` from [CRAN](https://CRAN.R-project.org) with: ```{r install1, echo=TRUE, eval=FALSE} install.packages("lhs") ``` You can also install the development version of `lhs` from github with: ```{r install2, echo=TRUE, eval=FALSE} if (!require(devtools)) install.packages("devtools") devtools::install_github("bertcarnell/lhs") ``` ## Quick Start Create a random LHS with 10 samples and 3 variables: ```{r random, echo=TRUE} require(lhs) set.seed(1776) X <- randomLHS(n = 10, k = 3) ``` Create a design that is more optimal than the random case: ```{r compare, echo=TRUE} X_gen <- geneticLHS(10, 3, pop = 100, gen = 5, pMut = 0.1) X_max1 <- maximinLHS(10, 3, method = "build", dup = 5) X_max2 <- maximinLHS(10, 3, method = "iterative", optimize.on = "result", eps = 0.01, maxIter = 300) X_imp <- improvedLHS(10, 3, dup = 5) X_opt <- optimumLHS(10, 3, maxSweeps = 10, eps = 0.01) ``` ```{r compare.table, echo=FALSE} df1 <- data.frame( method = c("random","genetic","maximin","maximin","improved","optimum"), mean_dist = c(mean(dist(X)), mean(dist(X_gen)), mean(dist(X_max1)), mean(dist(X_max2)), mean(dist(X_imp)), mean(dist(X_opt))), min_dist = c(min(dist(X)), min(dist(X_gen)), min(dist(X_max1)), min(dist(X_max2)), min(dist(X_imp)), min(dist(X_opt)))) knitr::kable(df1[order(df1$min_dist, decreasing = TRUE),], col.names = c("Method", "Mean Distance", "Minimum Distance"), digits = 4) ``` Augment an existing design: ```{r augment, echo=TRUE} Y <- randomLHS(10, 5) Z <- augmentLHS(Y, 2) dim(Z) ``` Build an orthogonal array LHS: ```{r oalhs, echo=TRUE} # a 9 row design is returned because a 10 row design is not possible with these algorithms W9 <- create_oalhs(10, 3, bChooseLargerDesign = FALSE, bverbose = FALSE) dim(W9) # a 16 row design is returned because a 10 row design is not possible with these algorithms W16 <- create_oalhs(10, 3, bChooseLargerDesign = TRUE, bverbose = FALSE) dim(W16) ``` ## Help R-Help Examples of using the LHS package - [Latin hyper cube sampling from expand.grid()](https://stat.ethz.ch/pipermail/r-help/2007-January/124143.html) - [Latin Hypercube Sampling with a condition](https://stat.ethz.ch/pipermail/r-help/2011-June/279906.html) - [Latin Hypercube with condition sum = 1](https://stat.ethz.ch/pipermail/r-help/2008-November/180929.html) - [Latin hypercube sampling](https://www.mail-archive.com/r-help@r-project.org/msg192704.html) - [Latin Hypercube Sample and transformation to uniformly distributed integers or classes](https://stat.ethz.ch/pipermail/r-help/2013-October/361263.html) - [Latin hypercube sampling from a non-uniform distribution](https://stat.ethz.ch/pipermail/r-help/2017-August/448475.html) - [Latin Hypercube Sampling when parameters are defined according to specific probability distributions](https://stat.ethz.ch/pipermail/r-help/2017-June/447266.html) StackExchange Examples: - [Latin Hypercube around set points](https://stats.stackexchange.com/questions/370983/latin-hypercube-around-set-points) - [Latin hypercube sampling with categorical variables](https://stats.stackexchange.com/questions/388963/latin-hypercube-sampling-with-categorical-variables) - [Are Latin hypercube samples uncorrelated](https://stats.stackexchange.com/questions/147789/are-latin-hypercube-samples-uncorrelated) - [Stopping rule for Latin hypercube sampling (LHS)](https://stats.stackexchange.com/questions/407262/stopping-rule-for-latin-hypercube-sampling-lhs) - [Is a group of random hypercube samples equivalent to a single latin hypercube with more samples?](https://stats.stackexchange.com/questions/411085/is-a-group-of-random-hypercube-samples-equivalent-to-a-single-latin-hypercube-wi) - [Taking samples of data using Latin Hypercube Sampling](https://stats.stackexchange.com/questions/439271/taking-samples-of-data-using-latin-hypercube-sampling) - [Number of parameter sets generated by latin hyercube sampling](https://stats.stackexchange.com/questions/460918/number-of-parameter-sets-generated-by-latin-hyercube-sampling) - [Is there a way to check if sample obeys the Latin Hypercube Sampling rule?](https://stats.stackexchange.com/questions/465492/is-there-a-way-to-check-if-sample-obeys-the-latin-hypercube-sampling-rule) - [Effectiveness of Latin Hypercube Sampling](https://stats.stackexchange.com/questions/468202/effectiveness-of-latin-hypercube-sampling) - [Dividing CDF rather than PDF equally in Latin Hypercube Sampling](https://stats.stackexchange.com/questions/468293/dividing-cdf-rather-than-pdf-equally-in-latin-hypercube-sampling) - [Stratified sampling / QMC simulation for compound Poisson rv](https://stats.stackexchange.com/questions/469963/stratified-sampling-qmc-simulation-for-compound-poisson-rv) - [Using Latin Hypercube Sampling with a condition that the sum of two variables should be less than one](https://stats.stackexchange.com/questions/474911/using-latin-hypercube-sampling-with-a-condition-that-the-sum-of-two-variables-sh) - [How to generate a design for a response surface with a discrete input random variable?](https://stats.stackexchange.com/questions/444997/how-to-generate-a-design-for-a-response-surface-with-a-discrete-input-random-var) - [Is it necessary to shuffle X coordinates in Latin hypercube Sampling?](https://stats.stackexchange.com/questions/498492/is-it-necessary-to-shuffle-x-coordinates-in-latin-hypercube-sampling-lhc) ## Other lhs package announcement: [R-pkgs New R-Packages: Triangle and LHS](https://stat.ethz.ch/pipermail/r-packages/2006/000715.html)

Owner

  • Name: Rob
  • Login: bertcarnell
  • Kind: user
  • Location: USA
  • Company: http://pelotonia.org/robert.carnell

Physicist, Submariner, Nuclear Engineer, Statistician, Data Scientist, SCOTUS Watcher, Genealogist, Cancer Charity Rider

GitHub Events

Total
  • Issues event: 2
  • Watch event: 3
Last Year
  • Issues event: 2
  • Watch event: 3

Committers

Last synced: 9 months ago

All Time
  • Total Commits: 417
  • Total Committers: 5
  • Avg Commits per committer: 83.4
  • Development Distribution Score (DDS): 0.293
Past Year
  • Commits: 21
  • Committers: 1
  • Avg Commits per committer: 21.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Rob Carnell b****l@g****m 295
bertcarnell b****l@e****b 75
Robert Carnell r****l@h****m 25
CARNELLR C****R@e****b 21
stefan7th s****h@e****b 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 7 months ago

All Time
  • Total issues: 60
  • Total pull requests: 1
  • Average time to close issues: 5 months
  • Average time to close pull requests: about 1 month
  • Total issue authors: 8
  • Total pull request authors: 1
  • Average comments per issue: 1.37
  • Average comments per pull request: 2.0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 4
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 3
  • Pull request authors: 0
  • Average comments per issue: 0.25
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • bertcarnell (50)
  • ugroempi (4)
  • jessexknight (1)
  • Paudelrajan (1)
  • mllg (1)
  • massisenergy (1)
  • mb706 (1)
  • mdeamico (1)
Pull Request Authors
  • mb706 (1)
Top Labels
Issue Labels
enhancement (29) bug (17) question (3) wontfix (1)
Pull Request Labels
bug (1)

Packages

  • Total packages: 2
  • Total downloads:
    • cran 30,339 last-month
  • Total docker downloads: 33,522,981
  • Total dependent packages: 82
    (may contain duplicates)
  • Total dependent repositories: 102
    (may contain duplicates)
  • Total versions: 33
  • Total maintainers: 1
cran.r-project.org: lhs

Latin Hypercube Samples

  • Versions: 23
  • Dependent Packages: 78
  • Dependent Repositories: 101
  • Downloads: 30,339 Last month
  • Docker Downloads: 33,522,981
Rankings
Dependent packages count: 1.1%
Dependent repos count: 2.2%
Downloads: 2.4%
Average: 7.2%
Forks count: 8.7%
Stargazers count: 8.8%
Docker downloads count: 20.2%
Maintainers (1)
Last synced: 7 months ago
conda-forge.org: r-lhs
  • Versions: 10
  • Dependent Packages: 4
  • Dependent Repositories: 1
Rankings
Dependent packages count: 12.5%
Dependent repos count: 24.3%
Average: 33.0%
Stargazers count: 46.4%
Forks count: 48.9%
Last synced: 6 months ago

Dependencies

DESCRIPTION cran
  • R >= 3.4.0 depends
  • Rcpp * imports
  • DoE.base * suggests
  • assertthat * suggests
  • knitr * suggests
  • rmarkdown * suggests
  • testthat * suggests
.github/workflows/R-CMD-check.yaml actions
  • actions/cache v3 composite
  • actions/checkout v3 composite
  • actions/upload-artifact v3 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
.github/workflows/build_readme.yaml actions
  • actions/checkout v3 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/docker-builds.yml actions
  • actions/checkout v3 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
.github/workflows/pkgdown.yml actions
  • actions/checkout v3 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/rev-dep-check.yaml actions
  • actions/checkout v3 composite
.github/workflows/rhub-check.yml actions
  • actions/checkout v3 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
etc/Dockerfile docker
  • r-base latest build